Tower defense-like towers

Hi folks,
I am trying to implement towers into my game which are shooting incoming enemies. There are certain mechanics which I can't really figure out how to create. Maybe you guys can give me some hints, help or even templates. The towers should: ..
.. Shoot spawned incoming opponents automatically
.. Switch to the next opponent after the one shot before is dead
.. Optional: Always shoot the closest opponent
Since Gamesalad doesn't have Arrays (yet) I really have a hard time thinking about how to
store the spawned enemies X,Y coordinate and how to switch targets etc.
Thanks for your time and help!!
greez
I am trying to implement towers into my game which are shooting incoming enemies. There are certain mechanics which I can't really figure out how to create. Maybe you guys can give me some hints, help or even templates. The towers should: ..
.. Shoot spawned incoming opponents automatically
.. Switch to the next opponent after the one shot before is dead
.. Optional: Always shoot the closest opponent
Since Gamesalad doesn't have Arrays (yet) I really have a hard time thinking about how to
store the spawned enemies X,Y coordinate and how to switch targets etc.
Thanks for your time and help!!
greez
Comments
i've tried range based with magnitude, i've tried overlap.
the issue i'm having is you cant communicate attributes directly between actors which means when one target gets in range of any gun....then all the guns fire at that target.
Darren, from deepblueapps and UtopianGames, has a template you might have to buy to figure out everything.
I don't think it's that simple enough for people to describe it in one post.
Here's the template:
There's a video in it that shows off the whole template; waves, enemies, levels, bosses, etc. and according to the information below the video, he has put notes in all actors explaining how the code works!
I don't know how much £10 (~$16) is for you, but I guess it's not that much for this awesome TD template.
In my case, I can't be purchasing things as I want, I'll have to be patient for now. Plus, I am working in my first game and certainly it wont be a TD game :P.
Note: I don't get commission for this. Lol.
[ds]
give all your towers an attribute "self.target"
then you have to make a new actor for every enemy.
Then youd have to make an attribute for every enemy for the tower to determine magnitude: then give the tower this rule for every enemy:
when self.enemy1distance < 100(whatever distance you want) then change attribute "self.target" to 1.
when "self.target = 1" spawn actor bullet, direction(magnitude).
I have a project i started that has like 2-3 enemys, that i postponed until tables/array update. I'll email you the project if you want to take a look.
thanks for your comments. Maybe I will buy the template, have to think about that.
@FloridaGames: Would be nice if you could email me the project at bjoernfrechenhaeuser@daubit.org thx!!
Having to create every actor by hand and creating attributes for that actor is exactly what I want to avoid. Because in my game I want to have many enemies and it would be more than tideos to create like 50 enemies by hand...
Hopefully they will improve gamesalad for that kind of functionality soon.