playMaker

Author Topic: bounce and power up  (Read 1529 times)

Ronnie gaikwad

  • Playmaker Newbie
  • *
  • Posts: 22
bounce and power up
« on: May 01, 2020, 03:41:13 PM »
Hi I'm trying to make a game in which the player will jump from one platform to another. I want that if the player collects a star at the platform i want it to jump 2x of the previous jump so if the player collects the star continuously at each platform his jump as well as the forward distance to be increased by 2x of previous one.how can i do that? also I want yo add animations when the player is moving to the highest point of jumping and other one when it started getting down.. how can I do this?

ch1ky3n

  • Full Member
  • ***
  • Posts: 208
Re: bounce and power up
« Reply #1 on: May 01, 2020, 11:16:55 PM »
To make the jump,

add a variable modifier in your velocity formula where its default value is 1
jumpSpeed* modifierY = VelocityY
so from now on, if you change the modifierY to 2, the jump will increase 2x
Whenever you eat the star, times modifierY by 2

To do the animation,
depending on how you setup your animator, but the idea is to add conditions/flags to check your velocityY
if it is a positive velocity, then the animation is ascending
if it is a negative velocity, then the animation is descending

Cheers

Ronnie gaikwad

  • Playmaker Newbie
  • *
  • Posts: 22
Re: bounce and power up
« Reply #2 on: May 02, 2020, 04:49:35 AM »
how will it go to a distance forward when it jumps? when the jump is 2x i want the distance to be 2x

ch1ky3n

  • Full Member
  • ***
  • Posts: 208
Re: bounce and power up
« Reply #3 on: May 02, 2020, 09:22:15 AM »
you need to separate the horizontal and vertical movement

for the jump would be velocityY
and for the movement would be velocityX

i'm not sure on how you manipulate the distance of X , is it axis based? or is it time based ? or other method

Ronnie gaikwad

  • Playmaker Newbie
  • *
  • Posts: 22
Re: bounce and power up
« Reply #4 on: May 02, 2020, 09:44:18 AM »
i want the forward distance to be constant so probably axis based

ch1ky3n

  • Full Member
  • ***
  • Posts: 208
Re: bounce and power up
« Reply #5 on: May 02, 2020, 11:06:07 AM »
then it is
Your axis float value * your speedx * your modifier
in normal case when user push the axis to the far right, the value will be 1
then your speed say 10
and your modifier 2

1*10*2 = 20 velocity to the right which is doubling the original value as well