Jump to content
  • Advertisement
Sign in to follow this  

about action game

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

now, i'm developing a action game like raiden 2. I want to control the game progress.for instance, when game start,after 3 sec, the craft will enco- unter enemies, 10 sec later,enemies disappear, then a boss comes out. I thought out two ways to implemented the ideas above.please tell me which one is better for mobile games.One is use a time line: draw enemies draw boss ----|----------|------|-----> 0 3rd sec 13th sec the other one is: draw enemies in the area above the screen, the enemies need to take 3 sec to cover the distance between its birth place in unvisible area to visible area. for example: ------------------------- screen that can't view by players _ --|-- <---enemy ------------------------- 3 sec distance ------------------------- screen that player can view ------------------------------- if enemy.y > 126 draw boss at -40 if boss.y > 126 draw another boss and so on..... y is enemy's y coordinate 126 , -40 is pix. if u have a better idea for this kind of game, please tell me.thank you for reading this post. cheer! [Edited by - dracula_zmm on August 27, 2004 5:04:00 AM]

Share this post

Link to post
Share on other sites
I "invented" a nifty system for this. I looked up Raiden, and it's a top down scroller.

First of all, you start with a map in which you store all attacking fighters from the enemy. Each enemy has a position in the field on which it will spawn. It can either be time or distance travelled. I used distance travelled in here

When the player has travelled 12 units(Whatever it will be, up to you) you want to spawn 3 enemy fighters. We store each spawn point in a struct for simplicity.

struct SpawnPoint
int nDist;
int nPosX; // X axis on where the plane will appear
EnemyType Type; // Type of attacker, fighter, bomber, etc.

Assuming you have a dead simple file format of just storing a bunch of these structs into the file, we do this:

// open file, read number of SpawnPoints and allocate memory

fread(m_SpawnList, sizeof(SpawnPoint) * PointCount, 1, pFile);

// Close file

Now we got the spawn points in memory. Best thing to do now is to sort them in an std::list with the lowest nDist on the front.

Now, every frame you increase the Player::DistanceTravelled a bit. Now, when this read the nDist of the FIRST item in the list, you know you have to spawn a new enemy. Spawn the enemy, delete the node from the list and get the next node. Compare the nDist again(You might want to spawn multiple enemies at the same dist) and if they match, SPAWN.

And now you got yourself a working spawn system(In theory)


Share this post

Link to post
Share on other sites
Thank you guys.~~~

I've implemented Toolmaker's idea~~~

Thank your very much, Toolmaker.

I have another question:

how to create enemy class?

I have two ideas.

One is create a class for each type of

enemy, this class control the track and enemy's image of each

enemy.Unforturnately,if I have 20 enemies in this mobile game,

I have to create 20 enemy classes, it's too many for a mobile

game, I suppose.

The other, I wanna create one enemy class, according to the

enemies type, I deliver some data struct,store the track

of that type enemy, into the move() method.

I don't know how the action game like raiden create enemy

classes, if some one knew, give a hint.:)

At last, if you have some better idea, please tell me!!:)

Thank you very very much!!

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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!