Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length

 
Advanced search

877978 Posts in 32896 Topics- by 24323 Members - Latest Member: nickFromPaintteh

May 20, 2013, 11:06:57 PM
TIGSource ForumsDeveloperTechnical (Moderators: Glaiel-Gamer, ThemsAllTook)Methods for Coding Enemy Flight Paths? (Flixel/AS3)
Pages: [1]
Print
Author Topic: Methods for Coding Enemy Flight Paths? (Flixel/AS3)  (Read 726 times)
VictorGrunn
Level 0
***


View Profile Email
« on: April 18, 2012, 03:26:52 PM »

I'm in the middle of making a side-scrolling shooter style game, working with the Flixel library. (Thinking of moving to Flashpunk soon, but for now Flixel is what I'm familiar with.)

Now, I can think of a few ways to animate the flight paths of the enemies that appear onscreen. To give a few examples I've figured out...

* Straight up velocity/acceleration changes, obviously. Kind of hard to get too inventive with this on its own.
* Flixel's pathfinding. I haven't used this yet, but it seems like a no brainer for getting enemies to move in a pattern.
* TweenMax. It takes a lot of trial and error in my experience to use this right, but you can pull off some real interesting patterns using this.

What I'm wondering is, are there any good methods I'm missing? I vaguely recall something about placing enemies using a Tilemap and somehow having that scroll across the screen, but I forget where I read about this.

I can think of a few more obvious ones - the basic examples that involve trig to get enemies moving in sine wave patterns and all. But I just get the impression I'm overlooking some other really nice and accessible methods.
Logged
Fallsburg
Level 10
*****


Fear the CircleCat


View Profile WWW
« Reply #1 on: April 18, 2012, 03:36:44 PM »

So, this article is about doing Shmup enemy paths in stage3d, but given that Rich has done a ton of stuff for Flixel it wouldn't surprise me if it would be relatively easy to transfer to Flixel.
Logged

VictorGrunn
Level 0
***


View Profile Email
« Reply #2 on: April 18, 2012, 04:57:45 PM »

Actually, TweenMax is fantastic for this. It does similar to what Photonstorm is trying over there, but it's immediately available. Still, it has its limitations.
Logged
Moczan
Level 5
*****



View Profile
« Reply #3 on: April 19, 2012, 02:56:01 AM »

Remember that TweenMax just changes a numeric value over time with additional ease function, so you still have to come up with clever math to do the actual path.
Logged
VictorGrunn
Level 0
***


View Profile Email
« Reply #4 on: April 19, 2012, 12:34:09 PM »

Remember that TweenMax just changes a numeric value over time with additional ease function, so you still have to come up with clever math to do the actual path.

Yes and no. Have you ever checked out the tweenmax bezierthrough example tool on the tweenmax site? You can pretty much draw a path and it spits out the code. The only issue I have with it is I'd need it at a different resolution than they cover.
Logged
cplhasse
Level 0
***


View Profile
« Reply #5 on: April 19, 2012, 01:45:28 PM »

Splines or bezier curves should let you design paths quite easily while still having a lot of flexibility. You don't need to dig too deep into the math to use them either, you can just look up an algorithm and implement it.
Logged
Pages: [1]
Print
Jump to:  

Theme orange-lt created by panic