collide=disappear_,',',',',',',',',',_non-collide=reapp

PowerKalistoPowerKalisto Member Posts: 34
edited November -1 in Working with GS (Mac)
I got this little button that my actor is supposed to collide with it to make disappear 2 blocks (who bars him the road) ... but i wanna make it hard ... when the actor will not colliding the button ... i want make the 2 blocks reappears !....

i know how to do the first part : make them disappear ... but the other part i don't know how !!

Comments

  • osalzanoosalzano Member, PRO Posts: 136
    I think a simple way to do it is using an Attribute.

    When the actor collide with the button, change attribute to 0
    Otherwise (no collision), attribute=1

    When attribute=0, destroy blocks.
    When attribute=0, spawn blocks.

    It probably will help you ;-)

    --------------------------------------------------------------------------
     Stunt Alien  is live in the App Store!
    http://gamesalad.com/forums/topic.php?id=6543
    http://itunes.apple.com/app/stunt-alien/id370973685?mt=8
  • PowerKalistoPowerKalisto Member Posts: 34
    I did the same thing but it appears the block at an other place ! I don't know how to make it appear at the same place !!
    I took the position of my block by double-click and i put the position in the spawn actor (relative to the scene ) but it doesn't work too it appears the block in another place ... and the worst is, in the other scenes there is the block "nowhere" visible !! ... :O
  • osalzanoosalzano Member, PRO Posts: 136
    This case, you have to create 2 more attributes, something like "Block_position_X" and "Block_position_Y".

    Before destroying the block, you put 2 "change attribute" behaviors, to store its position:

    Change Attribute: Game.Block_position_X = self.Position.X
    Change Attribute: Game.Block_position_Y = self.Position.Y

    When you spawn the "new" block, just set the position with the attribute values you've stored.

    Cheers!

    --------------------------------------------------------------------------
     Stunt Alien  is live in the App Store!
    http://gamesalad.com/forums/topic.php?id=6543
    http://itunes.apple.com/app/stunt-alien/id370973685?mt=8
  • PowerKalistoPowerKalisto Member Posts: 34
    it work great but i still have a little error, you see in this image there is 2 block, one above and one in bottom of the actor (I didn't put this one in the scene ) :
    http://img43.imageshack.us/img43/1011/image2pn.png
    this is what happend when the actor is colliding the button (they all disapear !) :
    http://img532.imageshack.us/img532/8320/image3le.png
    and the thirth image show you only one block ... :
    http://img10.imageshack.us/img10/8973/image4us.png

    how can i remove the block in bottom ?
  • PowerKalistoPowerKalisto Member Posts: 34
    OHHH I see hahaha !!! I put 2 constaint atribute on the block and i removed the 2 "change" atribut in the rule ! and it worked !
Sign In or Register to comment.