The Daily Click ::. Forums ::. Non-Klik Coding Help ::. Regarding enemy flying patterns in shoot'em ups
 

Post Reply  Post Oekaki 
 

Posted By Message

Lazernaut



Registered
  08/09/2002
Points
  1103

VIP MemberThe Cake is a LieIt's-a me, Mario!Wii OwnerPokemon Ball!
4th October, 2011 at 13:36:56 -

I was just wondering about how you guys go about something. I'm making a side scrolling shoot'em up. I've made a system so I have, for example, a file called "level01.map". This map has "commands" like this:

fish,300,500
fish,350,500
etc.

The format is like this:
<enemy type>, <amount of ticks before enemy is spawned>, <position on the Y axis when spawned>

I was wondering how you guys would go about making these enemies fly in different patterns? My first thought is that maybe you could make a private variable for the enemy called "Pattern". Then if "Pattern" is 0 you could check its height and set "Pattern" to a different number that then decides which pattern to use. This would make it so it was the starting height of the enemy that determines how it should fly.

I'm sure there's a more efficient way of doing it though. What do you guys think?

Not that it matters (far as I can tell) but I'm working in Construct.

 
n/a

Knudde (Shab)

Administrator
Crazy?

Registered
  31/01/2003
Points
  5125

Has Donated, Thank You!Clickzine StaffKlikCast StarVIP MemberGhostbuster!Dos Rules!I donated an open source project
4th October, 2011 at 20:49:03 -

The question becomes this. Are you going to apply a set number of patterns to different enemies, or will each enemy type have it's own general pattern that's modified by it's Y axis starting position?

 
Craps, I'm an old man!

Lazernaut



Registered
  08/09/2002
Points
  1103

VIP MemberThe Cake is a LieIt's-a me, Mario!Wii OwnerPokemon Ball!
4th October, 2011 at 20:58:57 -

I haven't really decided yet. I think whatever is fastet to implement

Maybe there's some sort of curve equation I can use so I just need a few events for each pattern (like, every tick add 1 to variable, then set object's position according to some equation using said variable)?

 
n/a

Knudde (Shab)

Administrator
Crazy?

Registered
  31/01/2003
Points
  5125

Has Donated, Thank You!Clickzine StaffKlikCast StarVIP MemberGhostbuster!Dos Rules!I donated an open source project
5th October, 2011 at 16:02:55 -

A simple Sin equation should do what you want.

What's easier to put in, that's easy. Assigning enemies to random patterns. What's best design-wise? Each enemy has their own pattern.

 
Craps, I'm an old man!
   

Post Reply



 



Advertisement

Worth A Click