Archived

This topic is now archived and is closed to further replies.

Shmup style game

This topic is 5337 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

I''m making a shmup (2d vertical shooter) and was wondering what the best way to program the different attacks would be. If you''ve ever played one of those games you know that some of the attacks are like highly orchestrated events with explosions going off all over the screen etc. I want to be as flexible as possible but doubt I would be able to create an effect like that by loading in a text file with values. I don''t want to have to hard-code each individual attack like this...
switch(player->currentAttack)
{
    case ATTACK_MACHINEGUN:
         ExecuteMachineGun();
         break;
    case ATTACK_BOMBARDMENT:
         ExecutePlaneFlyBy();
         break;
}
 
...but is this the best way? It doesn''t seem very flexible to me. Scripting the attacks is also something I''ve been looking into, using Lua or the like. Eventually I would like to get a Lua script engine up but fear I lack the experience to do so. Any suggestions for what I want to do?

Share this post


Link to post
Share on other sites
It looks ok for me. If you use C++ you can use polymorphism to do the job just like Object:ExecuteFire() or something.
I see that people have the tendency to make the code too generic.
You want to make a game dev kit or a game ?
Petru.

Share this post


Link to post
Share on other sites