Jump to content
  • Advertisement
Sign in to follow this  
Jacques Belosoukinski

ShotManager class for Shoot'em Up

This topic is 2122 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi to all of you,
I'm asking for your help because I am new in the universe XNA. This is for two weeks I started to learn C # and XNA to create 2D games. I read some tutorials, books etc.. But I still can not my own. Two weeks is a little over is not it?
Anyway, now I have likened the creation of the sprite class to create other sprites on the screen. My main project is a Shoot'em Up in the style of Batsugun (SEGA Saturn), I develop a class ShotManager but I really do not know how to do it. In the tutorials, there are always different ways and this is not what I want.

I know it must create sprites in a loop when the player presses the fire. It is necessary to create a table to store all the shots that will be launched from the ship's position. Except that in practice I do not know where to start!
I created a value "enum" because I intend to insert different type of gun. This gives:
private enum {TypeA gunType, TypeB etc..}

Naturally has every type of weapon, the sprite is different as well as its speed, power and duration (overheating after 15 seconds of use, for example). So I just need a class that could handle it all, if you could point me to a simple code will be great.
I saw that there are various projects including library manager of bullet physics, is it suitable for my project?
Too bad there is not a lot of source code on in XNA Shmup to understand how mechanisms such as the position of the enemy (non-random) and the famous shots.

Thank you for your answers. Sorry for my english, I'm french ^ ^

Share this post

Link to post
Share on other sites
So this may sound condescending, but it's not meant to be. But a manager needs to manage something.

If you want a shot manager, I'd recommend starting with creating a Shot class. Have it take in a Sprite to draw, and enum that defines it's behavior, and it's starting position and orientation.

Then have the shot either be added to the manager and updated from there, or have a manager wrap around that functionality and provide a ShotHandle to the entity that fired the shot. (As a rule, I prefer the former, makes the user interaction much more transparent.)

Good Luck!

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!