Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / Side scrolling enemy locations

Author
Message
Programmer of Power
19
Years of Service
User Offline
Joined: 22nd Aug 2005
Location: Home
Posted: 28th May 2008 03:01
I'm working on a side scrolling shooter [along the lines of Raiden except rotated 90 degrees]. How do I go about putting enemies in waves? As in... enemies in these games usually have certain locations in the waves and patterns that they follow, not just random positioning.

"I will work harder... if you ask me enough times... or give me enough coffee"
Want to make money on the net? Check this out.
http://kempcreations.com/MoneyMaking.aspx
pcRaider
17
Years of Service
User Offline
Joined: 30th May 2007
Location:
Posted: 28th May 2008 08:58
sin wave?

TDK
Retired Moderator
21
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 28th May 2008 16:46
You could also have a procedure or function for each pattern which sets the position of each ship based on offsets of the first one.

For example, for a V pattern you would place the first one in the centre then the second row would be calculated as X amount to one side of the first and Y amount back - and so on. This could easily be done with a For..Next loop with very little maths.

As they all move in the same direction and the same speed they would stay in formation.

More complicated formations would as pcRaider says involve a bit of maths.

TDK_Man

Login to post a reply

Server time is: 2024-11-15 18:03:05
Your offset time is: 2024-11-15 18:03:05