<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Adding Experience to our Combat System(PHP)</title>
	<atom:link href="http://buildingbrowsergames.com/2009/01/05/adding-experience-to-our-combat-systemphp/feed/" rel="self" type="application/rss+xml" />
	<link>http://buildingbrowsergames.com/2009/01/05/adding-experience-to-our-combat-systemphp/</link>
	<description>Ever wanted to build a browsergame?</description>
	<lastBuildDate>Wed, 30 Nov 2011 19:42:01 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.5</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: SergiuGothic</title>
		<link>http://buildingbrowsergames.com/2009/01/05/adding-experience-to-our-combat-systemphp/comment-page-1/#comment-607</link>
		<dc:creator>SergiuGothic</dc:creator>
		<pubDate>Wed, 18 Nov 2009 02:06:43 +0000</pubDate>
		<guid isPermaLink="false">http://buildingbrowsergames.com/?p=671#comment-607</guid>
		<description>Hi luke, I really love this tutorial, I followed it, and I can say that I learned very very much...&lt;br&gt;I even got some improvements :D&lt;br&gt;&lt;br&gt;Improvement for level of the player:&lt;br&gt;&lt;br&gt;Add level stat:&lt;br&gt;INSERT INTO stats(display_name, short_name) VALUES (&#039;Level&#039;,&#039;lvl&#039;);&lt;br&gt;&lt;br&gt;Replace the change you made to forest.php with:&lt;br&gt;&lt;br&gt;$monster_exp = getMonsterStat(&#039;exp&#039;,$monsterID);&lt;br&gt;$smarty-&gt;assign(&#039;exp&#039;,$monster_exp);&lt;br&gt;$exp_rem = getStat(&#039;exp_rem&#039;,$userID);&lt;br&gt;$exp_rem -= $monster_exp;&lt;br&gt;$level = getStat(&#039;lvl&#039;,$userID);&lt;br&gt;$level2 = 0;&lt;br&gt;$exp = getStat(&#039;exp&#039;,$userID);&lt;br&gt;if($exp_rem&lt;=0) {&lt;br&gt;          $exp_rem = 100+$exp_rem;&lt;br&gt;          $level +=1;&lt;br&gt;          $level2 = 1;&lt;br&gt;          setStat(&#039;lvl&#039;,$userID,$level);&lt;br&gt;}&lt;br&gt;$smarty-&gt;assign(&#039;level_up&#039;,$level2);&lt;br&gt;$smarty-&gt;assign(&#039;nlevel&#039;,$level);&lt;br&gt;setStat(&#039;exp&#039;,$userID,getStat(&#039;exp&#039;,$userID) + $monster_exp);&lt;br&gt;setStat(&#039;exp_rem&#039;,$userID,$exp_rem);&lt;br&gt;&lt;br&gt;&lt;br&gt;In register.php add this to the block of starting values of the player:&lt;br&gt;setStat(&#039;lvl&#039;,$userID,&#039;1&#039;);&lt;br&gt;&lt;br&gt;In index.php add those to the block of smarty assignments:&lt;br&gt;$smarty-&gt;assign(&#039;level&#039;,getStat(&#039;lvl&#039;,$userID));&lt;br&gt;$smarty-&gt;assign(&#039;experience&#039;,getStat(&#039;exp&#039;,$userID));&lt;br&gt;$smarty-&gt;assign(&#039;exp_remaining&#039;,getStat(&#039;exp_rem&#039;,$userID));&lt;br&gt;&lt;br&gt;In index.tpl add those to the block of user stats:&lt;br&gt;&lt;li&gt;Current level: &lt;strong&gt;{$level}&lt;/strong&gt;&lt;/li&gt;&lt;br&gt;&lt;li&gt;Experience: &lt;strong&gt;{$experience}&lt;/strong&gt;&lt;/li&gt;&lt;br&gt;&lt;li&gt;Experience needed until level {$level+1}: &lt;strong&gt;{$exp_remaining}&lt;/strong&gt;&lt;/li&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;This is it :D</description>
		<content:encoded><![CDATA[<p>Hi luke, I really love this tutorial, I followed it, and I can say that I learned very very much&#8230;<br />I even got some improvements <img src='http://buildingbrowsergames.com/blog/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
<p>Improvement for level of the player:</p>
<p>Add level stat:<br />INSERT INTO stats(display_name, short_name) VALUES (&#39;Level&#39;,&#39;lvl&#39;);</p>
<p>Replace the change you made to forest.php with:</p>
<p>$monster_exp = getMonsterStat(&#39;exp&#39;,$monsterID);<br />$smarty-&gt;assign(&#39;exp&#39;,$monster_exp);<br />$exp_rem = getStat(&#39;exp_rem&#39;,$userID);<br />$exp_rem -= $monster_exp;<br />$level = getStat(&#39;lvl&#39;,$userID);<br />$level2 = 0;<br />$exp = getStat(&#39;exp&#39;,$userID);<br />if($exp_rem&lt;=0) {<br />          $exp_rem = 100+$exp_rem;<br />          $level +=1;<br />          $level2 = 1;<br />          setStat(&#39;lvl&#39;,$userID,$level);<br />}<br />$smarty-&gt;assign(&#39;level_up&#39;,$level2);<br />$smarty-&gt;assign(&#39;nlevel&#39;,$level);<br />setStat(&#39;exp&#39;,$userID,getStat(&#39;exp&#39;,$userID) + $monster_exp);<br />setStat(&#39;exp_rem&#39;,$userID,$exp_rem);</p>
<p>In register.php add this to the block of starting values of the player:<br />setStat(&#39;lvl&#39;,$userID,&#39;1&#39;);</p>
<p>In index.php add those to the block of smarty assignments:<br />$smarty-&gt;assign(&#39;level&#39;,getStat(&#39;lvl&#39;,$userID));<br />$smarty-&gt;assign(&#39;experience&#39;,getStat(&#39;exp&#39;,$userID));<br />$smarty-&gt;assign(&#39;exp_remaining&#39;,getStat(&#39;exp_rem&#39;,$userID));</p>
<p>In index.tpl add those to the block of user stats:<br />&lt;li&gt;Current level: <strong>{$level}</strong>&lt;/li&gt;<br />&lt;li&gt;Experience: <strong>{$experience}</strong>&lt;/li&gt;<br />&lt;li&gt;Experience needed until level {$level+1}: <strong>{$exp_remaining}</strong>&lt;/li&gt;</p>
<p>This is it <img src='http://buildingbrowsergames.com/blog/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: sergiugothic</title>
		<link>http://buildingbrowsergames.com/2009/01/05/adding-experience-to-our-combat-systemphp/comment-page-1/#comment-540</link>
		<dc:creator>sergiugothic</dc:creator>
		<pubDate>Tue, 17 Nov 2009 20:06:43 +0000</pubDate>
		<guid isPermaLink="false">http://buildingbrowsergames.com/?p=671#comment-540</guid>
		<description>Hi luke, I really love this tutorial, I followed it, and I can say that I learned very very much...&lt;br&gt;I even got some improvements :D&lt;br&gt;&lt;br&gt;Improvement for level of the player:&lt;br&gt;&lt;br&gt;Add level stat:&lt;br&gt;INSERT INTO stats(display_name, short_name) VALUES (&#039;Level&#039;,&#039;lvl&#039;);&lt;br&gt;&lt;br&gt;Replace the change you made to forest.php with:&lt;br&gt;&lt;br&gt;$monster_exp = getMonsterStat(&#039;exp&#039;,$monsterID);&lt;br&gt;$smarty-&gt;assign(&#039;exp&#039;,$monster_exp);&lt;br&gt;$exp_rem = getStat(&#039;exp_rem&#039;,$userID);&lt;br&gt;$exp_rem -= $monster_exp;&lt;br&gt;$level = getStat(&#039;lvl&#039;,$userID);&lt;br&gt;$level2 = 0;&lt;br&gt;$exp = getStat(&#039;exp&#039;,$userID);&lt;br&gt;if($exp_rem&lt;=0) {&lt;br&gt;          $exp_rem = 100+$exp_rem;&lt;br&gt;          $level +=1;&lt;br&gt;          $level2 = 1;&lt;br&gt;          setStat(&#039;lvl&#039;,$userID,$level);&lt;br&gt;}&lt;br&gt;$smarty-&gt;assign(&#039;level_up&#039;,$level2);&lt;br&gt;$smarty-&gt;assign(&#039;nlevel&#039;,$level);&lt;br&gt;setStat(&#039;exp&#039;,$userID,getStat(&#039;exp&#039;,$userID) + $monster_exp);&lt;br&gt;setStat(&#039;exp_rem&#039;,$userID,$exp_rem);&lt;br&gt;&lt;br&gt;&lt;br&gt;In register.php add this to the block of starting values of the player:&lt;br&gt;setStat(&#039;lvl&#039;,$userID,&#039;1&#039;);&lt;br&gt;&lt;br&gt;In index.php add those to the block of smarty assignments:&lt;br&gt;$smarty-&gt;assign(&#039;level&#039;,getStat(&#039;lvl&#039;,$userID));&lt;br&gt;$smarty-&gt;assign(&#039;experience&#039;,getStat(&#039;exp&#039;,$userID));&lt;br&gt;$smarty-&gt;assign(&#039;exp_remaining&#039;,getStat(&#039;exp_rem&#039;,$userID));&lt;br&gt;&lt;br&gt;In index.tpl add those to the block of user stats:&lt;br&gt;&lt;li&gt;Current level: &lt;strong&gt;{$level}&lt;/strong&gt;&lt;/li&gt;&lt;br&gt;&lt;li&gt;Experience: &lt;strong&gt;{$experience}&lt;/strong&gt;&lt;/li&gt;&lt;br&gt;&lt;li&gt;Experience needed until level {$level+1}: &lt;strong&gt;{$exp_remaining}&lt;/strong&gt;&lt;/li&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;This is it :D</description>
		<content:encoded><![CDATA[<p>Hi luke, I really love this tutorial, I followed it, and I can say that I learned very very much&#8230;<br />I even got some improvements <img src='http://buildingbrowsergames.com/blog/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
<p>Improvement for level of the player:</p>
<p>Add level stat:<br />INSERT INTO stats(display_name, short_name) VALUES (&#39;Level&#39;,&#39;lvl&#39;);</p>
<p>Replace the change you made to forest.php with:</p>
<p>$monster_exp = getMonsterStat(&#39;exp&#39;,$monsterID);<br />$smarty-&gt;assign(&#39;exp&#39;,$monster_exp);<br />$exp_rem = getStat(&#39;exp_rem&#39;,$userID);<br />$exp_rem -= $monster_exp;<br />$level = getStat(&#39;lvl&#39;,$userID);<br />$level2 = 0;<br />$exp = getStat(&#39;exp&#39;,$userID);<br />if($exp_rem&lt;=0) {<br />          $exp_rem = 100+$exp_rem;<br />          $level +=1;<br />          $level2 = 1;<br />          setStat(&#39;lvl&#39;,$userID,$level);<br />}<br />$smarty-&gt;assign(&#39;level_up&#39;,$level2);<br />$smarty-&gt;assign(&#39;nlevel&#39;,$level);<br />setStat(&#39;exp&#39;,$userID,getStat(&#39;exp&#39;,$userID) + $monster_exp);<br />setStat(&#39;exp_rem&#39;,$userID,$exp_rem);</p>
<p>In register.php add this to the block of starting values of the player:<br />setStat(&#39;lvl&#39;,$userID,&#39;1&#39;);</p>
<p>In index.php add those to the block of smarty assignments:<br />$smarty-&gt;assign(&#39;level&#39;,getStat(&#39;lvl&#39;,$userID));<br />$smarty-&gt;assign(&#39;experience&#39;,getStat(&#39;exp&#39;,$userID));<br />$smarty-&gt;assign(&#39;exp_remaining&#39;,getStat(&#39;exp_rem&#39;,$userID));</p>
<p>In index.tpl add those to the block of user stats:<br />&lt;li&gt;Current level: <strong>{$level}</strong>&lt;/li&gt;<br />&lt;li&gt;Experience: <strong>{$experience}</strong>&lt;/li&gt;<br />&lt;li&gt;Experience needed until level {$level+1}: <strong>{$exp_remaining}</strong>&lt;/li&gt;</p>
<p>This is it <img src='http://buildingbrowsergames.com/blog/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
</channel>
</rss>

