Providing Feedback
Update to the attack.php file
header('Location: layar://mmodemo/?action=refresh&msg=Did%3A'.$monDamage.'%20Took%3A'.$userDamage);
Update to the simple-display.php file
echo '{ "layer": "mmodemo", "actions": [ { "uri": "http://www.thoughtfulmonkey.com/layar-mmo/display-stats.php", "label": "ST:'.$userST.' T:'.$userT.' HP:'.$userHP.'", "contentType": "text/html" } ],'; if ( isset($_GET['msg']) ) echo '"showMessage": "'.$_GET['msg'].'",'; echo '"hotspots": ['; findMonsters($latitude, $longitude, $db, $userID); echo'], "errorCode": 0, "errorString": "ok" }';
Basis for creating a monster image showing its health:
<?php $img = imagecreatefrompng("beetle2-tiny.png"); $grey = ImageColorAllocate($img, 204, 204, 204); ImageFilledRectangle($img, 70, 30, 20, 10, $grey); $black = ImageColorAllocate($img, 0, 0, 0); ImageString($img, 3, 25, 10, "HP:100", $black); header('Content-type: image/png'); ImagePNG($img); imagedestroy($img); ?>