Not touching the actor spawned again?
TouchTiltGames
Member Posts: 1,162
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?
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
change attribute "alive" = true
if touch pressed and "alive" is true
"alive" = false
do whatever
cheers.
Good Luck!
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