Stencyl 3.4.0 is now out. Get it now!

Bouncing Behaviors

Ethan

  • Posts: 177
I need a couple of behaviors for a game that I'm planning on making that is very similar to this game:
http://www.notdoppler.com/dropple.php

I already have a timer behavior and there's an awesome coin collection pack.

There are only two behaviors that I can think of that I need to make a game like this:

1. The bouncing behavior (the main gameplay engine) that the ball uses. See the game for what it should be like.
2. In the game when you land on a green block with an up arrow, you go flying upwards. This is the other behavior I need.

It seems like this could be simple to do, so if anyone could do it, that would be so awesome.

Irock

  • *
  • Posts: 2838
You can set the bounciness of an actor in Physics > Material

Alexin

  • *
  • Posts: 3132
Use Ice (no friction) as material.
"Find the fun"
alexin@stencyl.com

Ethan

  • Posts: 177
How do I get it so it's always bouncing at the same height no matter what? The game I used as an example has a constant height I think

Alexin

  • *
  • Posts: 3132
I think it should always bounce at the same height, as long as it doesn't lose energy - no friction and dampening.
"Find the fun"
alexin@stencyl.com

Ethan

  • Posts: 177
Right well I wasn't clear enough. The Dropple ball starts from a height of like 2 tiles, and even if you fall like 10 tiles, it will still only bounce back up to 2 tiles.

When I set the bounciness to 1 in Stencyl, if a ball drops from a height of ten tiles it will go back to 10.

I understand that Stencyl's example is more physically accurate but the first example is what I want in my game.

Hectate

  • *
  • Posts: 4643
You'd have to manually change your collision code with a behavior. Essentially, when it detects a collision on the bottom of the bouncer, set apply upward force in an amount appropriate for the "2 tiles" that you want. It'll probably take some tweaking. I'd recommend creating a variable that you can use a couple of buttons in-game to adjust (and print the current value) to see just what value returns the amount of bounciness you want.
:
:
Patience is a Virtue,
But Haste is my Life.
Proud member of the League of Idiotic Stencylers; doing things in Stencyl that probably shouldn't be done.

Ethan

  • Posts: 177
Could someone (anyone) please help me get started on this project?

I have graphics made and all the design parts planned out... All I need is a functional bouncing behavior like the one in the Dropple game. Thanks for the help guys but I'm very bad at coding and I need someone to work with...

NobodyX

  • *
  • Posts: 1196
when this collides with something else
-if  [the bottom was hit]
--set x-speed to [whatever you want (negative is up)]

This would work, right?
“If you wind up with a boring, miserable life because you listened to your mom, your dad, your teacher, your priest, or some guy on TV telling you how to do your shit, then YOU DESERVE IT.”
― Frank Zappa

Ethan

  • Posts: 177
Where would I put this code? on the player or an actor that is a block that the player hits?

NobodyX

  • *
  • Posts: 1196
The player actor.
“If you wind up with a boring, miserable life because you listened to your mom, your dad, your teacher, your priest, or some guy on TV telling you how to do your shit, then YOU DESERVE IT.”
― Frank Zappa