Computer Science Canada

Moving Object with Multiple Shapes?

Author:  Priyesh [ 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>

Author:  copthesaint [ 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.

Author:  Priyesh [ 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?????????????/

Author:  Amarylis [ 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

Author:  Priyesh [ 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

Author:  Amarylis [ 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


: