Difference between revisions of "GetGameTime"

From King Arthur's Gold Wiki
Jump to: navigation, search
(Created page with "<onlyinclude> Returns the game time (number of ticks) as an int. </onlyinclude> <syntaxhighlight lang="cpp"> int getGameTime() </syntaxhighlight> Example from Entities/Character...")
 
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
 
<onlyinclude>
 
<onlyinclude>
Returns the game time (number of ticks) as an int.
+
Returns the game time (number of ticks) as an integer (s32).
 
</onlyinclude>
 
</onlyinclude>
 
<syntaxhighlight lang="cpp">
 
<syntaxhighlight lang="cpp">
int getGameTime()
+
s32 getGameTime()
 
</syntaxhighlight>
 
</syntaxhighlight>
  

Latest revision as of 13:35, 26 August 2012

Returns the game time (number of ticks) as an integer (s32).

s32 getGameTime()

Example from Entities/Characters/Scripts/BuilderAnim.as:

Vec2f p = this.getBlob().getPosition() + Vec2f(0.0f, -this.getBlob().getHeight() * 2.0f);
position2di pos = getDriver().getScreenPosFromWorldPos( p );
pos.X -= 16;
pos.Y += -3 + Maths::FastSin(getGameTime()/4.5f)*3.0f;GUI::DrawIcon( "GUI/PartyIndicator.png", 2, dimension2di(16, 16), pos, getCamera().targetDistance );