PDA

View Full Version : A "Tower Defense" kind of help.


Deshank
02-21-2008, 10:56 AM
Hi,

I'm a big tower defense fan, but the only great one I've played so far has been manhandled already (Xeno Tactic).

So now I've been wanting to make my very own.

The problem is, Im unsure about what scripts to use.
I'm using CS3, and scripting in AS2.0

I need to know what functions etc you need to use in building up fx:
* Waypoints for multiple MC's (the road on which they need to walk)
* The towers' range check, and them shooting (perhaps MC's?) at the mobs.
* Turning and facing the direction of last shot
* Checking for collision between shots and mobs.

If someone knows a valid and in-depth tutorial, or can give tips right here it would be greatly appreciated

My skill is intermediate, but i dont mind spending loads of time on a tutorial if i in the end can create and alter in my very own Tower Defense :)

Thanks in advance!

rrh
02-21-2008, 03:33 PM
1) Simplest way would be an array of points {x:10,y:20} and have each goon approach one point until it reaches it, and then change to the next point. But that only works for the ones like Vector Tower Defense, where you can't alter the path by blocking them. I looked at Xeno Tactic, and that's the latter, which will require a path-finding function to determine which direction the goons will go. Like this:
http://theory.stanford.edu/~amitp/GameProgramming/Heuristics.html#S7
2) Pythagorean theorem for range check
3) Math.atan2(y,x)*180/Math.PI to get the angle
4) For loop within a for loop

I'm not aware of any in-depth tutorial.

been_1990
02-22-2008, 12:03 AM
Would this help: http://www.emanueleferonato.com/2007/10/06/make-a-flash-game-like-flash-element-tower-defense-part-1/
??