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! / *Making space shooter, problems with the bullets*

Author
Message
IsLaNdEr
20
Years of Service
User Offline
Joined: 20th Aug 2004
Location:
Posted: 20th Aug 2004 13:03
Hi everybody, I just started coding in DB for a couple of weeks now and i am interested in making a 2D space invader or galaga type game(seems a lot of people are trying this). I have a ship that can move around with a scrolling background and one enemy so far. The ship can shoot a bullet at the enemy and make a cool explosion when they collide. The problem is that I want to press the spacebar once instead of holding it down and I can't figure out how to make the bullet stay with the ship. Also I want to be able to shoot multiple bullets. Can anyone help me with this?

Thanks
Skeletor
20
Years of Service
User Offline
Joined: 21st Jun 2004
Location: florida
Posted: 20th Aug 2004 13:11
Check out my 2d shoot em up engine

http://darkbasic.thegamecreators.com/?m=codebase_view&i=d11306a419174f49c6622833c6513724

Its a complete 2d shoot 'em up game programmed for you to use as a reference or a basis for your own game. It should help you understand how to 2d shoot 'em up games work.

NOTE: If the download at the Codebase doesnt work go to my website at
http://www.angelfire.com/games5/db_games/ShootEmUp.html
and download the demo games there.


http://www.angelfire.com/games5/db_games/
IsLaNdEr
20
Years of Service
User Offline
Joined: 20th Aug 2004
Location:
Posted: 20th Aug 2004 13:47
Thanks Skeletor, thats a simple yet cool game. I actually downloaded this from you a few days ago reading other people's posts and played it. I just ended up taking the player and enemy ships because I liked them and I wanted to start my own game. I never did actually go back to the code and look at it for help, but now I will. Thanks a bunch, I will play around with the code a little and see if I can fix my problems.

Thanks, I appreciate the time you put in to help others
IsLaNdEr
20
Years of Service
User Offline
Joined: 20th Aug 2004
Location:
Posted: 20th Aug 2004 16:18
Whats up Skeletor! Just wanted to tell you that I figured out my problem. Thanks to your 2D game engine my bullets now follow the ship and shoot directly out of the ships barrel. That is after about thirty-five minutes of playing around with if statements. I think I can do the rest from here. Thanks for the help, I really appreciate!

Talk to ya later,
Island boy
IsLaNdEr
20
Years of Service
User Offline
Joined: 20th Aug 2004
Location:
Posted: 20th Aug 2004 17:44
Hey Skeletor,

I actually have another question for you. The game is running fine so far, the ship moves and shoots where it should just how I like it. But I kind of want it to shoot out about 5 bullets at a time. I tried changing the code around but couldn't get it to work. So I put it back where it was working fine and was hoping you could take a look at it. I tried making an array but not quite sure how to. If you could explain how to do this that would be great!

Thanks,
Islander
Skeletor
20
Years of Service
User Offline
Joined: 21st Jun 2004
Location: florida
Posted: 21st Aug 2004 01:11 Edited at: 21st Aug 2004 01:12
@ Islander
I know exactly what your talking about with the bullet problem. For my game in the Works I am using 4 bullet sprites instead of 1. What you have to do is make sure you draw the player sprite before the bullet sprites then line them up one on top of the other like this.

Bullet 1 |
Bullet 2 |
Bullet 3 |
Bullet 4 |




When the Fire key is pressed you shoot off Bullet #1 then when Bullet 1's Y coordinate is say <= 370 you shoot off Bullet#2 ect.




http://www.angelfire.com/games5/db_games/
Skeletor
20
Years of Service
User Offline
Joined: 21st Jun 2004
Location: florida
Posted: 21st Aug 2004 01:16 Edited at: 21st Aug 2004 06:56
When I get some time Ill see if I can implement it into your code for you

Also If you think I should make my more "Advanced" Shoot 'Em up game into a engine/Tutorial when I complete it like I did with my basic one let me know.

heres a link to my old "2d shoot 'em up engine" for those of you who missed it.

http://forum.thegamecreators.com/?m=forum_view&t=35457&b=7


http://www.angelfire.com/games5/db_games/
IsLaNdEr
20
Years of Service
User Offline
Joined: 20th Aug 2004
Location:
Posted: 21st Aug 2004 07:37
Hey thanks again Skeletor. I'll have to try the code snippet you just displayed. That would be cool if you had the time to just make a little more advanced 2D tutorial. I'm would definetly use it as a guide towards making my game and I'm sure others would too.

Thanks
Skeletor
20
Years of Service
User Offline
Joined: 21st Jun 2004
Location: florida
Posted: 21st Aug 2004 09:28
Heya Islander,
I was fooling around trying to use the same method I am using for mutiple bullets in my game but I couldnt get it to work the way I wanted it to.

However my more "Advanced" Shooter is still in works and I have only been able to implement a basic start menu and buy menu, money system, hidden timer to gain extra money, Animations (Which arent working the way I want them to but...), Basic Rifle, Heavy Machine Gun, Hand Grenade, Destructible SandBags, LifePacks and Health Packs. So I still need to create a first lv and work on AI.

Its going to play similar to the old Atari Game Commando and it will be mission based. The only thing I will probably need help with is when It comes time for Graphics. I have little artistic abilities and all my graphics I make are kinda crappy (Saddam's Army).


http://www.angelfire.com/games5/db_games/
IsLaNdEr
20
Years of Service
User Offline
Joined: 20th Aug 2004
Location:
Posted: 21st Aug 2004 10:46
Zup Skeletor. I think I'm just going to kind of hold of on my 2D space shooter until you finish your advanced tutorial. Then I don't have to ask you so many questions. Hopefully your game engine will be a good refrence and I will be able to comprehend it. (I think so because your last one I understood well, I just wasn't quite sure how to add on my own stuff without ruining it)Anyway, good luck with your coding and tell me whenever you get it up and running.

See ya!
P.S. I suck at graphics too, but I'm sure you can find some good sprites somewhere

Login to post a reply

Server time is: 2025-05-16 03:09:44
Your offset time is: 2025-05-16 03:09:44