Jump to content
  • Advertisement
Sign in to follow this  
Harkonnen

How to generate moving schemes for sprites

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

[color="#323D4F"]Hi,

Do you know a very old game called Galaga ? It's a shoot'em'up in which enemy waves come from the top of the screen, and make a few loops before adding to the ranks at the top with the others.
[color="#323D4F"]
I'm developing a clone of that game for Android, and I wonder if there's a tool or a method I could use to generate the coordinates used for these loops of my enemy sprites.

You can see this game here : http://jeu.info/galaga-flash.html

Thanks in advance

Share this post


Link to post
Share on other sites
Advertisement
Well, what you could do is before a group of enemies spawns in, you could randomly generate a list of actions that they will perform before being added to the front line (move in a straight line for distance d, arc at radius for d...). Then use a few algorithms to create a vector of coordinates that the enemies move along based on their speed.

Bresenham's algorithms:
http://free.pages.at/easyfilter/bresenham.html

You should be able to adapt those to your needs (and I'm sure you could find more on google). You could also use sin and cos to create some movement. Good luck!

Share this post


Link to post
Share on other sites
Make a few parametric curves from out-of-screen spawning points to somewhere in front of the rank. If a group of places is free, decide to spawn a group of enemies. Select one of the curves. Generate one enemy at a time at the spawning point end of the curve, and let it follow the curve with a given speed. For each enemy reaching the end of the curve, detach it from the curve and let it fly along the (perhaps straight) line from the curve's end to its target position.

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!