Class me.InvisibleEntity
Extends
me.Rect.
Defined in: <build/melonJS-0.9.3.js>.
| Constructor Attributes | Constructor Name and Description |
|---|---|
|
me.InvisibleEntity(x, y, settings)
|
| Method Attributes | Method Name and Description |
|---|---|
|
onCollision(res, obj)
onCollision Event function
called by the game manager when the object collide with shtg by default, if the object type is Collectable, the destroy function is called |
|
|
OnDestroy Notification function
Called by engine before deleting the object |
|
|
updateColRect(x, w, y, h)
specify the size of the hit box for collision detection
(allow to have a specific size for each object) e.g. |
Class Detail
me.InvisibleEntity(x, y, settings)
- Parameters:
- {int} x
- the x coordinates of the object
- {int} y
- the y coordinates of the object
- {me.ObjectSettings} settings
- object settings
Method Detail
onCollision(res, obj)
onCollision Event function
called by the game manager when the object collide with shtg
by default, if the object type is Collectable, the destroy function is called
called by the game manager when the object collide with shtg
by default, if the object type is Collectable, the destroy function is called
- Parameters:
- {me.Vector2d} res
- collision vector
- {me.ObjectEntity} obj
- the other object that hit this object
onDestroyEvent()
OnDestroy Notification function
Called by engine before deleting the object
Called by engine before deleting the object
updateColRect(x, w, y, h)
specify the size of the hit box for collision detection
(allow to have a specific size for each object)
e.g. : object with resized collision box :
(allow to have a specific size for each object)
e.g. : object with resized collision box :
- Parameters:
- {int} x
- x offset (specify -1 to not change the width)
- {int} w
- width of the hit box
- {int} y
- y offset (specify -1 to not change the height)
- {int} h
- height of the hit box