playMaker

Author Topic: Help! Movement to the right 2D GAME  (Read 120 times)

MatiasHarder

  • Playmaker Newbie
  • *
  • Posts: 47
    • View Profile
Help! Movement to the right 2D GAME
« on: August 24, 2017, 08:21:26 AM »
In a 2D game how can i make the character move to the right a frame every time i press N?

example:
I press the N key and my character will move to the right a box (As in games 2d) and if I press 3 times this will move 3 times to the right.

Besides this how can I change the speed of movement?

If you can guide me with this I would be very grateful.
« Last Edit: August 25, 2017, 05:40:59 AM by MatiasHarder »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 12342
  • Official Playmaker Support
    • View Profile
Re: Help! Movement to the right 2D GAME
« Reply #1 on: August 25, 2017, 02:09:43 AM »
Hi,

 you mean you have a grid, and your player can only move one unit at a time right?

 so you press n, player moves one unit, press n again, one more unit.

 am I correct?

Bye,

 Jean

MatiasHarder

  • Playmaker Newbie
  • *
  • Posts: 47
    • View Profile
Re: Help! Movement to the right 2D GAME
« Reply #2 on: August 25, 2017, 05:42:01 AM »
yes, If to that same I mean .. I would like to know how to do that for a game type rpg 2d..
You know how to do it?

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 2247
    • View Profile
    • jinxtergames
Re: Help! Movement to the right 2D GAME
« Reply #3 on: August 25, 2017, 10:38:58 AM »
Hi,

you can do something like :

when n is pressed : "Get Postion"
then add 1 or deduct 1 (depending if you go left or right) to the X postition
then use set position (you can use a tweet or ease float/vector2/vector3 to move smoothly) the amount to add/deduct depends on your setup