maybe a simple movement question

mutazoid

Member
Im trying to move an object a short amount of space then make it stop.
The problem is I dont know which way it will be facing.
Im just wondering if there is a better solution.

This is my solution:
Set an alarm.
Set speed=2
When alarm ends set speed=0
(I dont remember the code for alarms so I will look that up)

Thanks for any help ;)
 
W

whale_cancer

Guest
I'm not sure how not knowing which way it is facing would be a problem? Your pseudo-code should work.
 
W

Wild_West

Guest
Im trying to move an object a short amount of space then make it stop.
The problem is I dont know which way it will be facing.
Im just wondering if there is a better solution.

This is my solution:
Set an alarm.
Set speed=2
When alarm ends set speed=0
(I dont remember the code for alarms so I will look that up)

Thanks for any help ;)
you could also just cap off motion and save the bother of using alarms

speed = 2;
if( x or y > xstart or ystart by some number ){ speed = 0;}

and the same for the reverse direction just using xstart < some negative number.

That's how I set up my rising platforms
 
You can use the built-in direction variable to get which way it's facing, in degrees. You can also set the direction if you want
 
W

Wild_West

Guest
the only issue with this solution is I wont know which way the object will be moving
Shadowspear1 is right, I mean without direction speed, vspeed and hspeed don't really move you anywhere anyway.
Well actually SPEED won't but with hspeed and vspeed just using a negative value will move your object left for hspeed and up for vspeed as the x-= and y-= vaules would.
 
Top