Help with Actor's movement

Gamer2125Gamer2125 Member, PRO Posts: 8
edited April 2014 in Working with GS (Mac)

Hi I am trying to create an actor who is continuously moving with constant velocity in particular direction. But when you tap on the screen it starts moving in the direction of tap with same velocity.

For eg. when game starts actor will move at 90 degree with velocity of 150 and the moment I tap screen on right side, it changes its direction and starts moving in that particular direction with same velocity of 150.

I would really appreciate if anyone could help me creating this rule.

Comments

  • umeiumei Member, PRO Posts: 21

    Do you want to make the actor move to the right when you tap the right side of the screen? Or will the actor move towards the touch at an angle?

  • Gamer2125Gamer2125 Member, PRO Posts: 8

    Sorry for late response. Yes, I want actor to move towards the touch at an angle. I would really appreciate if you could explain me how to create that functionality.

  • SmokeyAce73SmokeyAce73 EarthMember Posts: 370
    edited April 2014

    Create interger attribute: MoveDirection

    Lets say:

    • 1 = left
    • 2 = right

    Create 2 actors: Left and Right

    Make the actors cover the corresponding side of the screen and add rules if touch is pressed change attribute game.movedirection to 1 or 2 depending on what actors your changing

    Then go into the player actor and

    • if attribute game.movedirection = 1 move left
    • if attribute game.movedirection = 2 move right

    Developer For BLUNTentertainment - Feel Free To Message Me! - Free Beginner Templates!

Sign In or Register to comment.