playMaker

Author Topic: Increase movement speed over time to max speed[SOLVED]  (Read 534 times)

ItzArranT

  • Playmaker Newbie
  • *
  • Posts: 45
    • View Profile
Increase movement speed over time to max speed[SOLVED]
« on: May 24, 2017, 05:55:22 AM »
Hi all!

Newbie Playmaker user here.  I've recently started making a 2D platformer and have run into my first question.

To make my character move, I use 'Get Axis' and 'Set Velocity'.  However, I'd like the character to increase in movement speed over time to a max speed.

Can anyone help with advising me on how to do this??

Many thanks
« Last Edit: January 17, 2019, 01:40:24 AM by jeanfabre »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 14342
  • Official Playmaker Support
    • View Profile
Re: Increase movement speed over time to max speed
« Reply #1 on: January 14, 2019, 12:30:52 AM »
Hi,

Just stumbled upon your post, sorry for the necro :)

You need to create a Speed variable that you add value too at a constant rate while the user is moving, and reset it back when the user stops moving.

if you have problem with this, I'll do a quick sample.

 Bye,

 Jean

ch1ky3n

  • Junior Playmaker
  • **
  • Posts: 71
    • View Profile
Re: Increase movement speed over time to max speed
« Reply #2 on: January 14, 2019, 11:36:53 AM »
I made an example, hope it helps


jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 14342
  • Official Playmaker Support
    • View Profile
Re: Increase movement speed over time to max speed
« Reply #3 on: January 15, 2019, 05:39:07 AM »
Hi,

 Thanks for your contribution. I do think however that it may be too complex as a starter.

 I attached a variant, which decrease the complexity of dealing with such mechanism



the key to properly cut down each step of the speed computation, with dedicated variables.

Bye,

 Jean

ch1ky3n

  • Junior Playmaker
  • **
  • Posts: 71
    • View Profile
Re: Increase movement speed over time to max speed
« Reply #4 on: January 15, 2019, 11:21:59 AM »
Hey that was nice, i think yours is more efficient

thx for sharing