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.

DarkBASIC Discussion / space invaders bullet problem

Author
Message
Mr Inquisitive
20
Years of Service
User Offline
Joined: 5th Feb 2005
Location: Who Cares?
Posted: 2nd May 2005 13:27
im remaking space invaders, and i programmed the bullet, but when it shoots, it wont move on it's own, and it'll only shoot once. Can someone tell me how to fix these problems
(DBC)
Here's the code in case it will help.

Horus Game Developments
freewebs.com/horusgames
Sven B
20
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 2nd May 2005 20:35
Maybe you can use the dim() command to control bullets.
Like this:




It could be buggy because i didn't test it.
hyrichter
21
Years of Service
User Offline
Joined: 15th Feb 2004
Location: Arizona
Posted: 3rd May 2005 22:31
You need to have a variable called "isShooting" or something like that that gets set to true when you push the space-key. Then while that variable is true, move your bullet. Once the bullet hits a certain value (bullety<0, for example), you set your "isShooting" variable to false. Also, you'll need to set bulletx and bullety to their original values. Modify your bullet shooting code to this:



It looks like you still need to program collision, but this will make your shooting work nicely. I admit, you made me want to forsake my DBPro project for a while and program a quick space-invaders game.


Login to post a reply

Server time is: 2025-05-23 00:06:22
Your offset time is: 2025-05-23 00:06:22