<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
	<channel>
		<title><![CDATA[Maratis forum - Timer in lua]]></title>
		<link>http://forum.maratis3d.com/viewtopic.php?id=462</link>
		<description><![CDATA[The most recent posts in Timer in lua.]]></description>
		<lastBuildDate>Mon, 22 Oct 2012 09:23:36 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: Timer in lua]]></title>
			<link>http://forum.maratis3d.com/viewtopic.php?pid=2805#p2805</link>
			<description><![CDATA[<p>Okay good, thanks.</p>]]></description>
			<author><![CDATA[dummy@example.com (Almighty Laxz)]]></author>
			<pubDate>Mon, 22 Oct 2012 09:23:36 +0000</pubDate>
			<guid>http://forum.maratis3d.com/viewtopic.php?pid=2805#p2805</guid>
		</item>
		<item>
			<title><![CDATA[Re: Timer in lua]]></title>
			<link>http://forum.maratis3d.com/viewtopic.php?pid=2803#p2803</link>
			<description><![CDATA[<p>onSceneUpdate is always launched 60 time per second, even if the fps are lower. so it&#039;s safe.</p>]]></description>
			<author><![CDATA[dummy@example.com (anael)]]></author>
			<pubDate>Mon, 22 Oct 2012 06:38:32 +0000</pubDate>
			<guid>http://forum.maratis3d.com/viewtopic.php?pid=2803#p2803</guid>
		</item>
		<item>
			<title><![CDATA[Re: Timer in lua]]></title>
			<link>http://forum.maratis3d.com/viewtopic.php?pid=2801#p2801</link>
			<description><![CDATA[<p>Thanks! But if the fps was lower than 60 wouldn&#039;t the timer be inaccurate?</p>]]></description>
			<author><![CDATA[dummy@example.com (Almighty Laxz)]]></author>
			<pubDate>Sun, 21 Oct 2012 21:48:46 +0000</pubDate>
			<guid>http://forum.maratis3d.com/viewtopic.php?pid=2801#p2801</guid>
		</item>
		<item>
			<title><![CDATA[Re: Timer in lua]]></title>
			<link>http://forum.maratis3d.com/viewtopic.php?pid=2797#p2797</link>
			<description><![CDATA[<p>Hello, to quote anael : <br /></p><div class="quotebox"><cite>anael wrote:</cite><blockquote><p>The lua script update is syncronised at 60fps<br />so you can create a timer with a simple variable like that :</p><p>t = 0</p><p>function onSceneUpdate()</p><p>&nbsp; &nbsp; -- 1 second<br />&nbsp; &nbsp; if t == 60&nbsp; then<br />&nbsp; &nbsp; &nbsp; &nbsp; print(&quot;one second&quot;)<br />&nbsp; &nbsp; end</p><p>&nbsp; &nbsp; t = t+1<br />end</p></blockquote></div><p>So you could do something like :<br />--print every seconds in the console</p><p>TIMER = {ms = 0,&nbsp; seconds = 0, onesec = 60}</p><p>function onSceneUpdate() </p><p>&nbsp; &nbsp; TIMER.ms = TIMER.ms + 1</p><p>&nbsp; &nbsp; if TIMER.ms == TIMER.onesec then <br />&nbsp; &nbsp; &nbsp; &nbsp; TIMER.ms = 0 <br />&nbsp; &nbsp; &nbsp; &nbsp; TIMER.seconds = TIMER.seconds + 1<br />&nbsp; &nbsp; &nbsp; &nbsp; print(TIMER.seconds)<br />&nbsp; &nbsp; end</p><p>end</p>]]></description>
			<author><![CDATA[dummy@example.com (Vegas)]]></author>
			<pubDate>Sun, 21 Oct 2012 11:30:22 +0000</pubDate>
			<guid>http://forum.maratis3d.com/viewtopic.php?pid=2797#p2797</guid>
		</item>
		<item>
			<title><![CDATA[Timer in lua]]></title>
			<link>http://forum.maratis3d.com/viewtopic.php?pid=2796#p2796</link>
			<description><![CDATA[<p>Hi,<br />I am currently making time challenges for my game, but I don&#039;t know how to make a timer to count the seconds. Does anyone know how?</p>]]></description>
			<author><![CDATA[dummy@example.com (Almighty Laxz)]]></author>
			<pubDate>Sun, 21 Oct 2012 07:33:24 +0000</pubDate>
			<guid>http://forum.maratis3d.com/viewtopic.php?pid=2796#p2796</guid>
		</item>
	</channel>
</rss>
