Differences

This shows you the differences between two versions of the page.

Link to this comparison view

layarmmo-feedback [2012/05/11 14:02] (current)
matthewleach created
Line 1: Line 1:
 +== Providing Feedback ==
  
 +Update to the attack.php file
 +
 +<code php>
 +header('​Location:​ layar://​mmodemo/?​action=refresh&​msg=Did%3A'​.$monDamage.'​%20Took%3A'​.$userDamage);​
 +</​code>​
 +
 +Update to the simple-display.php file
 +
 +<code php>
 +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"​
 +}';
 +</​code>​
 +
 +Basis for creating a monster image showing its health:
 +
 +<code php>
 +<?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);​
 +
 +?>
 +</​code>​