Destroying Actors

8BitMichael8BitMichael Member, PRO Posts: 125
edited November -1 in Working with GS (Mac)
I'm extremely new to this program (have about 3 hours of experience) so bear with me. I started up a new project to play around on and I have a question about destroying actors. First off, can you destroy actors from separate actors?

http://img17.imageshack.us/img17/874/ss1kt.png

That's my test project so far (I just used pictures I had on my desktop for the sake of time). Basically there are three tracks and then the player, which is the blue square. When I click on the top (red) track I want the blue square player to move up to that track, which I did by spawning a new actor. But then I want the original blue square in the middle to be destroyed. Is this possible? Thanks

Comments

  • ccbx4321ccbx4321 Member Posts: 43
    Hi MDearworth,

    It may be easier for you to use the "change attribute" behavior instead of the spawn in this instance (you can do this with spawn, but I think changing the actor's position will be easier).

    For example you can:
    make a

    Change Attribute Behavior

    THEN

    In the first box select Block actor(or whatever you've named it) then "position" then X

    and in the next box (in the right side of the rule) put the value of where you want the actor's X position to change to.

    You'll need another "change attribute" behavior for the actor's Y position as well. If you couple these with a rule like:

    Actor "Red Bar" receives Touch (is pressed)

    then change attribute of "Block" position X and Y to X=-25 and Y=150

    or something like that. You'd need to test the values to put it exactly where you want it. OR if you want to move the actor to where the player has pressed you could make an actor for that as well. You could use this actor to grab the exact X and Y coordinates where the player touches and then set those coordinates to your "Block's" X and Y.

    I hope this makes sense, if not maybe someone else here can clean up my terrible explanation for you or I'll give it another go if you need more help! :D

    -Caleb
Sign In or Register to comment.