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

Username:   Password: 
 RegisterRegister   
 Moving Object with Multiple Shapes?
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 2:26 pm   Post subject: Moving Object with Multiple Shapes?

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.


Turing:


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



Please specify what version of Turing you are using
<Answer Here>
Sponsor
Sponsor
Sponsor
sponsor
copthesaint




PostPosted: Wed Jun 13, 2012 10:24 am   Post subject: RE:Moving Object with Multiple Shapes?

If you purposly double post your user will be removed, There is already one post spamming a bunch of the same topic wont get any answers sooner. Instead of spamming your question you could spend that time searching for a tutorial that would help you with your problem.
Priyesh




PostPosted: Thu Jun 14, 2012 6:53 am   Post subject: Re: RE:Moving Object with Multiple Shapes?

ok thanks for the heads up sorry bout that,
so can u help me?????????????/
Amarylis




PostPosted: Thu Jun 14, 2012 7:00 am   Post subject: RE:Moving Object with Multiple Shapes?

If you use the same base coordinate (i.e. every coordinate is relative to a variable), when you update the variable then redraw the images, the entire thing will be shifted. Another thing you could do (easier) is look into Pic.New and Pic.Draw
Priyesh




PostPosted: Thu Jun 14, 2012 8:42 am   Post subject: Re: RE:Moving Object with Multiple Shapes?

i cant use picdraw cause my teacher wants us to make the pictures from scratch, but ill try the other way
Amarylis




PostPosted: Thu Jun 14, 2012 2:11 pm   Post subject: RE:Moving Object with Multiple Shapes?

If you draw the original image and then save it with Pic.New, you will have made the picture from scratch
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  [ 6 Posts ]
Jump to:   


Style:  
Search: