1 Move
JGary321
Member Posts: 1,246
I am creating a Tower Defense type game & I have it so when I click an Actor (button) it spawns another actor (the actual tower). The problem I'm having is limiting the tower so that when it is placed it is set for good. I've tried numerous things, but can't seem to make it stay for good.
I initially followed the tutorial for moving an actor with mouse, but no matter what I do it wont stay. I even set up an attribute that changes to "1" when mouse comes up & then linked that to making the actor immoveable. I am assuming the constrain actor to mouse is overriding the immoveable part. Anyone got any suggestions? Thanks for the help.
I initially followed the tutorial for moving an actor with mouse, but no matter what I do it wont stay. I even set up an attribute that changes to "1" when mouse comes up & then linked that to making the actor immoveable. I am assuming the constrain actor to mouse is overriding the immoveable part. Anyone got any suggestions? Thanks for the help.
Comments
So you create one actor that when you have mouse down and mouse position is over, you set a game attribute saying you are about to select. Then when mouse position is over actor, mouse up, and game attribute 'selecting' is true, you set a game attribute that says you hold a transparent piece, 'selecting' is false, and it spawns an instance of that transparent piece.
The transparent piece has rules that say if you are 'selecting' then destroy this piece. A rule that says when mouse is down, spawn immovable actor and destroy this actor. Also make sure the transparent piece is not collidable.
I haven't tested it, but I think that should work and I hope to make a tutorial on that once I get some decent art for it.