Shoot-em-up

Started by Babar, Mon 25/08/2008 18:04:31

Previous topic - Next topic

Babar

I'm not sure this deserves a new topic, but considering that I am going to code everything from scratch, I thought I might as well get some help. Some of you might remember this little shoot-em-up type thing I made for the Coding Contest a while back. Here is a link.

For those of you who don't want to sift through ancient code, here is the rundown:

* It has a scrolling, looping room.
* It has the player character y decreasing constantly (ie. the player is moving up at a constant speed)
* The player moves around using arrow keys
* It has randomly appearing rocks (as objects) that block the player's path
* It has randomly appearing monsters (as objects) that can be shot at.
* Shooting occurs by checking if there is a monster object with the same x position as the player (There is no actual projectile).
* If the player goes over an object, the health decreases.


Okay, so now what I WANT, is:
* To have moving enemies. I don't mind so much if they don't move backwards and forwards (they should be moving towards the player anyway with the cEgo.y--), but I want them to at least move left and right (perpendicular to the motion of the player).
* I want some of them to be able to shoot back also.
* I don't know how it'll change at the back-end, but I won't be having any randomly generated immobile objects (like the rock objects in the example I linked).
* If it gets that far, I'd also want to have weapon upgrades, armour upgrades, etc.
* I'm not sure if it is better or worse this way, but should I go with actual projectiles? For stuff like 'missiles' and such, a little flashing muzzle isn't exactly the best idea, right?

Now I'm not asking for someone to code all this for me, I'd just like some help in the basics of how I'd go about it. Would it work on a framework like the one I had before?

* Like I'm assuming an armour upgrade object (which would appear when I blasted a monster) would increase the value of health (which I already have as a global int).
* Weapon upgrades might make sense if it took more than 1 shot to destroy a monster (which it doesn't now, and if it did, that would mean I should have variables for the health of each monster on screen?), or if the weapon did different things, like fanning out the missiles in different directions, or firing four at the same time, or something.
* In fact, how would I handle the monsters? I assume I'd use characters instead of objects (which I am using now), but will that cause a problem with collision detection? What about their movement?
* Also, whether speed upgrades would be of any use...

I'd appreciate help in this, and I wasn't sure where to post this, but C&C seemed the most appropriate place.


EDIT: Sorry, it appears I didn't have a compiled folder in that last rar. Put one in now, so you wouldn't have to download 2.72
The ultimate Professional Amateur

Now, with his very own game: Alien Time Zone

bicilotti

First of all, let me tell you I enjoyed the idea/prototype very much. Simple and addictive, I say.

Now then, for the scripting part, random bits of ideas:

-monsters: if you want to keep your game simple I suggest using objects as you are currently doing. Plus, you must add an int variable like number_of_enemies_on_screen (or noeos for readability's sake ;) ). Increase it every time a bad ass appears and decrease it after every kill.
In the routine that deals with adding a monster to screen put an if which will check if there are too many baddies on screen.

-the healt of the monsters can be handled via a simple array. movement with .Animate and lots of .x++ .y++ .y-- .x--
Extender functions are the clean answer. I found they are easy to script and immensely useful; plus, they keep your code tidy.

-for the projectiles, the story might be a bit more messy. If you plan to have plenty of them on screen at the same time (which would be AWESOME) you need a more refined method than the one I suggested for the enemies. In few words:

   -script a struct. The struct should contain of the info needed for the projectile (x, y, height, width, image_number, for example).
   -
(damn, AGS does not allow pointers to custom types, forget what I've said!)

    Ok, let's start again: script the struct, declare a biggish array.
    Now for every game cycle a) iterate through the array to DRAW the projectiles b) check the collisions too (between projectiles and baddies).

It shouldn't be too though on the CPU, draw using overlays or rawdraws.

End of random bits of ideas regarding the script part. I'm sorry if I wasn't clear (in that case don't hesitate to ask for more info).

======================

Now then, to the game itself.

I liked it much. It is extremely simple and extremely cliché, which are two ok things! Much of the gameplay is there and I personally think you should keep it as simple as possible.

I'd like too see moving / waving enemies. For the weapons part, I'd like to see grenades!

And the scrolling screen is a good thing, since it keeps up the pace of the game

ccccccccccccccccccccccccciao!

SMF spam blocked by CleanTalk