Lock Actor into place

bryantmainobryantmaino Member Posts: 30
edited November -1 in Working with GS (Mac)
I am using Puzzle (Demo) Template for my next game. I want the actor "puzzle piece one" to lock into place becoming unmovable when matched with actor "match piece one" and so on with rest of actor numbers. Can anyone give me some direction?

Comments

  • JohnPapiomitisJohnPapiomitis Member Posts: 6,256
    Hey There,

    It would go something like this. Have self attributes in each pieces that have the correct x and y positions. So correctx set to the right x, and correcty set to the right y

    then have a rule:

    when mouse button is up And self.position.x= correctx AND self.position.y= correcty
    -constrain self position x to correctx
    -constrain self position y to correcty

    cheers
Sign In or Register to comment.