Class: ImpactBody

Phaser.Physics.Impact. ImpactBody

[description]


new ImpactBody(world, x, y, width, height)

Parameters:
Name Type Description
world Phaser.Physics.Impact.World

[description]

x number

x - The horizontal position of this physics body in the world.

y number

y - The vertical position of this physics body in the world.

width number

The width of the physics body in the world.

height number

[description]

Since: 3.0.0
Source: src/physics/impact/ImpactBody.js (Line 10)

Extends

Members


accel :Object

[description]

Type:
  • Object
Since: 3.0.0
Source: src/physics/impact/ImpactBody.js (Line 97)

body :Phaser.Physics.Impact.Body

[description]

Type:
Since: 3.0.0
Source: src/physics/impact/ImpactBody.js (Line 59)

bounce :number

The bounce, or restitution, value of this body. A value between 0 (no rebound) and 1 (full rebound)

Type:
  • number
Since: 3.0.0
Inherited From:
Source: src/physics/impact/components/Bounce.js (Line 50)

checkAgainst :number

[description]

Type:
  • number
Since: 3.0.0
Inherited From:
Source: src/physics/impact/components/CheckAgainst.js (Line 93)

collides :number

[description]

Type:
  • number
Since: 3.0.0
Inherited From:
Source: src/physics/impact/components/Collides.js (Line 127)

debugBodyColor :number

[description]

Type:
  • number
Since: 3.0.0
Inherited From:
Source: src/physics/impact/components/Debug.js (Line 96)

debugShowBody :boolean

[description]

Type:
  • boolean
Since: 3.0.0
Inherited From:
Source: src/physics/impact/components/Debug.js (Line 54)

debugShowVelocity :boolean

[description]

Type:
  • boolean
Since: 3.0.0
Inherited From:
Source: src/physics/impact/components/Debug.js (Line 75)

friction :Object

[description]

Type:
  • Object
Since: 3.0.0
Source: src/physics/impact/ImpactBody.js (Line 106)

gravity :number

[description]

Type:
  • number
Since: 3.0.0
Inherited From:
Source: src/physics/impact/components/Gravity.js (Line 33)

maxVel :Object

[description]

Type:
  • Object
Since: 3.0.0
Source: src/physics/impact/ImpactBody.js (Line 115)

offset :Object

[description]

Type:
  • Object
Since: 3.0.0
Source: src/physics/impact/ImpactBody.js (Line 79)

size :Object

[description]

Type:
  • Object
Since: 3.0.0
Source: src/physics/impact/ImpactBody.js (Line 70)

vel :Object

[description]

Type:
  • Object
Since: 3.0.0
Source: src/physics/impact/ImpactBody.js (Line 88)

Methods


getBodyType()

[description]

Since: 3.0.0
Inherited From:
Source: src/physics/impact/components/BodyType.js (Line 18)
Returns:

[description]

Type
number

setAcceleration(x, y)

Sets the horizontal and vertical acceleration of this body.

Parameters:
Name Type Description
x number

The amount of horizontal acceleration to apply.

y number

The amount of vertical acceleration to apply.

Since: 3.0.0
Inherited From:
Source: src/physics/impact/components/Acceleration.js (Line 50)
Returns:

This Game Object.

Type
Phaser.Physics.Impact.ImpactBody

setAccelerationX(x)

Sets the horizontal acceleration of this body.

Parameters:
Name Type Description
x number

The amount of acceleration to apply.

Since: 3.0.0
Inherited From:
Source: src/physics/impact/components/Acceleration.js (Line 16)
Returns:

This Game Object.

Type
Phaser.Physics.Impact.ImpactBody

setAccelerationY(y)

Sets the vertical acceleration of this body.

Parameters:
Name Type Description
y number

The amount of acceleration to apply.

Since: 3.0.0
Inherited From:
Source: src/physics/impact/components/Acceleration.js (Line 33)
Returns:

This Game Object.

Type
Phaser.Physics.Impact.ImpactBody

setActiveCollision()

[description]

Since: 3.6.0
Inherited From:
Source: src/physics/impact/components/Collides.js (Line 97)
Returns:

This Game Object.

Type
Phaser.GameObjects.GameObject

setAvsB()

[description]

Since: 3.0.0
Inherited From:
Source: src/physics/impact/components/CheckAgainst.js (Line 18)
Returns:

