API Docs for: 1.13.1
Show:

game.World Class

Extends game.Class
Defined in: engine/physics.js:11
Module: physics

Physics world.

Constructor

game.World

(
  • x
  • y
)

Parameters:

  • x Number

    Gravity x

  • y Number

    Gravity y

Methods

addBody

(
  • body
)

Add body to world.

Parameters:

addBodyCollision

(
  • body
)

Add body to collision group.

Parameters:

collide

(
  • body
)

Collide body against it's collideAgainst groups.

Parameters:

extend

(
  • prop
)
game.Class

Inherited from game.Class: engine/core.js:757

Extend class.

Parameters:

  • prop Object

Returns:

init

(
  • arguments
)

Inherited from game.Class: engine/core.js:811

This method is called, when you create new instance of the class.

Parameters:

  • arguments Array

inject

(
  • prop
)

Inherited from game.Class: engine/core.js:825

Inject class.

Parameters:

  • prop Object

removeBody

(
  • body
)

Remove body from world.

Parameters:

removeBodyCollision

(
  • body
)

Remove body from collision group.

Parameters:

staticInit

(
  • arguments
)

Inherited from game.Class: engine/core.js:795

This method is called before init.

Parameters:

  • arguments Array

update

()

Update physics world.

Properties

bodies

Array

List of bodies in world.

collisionGroups

Object

List of collision groups.

gravity

game.Vector

Gravity of physics world.

Default: 0,980