flight path for enemy behaviour

Hi
Does anyone have an idea how to make enemies fly into the screen in formation in a similar way to Galaga

For those who don’t know Galaga, here’s some videos - youtube

Cheers
Chris [import]uid: 7841 topic_id: 33393 reply_id: 333393[/import]

There is some code in the Community Code that helps deal with moving things along a curve.

See:
http://developer.coronalabs.com/code/bezier-curve-corona-sdk

and

http://developer.coronalabs.com/code/curved-lines-between-two-points

And see if that can get you started. Now given how low powered the CPU’s on those old Atari 8bit consoles were, I doubt they were doing a lot of math, and they probably had a table/array of pre-plotted points to move too rather that trying to do all the floating point math needed to do curve fitting, so you might want to consider that route as well. Get out a pad of graph paper, draw your spiral that they are spinning in on and extract the X, Y coordinates for each point along the curve. It’s “Old School” but it works. [import]uid: 199310 topic_id: 33393 reply_id: 132661[/import]

Magic! Cheers Rob. Had a quick scan of both of those and it should see me through.

Congrats on the staff badge btw :slight_smile: [import]uid: 7841 topic_id: 33393 reply_id: 132759[/import]

There is some code in the Community Code that helps deal with moving things along a curve.

See:
http://developer.coronalabs.com/code/bezier-curve-corona-sdk

and

http://developer.coronalabs.com/code/curved-lines-between-two-points

And see if that can get you started. Now given how low powered the CPU’s on those old Atari 8bit consoles were, I doubt they were doing a lot of math, and they probably had a table/array of pre-plotted points to move too rather that trying to do all the floating point math needed to do curve fitting, so you might want to consider that route as well. Get out a pad of graph paper, draw your spiral that they are spinning in on and extract the X, Y coordinates for each point along the curve. It’s “Old School” but it works. [import]uid: 199310 topic_id: 33393 reply_id: 132661[/import]

Magic! Cheers Rob. Had a quick scan of both of those and it should see me through.

Congrats on the staff badge btw :slight_smile: [import]uid: 7841 topic_id: 33393 reply_id: 132759[/import]

Thanks! [import]uid: 199310 topic_id: 33393 reply_id: 132997[/import]

Thanks! [import]uid: 199310 topic_id: 33393 reply_id: 132997[/import]

Hi Rob, 

This may be a very late response to your post about Bezier curves, but after many many hours of searching, I think I have found the holy grail for the small project I am working on.   

I do have a small problem as I don’t think I have fully understood the values of the parameters to pass.  As a part-time graphic designer working with vector graphics, I am very familiar with Beziers but I don’t quite get what those numbers in the function parameters represent.

For example, what sort of values do I need to pass if I want a curve that resembles an ‘S’ or some sort of sine, cosine wave?

Thanks in advance!  Your codes are simply brilliant!!

Hi Rob, 

This may be a very late response to your post about Bezier curves, but after many many hours of searching, I think I have found the holy grail for the small project I am working on.   

I do have a small problem as I don’t think I have fully understood the values of the parameters to pass.  As a part-time graphic designer working with vector graphics, I am very familiar with Beziers but I don’t quite get what those numbers in the function parameters represent.

For example, what sort of values do I need to pass if I want a curve that resembles an ‘S’ or some sort of sine, cosine wave?

Thanks in advance!  Your codes are simply brilliant!!