-
Website
http://buildingbrowsergames.com -
Original page
http://buildingbrowsergames.com/2008/06/11/building-browsergames-a-simple-combat-system/ -
Subscribe
All Comments -
Community
-
Top Commenters
-
gabrielbianconi
1 comment · 1 points
-
Luke
82 comments · 1 points
-
spatlabor
1 comment · 1 points
-
HughCompton
2 comments · 1 points
-
obat jerawat
1 comment · 1 points
-
-
Popular Threads
Right now, if things are going bad, you could navigate away and your HP is back to normal again....
works, here - after encounting a monster and clicking attack, the entire
combat simulation is run and the player's health is updated, before the next
screen. There isn't really a screen where they can see the battle is going
badly and run away.
Thanks for your reply!
"Notice: Use of undefined constant attacker - assumed 'attacker' in /Users/Niels/Sites/bg/smarty/bg/forest.php on line 53"
Caused by the arrays:
$combat[$turns] = array(
attacker => $attacker['name'],
defender => $defender['name'],
damage => $damage
);
I fixed it this way:
$combat[$turns] = array(
'attacker' => $attacker['name'],
'defender' => $defender['name'],
'damage' => $damage
);
PS: I realy like this tutorial, i was searching a long time for something like this :) .
5 player attack value ____ monster defence value 7 > no one will lose any health
4 monster attack value ____ player defence value 5 > no one will lose any health