I want to put to my actor to limit of movement on the screen

santigrabisantigrabi Member Posts: 22
edited January 2016 in Working with GS (PC)

I want to put to my actor to limit of movement on the screen

Comments

  • The_Gamesalad_GuruThe_Gamesalad_Guru Member Posts: 9,922

    What kind of limit?

  • eldevelop18eldevelop18 Member Posts: 4
    edited January 2016

    My actor could move in a space of the screen that I determine

  • The_Gamesalad_GuruThe_Gamesalad_Guru Member Posts: 9,922
    edited January 2016

    This is still not enough info. There are tons of ways to do this with different results. How will your actor move? What controls it?

    Basically you can restrict movement with walls if the actor is not linked to the mouse or touch using collide.

    If your actor is controlled by mouse or touch you can cut off those constrains with rules based on scene position.

    Rule
    All
    When touch is pressed
    When self.position X > 0+(self.size.width/2)
    When self.position X < 1024-(self.size.width/2) (iPad horizontally) make this number your scene size

    Move code

    PS: why are you using two names?

Sign In or Register to comment.