playMaker

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

ItzArranT

  • Playmaker Newbie
  • *
  • Posts: 45
Increase movement speed over time to max speed[SOLVED]
« on: May 24, 2017, 08: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, 03:40:24 AM by jeanfabre »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Increase movement speed over time to max speed
« Reply #1 on: January 14, 2019, 02: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

  • Full Member
  • ***
  • Posts: 208
Re: Increase movement speed over time to max speed
« Reply #2 on: January 14, 2019, 01:36:53 PM »
I made an example, hope it helps


jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Increase movement speed over time to max speed
« Reply #3 on: January 15, 2019, 07: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

  • Full Member
  • ***
  • Posts: 208
Re: Increase movement speed over time to max speed
« Reply #4 on: January 15, 2019, 01:21:59 PM »
Hey that was nice, i think yours is more efficient

thx for sharing