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 / Detecting if object is not moving?

Author
Message
Jonk
19
Years of Service
User Offline
Joined: 31st Jul 2005
Location: East of Java
Posted: 1st Aug 2005 02:16
Been trying to detect if an object is stationary or anyone know some code.

Im Stuck

need the equivelent of :-

If Player1=notmoving then gosub idle

well something that does that
caleb870
19
Years of Service
User Offline
Joined: 13th Jul 2005
Location: LOOK! Over there!
Posted: 1st Aug 2005 02:42
Well what I think what your trying to do is to make the main player do a idle type of animation if he\she is not moving. Some mainly have it animate while the UPKEY, LEFTKEY, RIGHTKEY, DOWNKEY or what ever you have have the controls aren't being pressed.
Xolatron old
20
Years of Service
User Offline
Joined: 25th Jan 2004
Location: The Star Forge Language: DBpro
Posted: 1st Aug 2005 02:53
The programmer is really the one who controls if the object is moving. Use something like:


The object can't be moving unless you are telling it to.

BN2 Productions
20
Years of Service
User Offline
Joined: 22nd Jan 2004
Location:
Posted: 3rd Aug 2005 03:41
If the computer is controlling the model, at the end of your main loop(before the ai section), store its location into variables. Then at the beginning store its current position. Then if they are the same, make them shown as idle.

Hope this helps
master programmer
19
Years of Service
User Offline
Joined: 30th May 2005
Location: 3D Space
Posted: 3rd Aug 2005 06:28
Easy as this:

That is a very simply code. However, you can change the stop object code and make a new animation or what not. The choice is yours.

--------------------------------------
Vote for Excelsis on the Puzzle Game Compo

__________________________________________
<<<<<Check out my sites>>>>>
www.rhettgames.tk | www.slayerbattletanks.tk
Zotoaster
19
Years of Service
User Offline
Joined: 20th Dec 2004
Location: Scotland
Posted: 3rd Aug 2005 15:56
i think he wants to animate it when he stops.. just do this

if upkey()=1 then move=1 else move=0
if move=1 then [play walking animation]
if move=0 then [play idle animation]

Your signature has been erased by a mod because it's larger than 600x120...
Jonk
19
Years of Service
User Offline
Joined: 31st Jul 2005
Location: East of Java
Posted: 3rd Aug 2005 21:43
Yes thanks thats right im trying to animate my object when its idle but the code you guys sent seems to have worked, many thanks you guys
Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 4th Aug 2005 12:30
This could quickly get complex if you have many actions. What this does is try to create a sort of "action listener" like you would see Java. If the character starts moving, it'll through a flag up, but the flag only stays up for 1 loop. Same thing happens for when the character stops moving. It's designed to check if the action has happened, not if it is happening. I used sound clips so it's easier to know if its been detected or not. Showing text for 1 loop might not be visible.



PETA - People for the Eating of Tasty Animals

Login to post a reply

Server time is: 2024-09-24 01:25:31
Your offset time is: 2024-09-24 01:25:31