Computer Science Canada

How to make moving object????????? HELP

Author:  Priyesh [ Tue Jun 12, 2012 5:46 pm ]
Post subject:  How to make moving object????????? HELP

Im trying to make a horse that can be moved from left to right using the arrow keys.
How can I make it so that i can have multiple shapes being moved together, for example:
drawfilloval (??,??,??,??,??)
drawfilloval (??,??,??,??,??)
drawfilloval (??,??,??,??,??)
drawfillbox (??,??,??,??,??)

And i want all of that to move as well when the user presses left or right arrow keys.





var x,y : int
x:=100
y:=100

var keypress : array char of boolean

loop
Input.KeyDown (keypress)


if keypress (KEY_RIGHT_ARROW) then
x:=x+5
end if

if keypress (KEY_LEFT_ARROW) then
x:=x-5
end if

drawfilloval(x,y,80,50,red)
delay(60)

cls
end loop
[list=][/list]

Author:  copthesaint [ Wed Jun 13, 2012 10:20 am ]
Post subject:  RE:How to make moving object????????? HELP

First of all, your title Should only be Moving Object, placing help and all the "?"'s at the end of it is pointless since you posted in the Help section of turing.

As for your question, you just draw your horse the way you like it, then move the parts of the horse by the position of x and y by adding.


: