How to get actors to spawn when touch is realeased from another actor?

schwarzAschwarzA Member Posts: 4
edited July 2012 in Working with GS (Mac)
Hey everyone,

I need some help figuring this one problem I'm currently having with my game.

I'm trying to apply a feature that will allow players to rotate a block within the game.

When the actor is "touched" the actors will stay hidden, but when released arrows will show up relative to the actor's position(on the left and right side of the actor).
I will add screenshots to show what I'm specifically talking about.


When I bring the block into the scene, it will be considered touched and the arrows are not spawned.
(see Screenshot)

http://i1182.photobucket.com/albums/x451/gbdisputepics2/IMG_1013.jpg

Then once the actor is released, these arrows spawn to the left and right of the actor.
(See Screenshot)

http://i1182.photobucket.com/albums/x451/gbdisputepics2/IMG_2813.jpg

I cant seem to figure out how to get this to work.

Any help would be greatly appreciated!

Thanks =)

Best Answer

  • schwarzAschwarzA Posts: 4
    Accepted Answer
    OMG... im a little slow... i did not mean do that *facepalm*

    Yes carlblachet that did work :-j

    Thanks so much =)

Answers

  • carlblanchetcarlblanchet Member Posts: 755
    Make a boolean attribute (lets call it touchReleased), then in the actor that you press make a rule: when touch is pressed: change attribute touchReleased to FALSE. Then make second rule: when touch is released: change attribute touchReleased to TRUE.

    Now go in your arrow actor, make 2 rules, one that is: when attribute touchReleased is TRUE: interpolate self.color.alpha to 1. and the other: when attribute touchReleased is FALSE: interpolate self.color.alpha to 0. You can also add a timer in the when attribute is TRUE rule that says AFTER i.e. 2 seconds: interpolate self.color.alpha to 0

    Hope this helps!
  • schwarzAschwarzA Member Posts: 4
    Thanks for responding carlblachet, but that did not work =(.

    Thanks again.
Sign In or Register to comment.