Changing Colours
Author |
Message |
mike200015
|
Posted: Thu Jan 20, 2005 10:49 pm Post subject: Changing Colours |
|
|
Hey everyone hows it goin.. i have a program i made which draws watever shape you pick. In the program you choose a colour for the shape, and what i want to do is make it so that you can press the right arrow key to increase the colour by 1, and if you press the left arrow key then it will decrease the colour by 1.
If anyone can help me i would really appreciate it!
Thanks so much. |
|
|
|
|
|
Sponsor Sponsor
|
|
|
Delos
|
Posted: Thu Jan 20, 2005 10:53 pm Post subject: (No subject) |
|
|
1)
Hello.
2)
In future, post your code (using [code] or [syntax] tags) so that we can assess what level you are at and how best to answer your question.
3)
In this case you'll need to be able to receive input from the User and determine which key was pressed. Depending on what method you use (get, getch, Input.KeyDown) use an if structure to determine what will happen to the colour variable that you have for your shape.
e.g. (pseudo code , I'll let you figure out the good stuff)
[code]
if entered_key = Left arrow then
colourNumber += 1
elsif entered_key = right arrow then
colourNumber -= 1
end if
DrawShape
[/code] |
|
|
|
|
|
basketball4ever
|
|
|
|
|
|
|