Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / get object movement

Author
Message
Oolite
19
Years of Service
User Offline
Joined: 28th Sep 2005
Location: Middle of the West
Posted: 14th Apr 2006 17:09
hi

How do i get that an object is moving?

Like say if it is moving down, how do i get the game to recognise it is moving down, and display something on the screen.
The reason being, is that i want to play a (for eg) fall animation for when it is moving downwards...

Any help appreciated...

gbark
19
Years of Service
User Offline
Joined: 14th Oct 2005
Location: US - Virginia
Posted: 14th Apr 2006 17:33 Edited at: 14th Apr 2006 17:36
First, store the position of the object before it has moved. Then, after you have moved the object however you want (controlled by player or by computer, applied physics, etc), it is a simple matter of subtracting the old position you stored from the new position of the object to get the difference it has moved.

Oolite
19
Years of Service
User Offline
Joined: 28th Sep 2005
Location: Middle of the West
Posted: 14th Apr 2006 17:59
nice one

cheers!

Login to post a reply

Server time is: 2024-11-26 23:28:59
Your offset time is: 2024-11-26 23:28:59