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! / Can figure out how to move my ship and shoot at the same time

Author
Message
KRiMSON iCE
22
Years of Service
User Offline
Joined: 29th Jan 2004
Location:
Posted: 27th May 2006 08:49
I'm such a noob, I'm making a space invader clone ( I know, I know i'm original), but I can't figure out how to fire bullets and move at the same time. Every time I shoot I have to wait until the for statement or the while loop is finished and then I can move again. I'm seriously ripping my hair out here any help would be great.
Kevin Picone
23
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Australia
Posted: 27th May 2006 14:55
When moving characters in our games, we don't move each character from it's starting to end point inside it's own loop, rather, we step all character towards their end points each update.

Here's a bit of slap together example of how it done. (this code was written for PlayBasic, but it should run in DB/DBpro with minimal changes)




KRiMSON iCE
22
Years of Service
User Offline
Joined: 29th Jan 2004
Location:
Posted: 27th May 2006 18:48
thank you for you super fast response, i'll try this out right now and let you know the results, oh and a special thank you for making it simple

Login to post a reply

Server time is: 2026-07-04 11:44:57
Your offset time is: 2026-07-04 11:44:57