Difference between revisions of "CBlob::isOnGround"
From King Arthur's Gold Wiki
(Created page with "<onlyinclude> </onlyinclude> <syntaxhighlight lang="cpp"> bool isOnGround() </syntaxhighlight> Object method of: CBlob Category:Scripting [[Category:Object Meth...") |
|||
Line 1: | Line 1: | ||
<onlyinclude> | <onlyinclude> | ||
− | + | Returns true if blob is on ground, false if blob is in air. | |
</onlyinclude> | </onlyinclude> | ||
− | + | ||
+ | This function is most simple way to determine if given blob is in air or on the ground. | ||
+ | (Example, if player is jumping or walking on the ground) | ||
+ | |||
<syntaxhighlight lang="cpp"> | <syntaxhighlight lang="cpp"> | ||
− | |||
bool isOnGround() | bool isOnGround() | ||
− | + | </syntaxhighlight> | |
+ | |||
+ | |||
+ | Example: | ||
+ | <syntaxhighlight lang="cpp"> | ||
+ | if( blob.isOnGround() ) | ||
+ | { | ||
+ | ... | ||
+ | /* | ||
+ | Insert any logic here, which you only want to use if blob is currently on ground | ||
+ | */ | ||
+ | } | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Revision as of 22:30, 1 October 2012
Returns true if blob is on ground, false if blob is in air.
This function is most simple way to determine if given blob is in air or on the ground.
(Example, if player is jumping or walking on the ground)
bool isOnGround()
Example:
if( blob.isOnGround() ) { ... /* Insert any logic here, which you only want to use if blob is currently on ground */ }
Object method of: CBlob