Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 How to make moving object????????? HELP
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Priyesh




PostPosted: 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]
Sponsor
Sponsor
Sponsor
sponsor
copthesaint




PostPosted: 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.
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 2 Posts ]
Jump to:   


Style:  
Search: