Jump to content

Flash games with high scores


aksd

Recommended Posts

hi all

i've put neave snake on my site, and i want to be able to keep the highscores

i've decompiled the flash game and i found this script (i'll upload it somwhere else if needed)

and i found out that the game sends the scores to games_score.php wich sends them to a txt file.

this is the data that is sent to games_score.php : game=snake3&url=http%3A%2F%2Fwww%2Eneave%2Ecom%2Fgames%2Fsnake%2Fsnake%2Eswf&name=somename&score=195

what do i have to write in games_score.php to work ?

please, help me

thnks!

Link to comment
Share on other sites

This code only works if you only store the highest score, not if you want a list if i.e. the ten highest scores. However, this script might help you further...

 

if(isset($_GET) {
  $score= $_GET['score'];
  $username = $_GET['name'];

  $file = "http://localhost/test/highscore.txt"; //contains i.e. "Username,Highscore";
  $fh = fopen($file, "r");
  $content = fread($file);
  fclose($fh);

  $content = explode(",",$content);
  $highScore = $content[1];
  if($score > $highScore) {
     $fh = fopen($file, "w");
     $newContent = $username.",".$score;
     fwrite($fh, $newContent);
     fclose($fh); 
}

Link to comment
Share on other sites

i have progressed a little :D

i found this script http://rapidshare.com/files/28477013/highscoresss.zip , and modified it a little, and now the scores are writing in the database, but i don't know how to display them in the game. i know i have to write in games_score.php some code from loadscores.php (from the archive) but i don't know exactly what

thanks!

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.