playMaker

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

MatiasHarder

  • Junior Playmaker
  • **
  • Posts: 51
Help! Movement to the right 2D GAME
« on: August 24, 2017, 11: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, 08:40:59 AM by MatiasHarder »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Help! Movement to the right 2D GAME
« Reply #1 on: August 25, 2017, 05: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

  • Junior Playmaker
  • **
  • Posts: 51
Re: Help! Movement to the right 2D GAME
« Reply #2 on: August 25, 2017, 08: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: 7615
    • jinxtergames
Re: Help! Movement to the right 2D GAME
« Reply #3 on: August 25, 2017, 01:38:58 PM »
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