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 / i need help with multitasking...

Author
Message
gpex
19
Years of Service
User Offline
Joined: 29th May 2005
Location:
Posted: 21st Jun 2005 08:23
i'm working on this space shooter and i've got the space ship working and moving and the bullet moving but i cant figure out how to be able to keep moving the ship whenever the bullet is moving... any help would be great...




-gpex-

Your signature has been erased by a mod because it is larger than 600x120...
James Morgan
19
Years of Service
User Offline
Joined: 17th Apr 2005
Location: Behind you
Posted: 21st Jun 2005 09:02 Edited at: 21st Jun 2005 09:03
The reason why you cant move once you shoot is because of
Quote: "do
get image 2, 200,25,220,35
sprite 2,bulletx,bullety,2
bulletx = bulletx + 6
if bulletx > screentogo then delete sprite 2
if bulletx > screentogo then goto main
loop"


This invertly creates a loop which will not exit until the bullet reaches the screen width. What you can do however is rather than having the three sub routine, have one big DO LOOP and then instead of gosub lost you can put
lost = 1
if lost = 1
shipx = 1
shipy = 1
lost = 0
endif


Or in otherwords:


I have however kept quit as a gosub. This is because you don't need to return or have any loops when you quit...
Oh and I havent tested my code so if it doesnt work and you cant figure out why, just slap me.... (ouch, not that hard)

James

Hello!

Login to post a reply

Server time is: 2024-09-23 21:19:32
Your offset time is: 2024-09-23 21:19:32