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...") |
|||
(One intermediate revision by the same user not shown) | |||
Line 1: | Line 1: | ||
<onlyinclude> | <onlyinclude> | ||
− | + | Returns true if blob is on ground, false if blob is in air. | |
</onlyinclude> | </onlyinclude> | ||
− | + | ||
+ | This function is the 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> | ||
Latest revision as of 22:31, 1 October 2012
Returns true if blob is on ground, false if blob is in air.
This function is the 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