This Game Object.

Type
Phaser.GameObjects.GameObject

setBodyScale(scaleX [, scaleY])

Sets the scale of the physics body.

Parameters:
Name Type Argument Description
scaleX number

The horizontal scale of the body.

scaleY number <optional>

The vertical scale of the body. If not given, will use the horizontal scale value.

Since: 3.0.0
Inherited From:
Source: src/physics/impact/components/BodyScale.js (Line 37)
Returns:

This Game Object.

Type
Phaser.Physics.Impact.ImpactBody

setBodySize(width [, height])

Sets the size of the physics body.

Parameters:
Name Type Argument Default Description
width number

The width of the body in pixels.

height number <optional>
width

The height of the body in pixels.

Since: 3.0.0
Inherited From:
Source: src/physics/impact/components/BodyScale.js (Line 16)
Returns:

This Game Object.

Type
Phaser.Physics.Impact.ImpactBody

setBounce(value)

Sets the impact physics bounce, or restitution, value.

Parameters:
Name Type Description
value number

A value between 0 (no rebound) and 1 (full rebound)

Since: 3.0.0
Inherited From:
Source: src/physics/impact/components/Bounce.js (Line 16)
Returns:

This Game Object.

Type
Phaser.GameObjects.GameObject

setBvsA()

[description]

Since: 3.0.0
Inherited From:
Source: src/physics/impact/components/CheckAgainst.js (Line 33)
Returns:

This Game Object.

Type
Phaser.GameObjects.GameObject

setCheckAgainstA()

[description]

Since: 3.0.0
Inherited From:
Source: src/physics/impact/components/CheckAgainst.js (Line 63)
Returns:

This Game Object.

Type
Phaser.GameObjects.GameObject

setCheckAgainstB()

[description]

Since: 3.0.0
Inherited From:
Source: src/physics/impact/components/CheckAgainst.js (Line 78)
Returns:

This Game Object.

Type
Phaser.GameObjects.GameObject

setCheckAgainstNone()

[description]

Since: 3.0.0
Inherited From:
Source: src/physics/impact/components/CheckAgainst.js (Line 48)
Returns:

This Game Object.

Type
Phaser.GameObjects.GameObject

setCollideCallback(callback, scope)

[description]

Parameters:
Name Type Description
callback CollideCallback

[description]

scope *

[description]

Since: 3.0.0
Inherited From:
Source: src/physics/impact/components/Collides.js (Line 29)
Returns:

This Game Object.

Type
Phaser.GameObjects.GameObject

setCollidesNever()

[description]

Since: 3.0.0
Inherited From:
Source: src/physics/impact/components/Collides.js (Line 52)
Returns:

This Game Object.

Type
Phaser.GameObjects.GameObject

setDebug(showBody, showVelocity, bodyColor)

[description]

Parameters:
Name Type Description
showBody boolean

[description]

showVelocity boolean

[description]

bodyColor number

[description]

Since: 3.0.0
Inherited From:
Source: src/physics/impact/components/Debug.js (Line 16)
Returns:

This Game Object.

Type
Phaser.GameObjects.GameObject

setDebugBodyColor(value)

[description]

Parameters:
Name Type Description
value number

[description]

Since: 3.0.0
Inherited From:
Source: src/physics/impact/components/Debug.js (Line 37)
Returns:

This Game Object.

Type
Phaser.GameObjects.GameObject

setFixedCollision()

[description]

Since: 3.6.0
Inherited From:
Source: src/physics/impact/components/Collides.js (Line 112)
Returns:

This Game Object.

Type
Phaser.GameObjects.GameObject

setFriction(x, y)

[description]

Parameters:
Name Type Description
x number

[description]

y number

[description]

Since: 3.0.0
Inherited From:
Source: src/physics/impact/components/Friction.js (Line 50)
Returns:

This Game Object.

Type
Phaser.GameObjects.GameObject

setFrictionX(x)

[description]

Parameters:
Name Type Description
x number

[description]

Since: 3.0.0
Inherited From:
Source: src/physics/impact/components/Friction.js (Line 16)
Returns:

This Game Object.

Type
Phaser.GameObjects.GameObject

setFrictionY(y)

[description]

Parameters:
Name Type Description
y number

[description]

Since: 3.0.0
Inherited From:
Source: src/physics/impact/components/Friction.js (Line 33)
Returns:

