Difference between revisions of "CBlob::setPosition"

From King Arthur's Gold Wiki
Jump to: navigation, search
Line 13: Line 13:
 
(Given that this blob is currently controller by a player)
 
(Given that this blob is currently controller by a player)
 
<syntaxhighlight lang="cpp">
 
<syntaxhighlight lang="cpp">
block.setPosition(getControls().getMouseWorldPos());
+
this.setPosition(this.getControls().getMouseWorldPos());
 
</syntaxhighlight>
 
</syntaxhighlight>
  

Revision as of 00:06, 29 September 2012

Sets a new position for the blob.


This function will set the new position for the blob.

void setPosition( Vec2f pos )


Example, which would set given blob's position to the position of player's mouse cursor. (Given that this blob is currently controller by a player)

this.setPosition(this.getControls().getMouseWorldPos());


Object method of: CBlob