Enable Physics

Enabling physics is needed for multiple things: collision checking, gravity, bouncing, weight, velocity and more. To start, simply select one of your game objects or a group and refer to the Physics panel in the bottom-right corner.

Physics is disabled by default and once you enable it by changing enable to 1, other options will appear. The same goes with immovable which must be changed to 0 (false) before the object can be moved and affected by gravity.

Enabling physics to a group will affect every child of the said group at once.

A short description of physics properties:

  • enable – enable/disable physics;
  • immovable – set to false if the object is not static;
  • size – dimensions of the physics body, against which collision, overlap etc. is checked. Can be bigger or smaller that the actual sprite;
  • bounce – whether the object bounces on collision and if it does, how big is the force of the bounce;
  • gravity – whether gravity is enabled and the force of gravity;
  • rotation – whether it’s allowed and the maximum allowed rotation
  • maxVelocity – the maximum velocity this physics body can achieve by, eg., falling;
  • mass – the mass of the body;
  • collideWorldBounds – whether the object can or cannot step out of the world bounds. If set to true, character will collide with the boundaries.

 

Leave a Reply

Your email address will not be published. Required fields are marked *