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 / play object

Author
Message
smerf
19
Years of Service
User Offline
Joined: 24th Feb 2005
Location: nm usa
Posted: 16th Aug 2005 17:05
USING DBPRO
how do i get my animation to play when i push up without this loop problem. as you can see the computer says ok the key has been presse play the animation then loop. but it loops to fast for the animation to fully play out. and i cannot use a wait or pause command cause it would slow down my game loop
this is just an example

do
if upkey()=1
play object 3,0,23
endif
loop

A child's dream never dies.
Me!
19
Years of Service
User Offline
Joined: 26th Jul 2005
Location:
Posted: 16th Aug 2005 20:22 Edited at: 16th Aug 2005 20:23
that would only be a problem if you held the upkey down (as you would if you where moving the object), what you need to do is to start the object playing and then leave it alone, if you keep asking it to play then it will be stuck right at the start of the animation, try this

do

if upkey()=1 and playing=0
play object 3,0,23
playing=1
endif

loop


that will start the animation playing and then leave it playing for as long as the flag "playing" is equal to 1, when you want to end the animation playing and leave it available to play again then set "playing" to zero and stop the animation, I think this is what you meant anyway, post again if it isn`t.

smerf
19
Years of Service
User Offline
Joined: 24th Feb 2005
Location: nm usa
Posted: 17th Aug 2005 03:32
TY FOR THE HELP I SOLVED MY PROBLEM ACTUALLY RIGHT AFTER I POSTED THIS THREDE I HATE IT WHEN i do that. anyway this is the approach i took it is the same as yous just alittle different it stops the animation when the key is realeased
obplay#= object playing(3)
if upkey()=0
if obplay# =1
stop object 3
endif
endif
if obplay# =1
gosub obplay:
endif
if upkey()=1
play object 3,72,96
endif
obplay:

A child's dream never dies.

Login to post a reply

Server time is: 2024-11-27 20:45:24
Your offset time is: 2024-11-27 20:45:24