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.

2D All the way! / Im Stuck in loops - how do you get 2 things to move at once?

Author
Message
Yossarian
20
Years of Service
User Offline
Joined: 21st Jul 2004
Location:
Posted: 5th Aug 2004 04:31
Im having trouble to get two things to move at once. e.g. if the player needs to shoot, it needs a do..loop to cycle through the frames of animation, but when thats happening other animation frames (e.g. for enemies etc) are unable to cycle. PLease could someone help me re-arrange my main loop ect.. I have attached my source so u can get the gist of what im on about (the main game starts 1/2 way down, also if you see anything else drastically wrong other than this let me know.

Ta
1tg46
21
Years of Service
User Offline
Joined: 1st Feb 2004
Location: I dont know!
Posted: 5th Aug 2004 07:01 Edited at: 5th Aug 2004 07:01
in your do...loop try puting a condition that when it reaches that condition it will stop.


or have one do...loop in another like:


I haven't tried it for the type of thing your doing, but this is my best logical guess.


Back from a long vacation too New Orleans

1tg46 is my name coding is my game.
Pincho Paxton
22
Years of Service
User Offline
Joined: 8th Dec 2002
Location:
Posted: 5th Aug 2004 10:21
Errr Noooo! Don't do any of the do loop inside a do loop...

Really, you just need

Sync On

At the beginning of your code, and ......

Sync

Near to the loop command.

Everything waits for the sync command to be called before you see anything happen.

Ilya
21
Years of Service
User Offline
Joined: 10th Aug 2003
Location:
Posted: 5th Aug 2004 12:45
I'm guessing:

do
if something=1
i=i+1
[some stuff]
if i=300 then something=0
endif
if spacekey()=1 then something=1
loop

-Ilya

Login to post a reply

Server time is: 2025-05-15 22:24:33
Your offset time is: 2025-05-15 22:24:33