This Game Object.

Type
Phaser.GameObjects.GameObject

setGameObject(gameObject [, sync])

[description]

Parameters:
Name Type Argument Default Description
gameObject Phaser.GameObjects.GameObject

[description]

sync boolean <optional>
true

[description]

Since: 3.0.0
Inherited From:
Source: src/physics/impact/components/SetGameObject.js (Line 16)
Returns:

This Game Object.

Type
Phaser.GameObjects.GameObject

setGravity(value)

[description]

Parameters:
Name Type Description
value number

[description]

Since: 3.0.0
Inherited From:
Source: src/physics/impact/components/Gravity.js (Line 16)
Returns:

This Game Object.

Type
Phaser.GameObjects.GameObject

setLiteCollision()

[description]

Since: 3.6.0
Inherited From:
Source: src/physics/impact/components/Collides.js (Line 67)
Returns:

This Game Object.

Type
Phaser.GameObjects.GameObject

setMaxVelocity(x [, y])

Sets the maximum velocity this body can travel at.

Parameters:
Name Type Argument Default Description
x number

The maximum allowed horizontal velocity.

y number <optional>
x

The maximum allowed vertical velocity. If not given, defaults to the horizontal value.

Since: 3.0.0
Inherited From:
Source: src/physics/impact/components/Velocity.js (Line 71)
Returns:

This Game Object.

Type
Phaser.Physics.Impact.ImpactBody

setMinBounceVelocity(value)

Sets the minimum velocity the body is allowed to be moving to be considered for rebound.

Parameters:
Name Type Description
value number

The minimum allowed velocity.

Since: 3.0.0
Inherited From:
Source: src/physics/impact/components/Bounce.js (Line 33)
Returns:

This Game Object.

Type
Phaser.GameObjects.GameObject

setOffset(x, y [, width] [, height])

[description]

Parameters:
Name Type Argument Description
x number

[description]

y number

[description]

width number <optional>

[description]

height number <optional>

[description]

Since: 3.0.0
Inherited From:
Source: src/physics/impact/components/Offset.js (Line 16)
Returns:

This Game Object.

Type
Phaser.GameObjects.GameObject

setPassiveCollision()

[description]

Since: 3.6.0
Inherited From:
Source: src/physics/impact/components/Collides.js (Line 82)
Returns:

This Game Object.

Type
Phaser.GameObjects.GameObject

setTypeA()

[description]

Since: 3.0.0
Inherited From:
Source: src/physics/impact/components/BodyType.js (Line 46)
Returns:

This Game Object.

Type
Phaser.GameObjects.GameObject

setTypeB()

[description]

Since: 3.0.0
Inherited From:
Source: src/physics/impact/components/BodyType.js (Line 61)
Returns:

This Game Object.

Type
Phaser.GameObjects.GameObject

setTypeNone()

[description]

Since: 3.0.0
Inherited From:
Source: src/physics/impact/components/BodyType.js (Line 31)
Returns:

This Game Object.

Type
Phaser.GameObjects.GameObject

setVelocity(x [, y])

Sets the horizontal and vertical velocities of the physics body.

Parameters:
Name Type Argument Default Description
x number

The horizontal velocity value.

y number <optional>
x

The vertical velocity value. If not given, defaults to the horizontal value.

Since: 3.0.0
Inherited From:
Source: src/physics/impact/components/Velocity.js (Line 50)
Returns:

This Game Object.

Type
Phaser.Physics.Impact.ImpactBody

setVelocityX(x)

Sets the horizontal velocity of the physics body.

Parameters:
Name Type Description
x number

The horizontal velocity value.

Since: 3.0.0
Inherited From:
Source: src/physics/impact/components/Velocity.js (Line 16)
Returns:

This Game Object.

Type
Phaser.Physics.Impact.ImpactBody

setVelocityY(y)

Sets the vertical velocity of the physics body.

Parameters:
Name Type Description
y number

The vertical velocity value.

Since: 3.0.0
Inherited From:
Source: src/physics/impact/components/Velocity.js (Line 33)
Returns:

This Game Object.

Type
Phaser.Physics.Impact.ImpactBody

syncGameObject()

[description]

Since: 3.0.0
Inherited From:
Source: src/physics/impact/components/SetGameObject.js (Line 48)
Returns:

This Game Object.

Type
Phaser.GameObjects.GameObject