Has Anyone figured out how to do multi-obj enemies? Or an Eye-Line for an enemy?
I can build a tank with a turret for my hero, but what about enemies?
In order to get the turret to move with the tank, I have to set some game (or scene) level attributes of X and Y.
But.. if I want to spawn enemy tanks (who each have a turret), what then?
The only way I can figure so far is to pre-create all the enemies in the scene, but not make them visible, or keep them just off stage. And each has to be set in the scene editor to look or follow the tank they ride on.
In order to get the turret to move with the tank, I have to set some game (or scene) level attributes of X and Y.
But.. if I want to spawn enemy tanks (who each have a turret), what then?
The only way I can figure so far is to pre-create all the enemies in the scene, but not make them visible, or keep them just off stage. And each has to be set in the scene editor to look or follow the tank they ride on.
Answers
My Eye-Line solution was to create a detection (multiple) actor on top of my HeroActor. Different sizes for different enemies. He carries around the sensor, not them.
They (sort of) carry around their Eye-Line.
Each enemy every .3 seconds spawns a rectangle shaped actor called EyeLine.
It's set relative to Actor with an X offset to make it only stick out the front of the Enemy.
The EyeLine actor has a timer for every .2 sec destroy this actor.
Then some collision detection about colliding with the HeroDetection object.
This means my limitlessly spawnable enemies all have an eyeline, but they are all spawing and destroying things constantly. I'm sure this will cause some LAG when there are 50 on screen.
Anyone have a better solution?
I would love a way to parent an obj to another obj.
for a very complex relationship between the turret and the tank …
involving not just X and Y but rotation and hit tracking etc. …
it would be much less stressful for you and the user's device
to have the correct turret/tank actorInstances off-screen and recycle them
http://gshelper.com/?p=416
like your Eye-Line implementation! @fishZombie =D>
@};- MH
So what if I have tanks where the turret is off center. i played a game called HM:Defense where tanks have 3 guns on them, all rotating from a point that is not the origin of the body. I was just wonder how they did that, and if anyone had a solution.