Not touching the actor spawned again?

TouchTiltGamesTouchTiltGames Member Posts: 1,162
edited November -1 in Working with GS (Mac)
I have an actor that is spawned and constrained to your touch when you press down on it, when you release it, it drops down slowly. But my issue is that I don't want to allow the player to interact again with the same actor that you just released, only from the spawn point.

I'm kinda boggled on how to prevent the player from touching the same actor they released but letting them touch the spawn point actor again.

So on my 'is pressed' I have Spawn actor, self.dragging is false, my constrains and self.dragging to true.

Would it be better to create a container in this situation?

Comments

  • jmp909jmp909 Member Posts: 73
    actor "whatever":

    change attribute "alive" = true

    if touch pressed and "alive" is true
    "alive" = false
    do whatever
  • TouchTiltGamesTouchTiltGames Member Posts: 1,162
    Thanks, jmp...the thing I'm trying to grasp is how does one define "alive" other than the boolean or interger off/on...ie. how does one turn off the physics or calls when it's "off"? Another same actor with no rules on it?

    cheers.
  • chosenonestudioschosenonestudios Member Posts: 1,714
    If i grasp what your saying, you could do when actor.touch is released.boolean.switch off

    Good Luck!
  • jmp909jmp909 Member Posts: 73
    i think you want to turn off the bounce with other objects rather than the actual physics?

    eg.. only make it collidable when alive is true:
    if alive is true:
    => bounce when collides with actor of type "collidable"
    => and other rules relating to being alive

    otherwise

    => increase velocity etc to move off screen
    => other rules relating to being dead

    if you need other states use an integer eg 1 for ALIVE, 2 for DYING, 3 for DEAD etc and then use that to set its state...

    if touch is pressed and actor.gamestate = 1 then actor.gamestate=2 etc
    if actor.gamestate = 2 then....

    not sure precisely what you want to do
  • TouchTiltGamesTouchTiltGames Member Posts: 1,162
    Got it! Thanks for your help guys. :)
Sign In or Register to comment.