Difference between revisions of "CBlob"
From King Arthur's Gold Wiki
Shadlington (Talk | contribs) |
Vermilicious (Talk | contribs) m (Added a new table with some of the available hooks. The list is by no means complete, and each one should probably have their own page/template.) |
||
(2 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
<onlyinclude> | <onlyinclude> | ||
− | + | CBlob is most common networked object in game that can be interacted in some way. | |
</onlyinclude> | </onlyinclude> | ||
Line 18: | Line 18: | ||
| [[CBlob::set_(type)|set_(type)]] | | [[CBlob::set_(type)|set_(type)]] | ||
| {{:CBlob::set_(type)|set_(type)}} | | {{:CBlob::set_(type)|set_(type)}} | ||
+ | |- | ||
+ | | [[CBlob::Sync|Sync]] | ||
+ | | {{:CBlob::Sync|Sync}} | ||
|- | |- | ||
| [[CBlob::getPosition|getPosition]] | | [[CBlob::getPosition|getPosition]] | ||
Line 455: | Line 458: | ||
| dimension2di | | dimension2di | ||
| | | | ||
+ | |- | ||
+ | |} | ||
+ | |||
+ | Hooks: | ||
+ | |||
+ | {| class="wikitableShiny" border="1" | ||
+ | |- | ||
+ | ! '''Signature''' | ||
+ | ! '''Description''' | ||
+ | |- | ||
+ | | void onInit(CBlob@ this) | ||
+ | | Called on initialization. | ||
+ | |- | ||
+ | | void onTick(CBlob@ this) | ||
+ | | Called on every tick. | ||
+ | |- | ||
+ | | f32 onHit(CBlob@ this, Vec2f worldPoint, Vec2f velocity, f32 damage, CBlob@ hitterBlob, u8 customData) | ||
+ | | Called on every hit. | ||
+ | |- | ||
+ | | bool canBePickedUp(CBlob@ this, CBlob@ other) | ||
+ | | Called on pickup check. | ||
+ | |- | ||
+ | | bool doesCollideWithBlob(CBlob@ this, CBlob@ other) | ||
+ | | Called on collision check. | ||
+ | |- | ||
+ | | void onCollision(CBlob@ this, CBlob@ other, bool solid, Vec2f normal, Vec2f point) | ||
+ | | Called on collision. | ||
+ | |- | ||
+ | | void onDie(CBlob@ this) | ||
+ | | Called on death. | ||
|- | |- | ||
|} | |} |
Latest revision as of 16:10, 31 January 2016
CBlob is most common networked object in game that can be interacted in some way.
Methods:
Properties:
Property | Type | Description |
---|---|---|
shape | CShape@ | Reference to the blob's shape object. |
health | f32 | |
defaultHealth | f32 | |
inventoryIconFrame | int | |
inventoryMaxStacks | int | |
inventoryFramDimension | dimension2di | |
inventorySlots | dimension2di |
Hooks:
Signature | Description |
---|---|
void onInit(CBlob@ this) | Called on initialization. |
void onTick(CBlob@ this) | Called on every tick. |
f32 onHit(CBlob@ this, Vec2f worldPoint, Vec2f velocity, f32 damage, CBlob@ hitterBlob, u8 customData) | Called on every hit. |
bool canBePickedUp(CBlob@ this, CBlob@ other) | Called on pickup check. |
bool doesCollideWithBlob(CBlob@ this, CBlob@ other) | Called on collision check. |
void onCollision(CBlob@ this, CBlob@ other, bool solid, Vec2f normal, Vec2f point) | Called on collision. |
void onDie(CBlob@ this) | Called on death. |