getting length in pixel when moving?

Non-platform specific questions.

getting length in pixel when moving?

Postby poopbrigade » Sat Jan 01, 2011 8:44 am

Hello everyone , :D can someone help me with this little problem.

is there a way to know how much pixel is used when a actor moves.

like 6 directional_velocity, does it move 6 pixels per second or is it just 1-2 pixel/s in a different speed of a timer depending on velocity?

and what about different angles?


thanx in advance XD....

the reason why I wanna know how,because I want to stop my actor before he collides, given that its speed will make the actor go through an object.

like when your actor is near another actor and its directional_velocity is 1000 and its distance between the collided actor is 1 pixel also the other actors height and width is about 1 pixel same with the colliding actor.

XD its bound to pass through...

again thanx in advace. ;D
When life gives you oranges, make orange juice. When life gives you poop, make fertilizer not poop juice.

Image
Current project __ CorPsEdEaRtH
Estimated work done __ 12%
User avatar
poopbrigade
 
Posts: 129
Joined: Thu Aug 27, 2009 12:17 pm
Location: In Earth. Being Burried XD
Score: 46 Give a positive score

Re: getting length in pixel when moving?

Postby skydereign » Sat Jan 01, 2011 8:59 am

The velocity variables hold a value, equal to the number of pixels the actor moves per frame. By default there are 30 frames per second. So if you want to know how many pixels the actor is moving, then simply use xvelocity and yvelocity. If you are using directional_velocity, and angle, then the xvelocity and yvelocity variables can still be used.
User avatar
skydereign
 
Posts: 3510
Joined: Mon Jul 28, 2008 8:29 am
Score: 589 Give a positive score

Re: getting length in pixel when moving?

Postby poopbrigade » Sat Jan 01, 2011 11:46 am

:?: Hmmm XD... thanX
When life gives you oranges, make orange juice. When life gives you poop, make fertilizer not poop juice.

Image
Current project __ CorPsEdEaRtH
Estimated work done __ 12%
User avatar
poopbrigade
 
Posts: 129
Joined: Thu Aug 27, 2009 12:17 pm
Location: In Earth. Being Burried XD
Score: 46 Give a positive score


Return to General

Who is online

Users browsing this forum: No registered users and 1 guest