Skip to content

Bounce (using forces)

Bounce the object off another object it just touched.

Authors and contributors to this experimental extension: 4ian.


Provides an action to make the object bounce from another object it just touched.

⚠️ This won't work with Physics engine or Platformer characters. This is working with objects that are moved using actions or behaviors using the forces.

The Breakout-like example uses this extension to make balls bounce (open the project online).

Read more...

Tip

Learn how to install new extensions by following a step-by-step guide.

Bounce

Provides an action to make the object bounce from another object it just touched. Add a permanent force to the object and, when in collision with another one, use the action to make it bounce realistically.

Behavior actions

Bounce off another object
Bounce the object off another object it is currently colliding with, according to the angle and the speed of forces applied on the object.
Make sure to test for a collision between the two objects before launching this action. All the forces will be removed from the object, and a new permanent force will be added to make the object bounce.

See parameters
  • Parameter 0: 👾 Object
  • Parameter 1: 🧩 Behavior
  • Parameter 2 (👾 Object): The objects to bounce on

Technical note: parameter 3 are internal parameters handled by GDevelop.

Bounce horizontally
Bounce the object off another object it is currently colliding with, according to the angle and the speed of forces applied on the object.
The bounce will always be horizontal, like if the object is colliding a perfectly vertical obstacle (like paddles in a pong game). For example, if the object is arriving with an angle of exactly 0 degrees, it will bounce in the opposite direction: 180 degrees.

Make sure to test for a collision between the two objects before launching this action. All the forces will be removed from the object, and a new permanent force will be added to make the object bounce.

See parameters
  • Parameter 0: 👾 Object
  • Parameter 1: 🧩 Behavior
  • Parameter 2 (👾 Object): The objects to bounce on

Technical note: parameter 3 are internal parameters handled by GDevelop.

Bounce off another object toward a specified angle
Bounce the object off another object it is currently colliding with, according to the angle and the speed of forces applied on the object.
The bounce will always be calculated to go toward the specified angle (the "normal angle"). For example, if the object is arriving at this exact angle, it will bounce in the opposite direction.

Make sure to test for a collision between the two objects before launching this action. All the forces will be removed from the object, and a new permanent force will be added to make the object bounce.

See parameters
  • Parameter 0: 👾 Object
  • Parameter 1: 🧩 Behavior
  • Parameter 2 (👾 Object): The objects to bounce on
  • Parameter 3 (🔢 Number): The "normal" angle, in degrees, to bounce against This can be understood at the direction that the bounce must go toward.

Technical note: parameter 4 are internal parameters handled by GDevelop.

Bounce vertically
Bounce the object off another object it is currently colliding with, according to the angle and the speed of forces applied on the object.
The bounce will always be vertical, like if the object is colliding a perfectly horizontal obstacle (like the top/bottom of the screen in a pong game). For example, if the object is arriving with an angle of exactly 90 degrees, it will bounce in the opposite direction: -90 degrees.

Make sure to test for a collision between the two objects before launching this action. All the forces will be removed from the object, and a new permanent force will be added to make the object bounce.

See parameters
  • Parameter 0: 👾 Object
  • Parameter 1: 🧩 Behavior
  • Parameter 2 (👾 Object): The objects to bounce on

Technical note: parameter 3 are internal parameters handled by GDevelop.

Behavior conditions

Bounce count
Compare the number of times this object has bounced off another object.

See parameters
  • Parameter 0: 👾 Object
  • Parameter 1: 🧩 Behavior
  • Parameter 2: 🟰 Relational operator
  • Parameter 3 (🔢 Number): Value to compare

Technical note: parameter 4 are internal parameters handled by GDevelop.

Behavior expressions

Expression Description
Object.Bounce::BounceCount() Return the number of times this object has bounced off another object.

This page is an auto-generated reference page about the Bounce (using forces) extension, made by the community of GDevelop, the open-source, cross-platform game engine designed for everyone. Learn more about all GDevelop community-made extensions here.