Sign in to follow this  
theodore italik

[web] storing highscores

Recommended Posts

Hi,

I've been tricking around with HTML5's canvas and some javascript to make a snake clone, I'd like to be able to store the high scores but I'm not sure how to do it. A few links I've found online all refer to using a mysql database hosted on a server. I have access to a unix server to host my game but I don't have access to any databases. Would it be feasible to use XML?

I'd really appreciate any tips or advice.

Thanks,

Theodore

Share this post


Link to post
Share on other sites
This is an excellent use for a cookie (for single users). If you want high scores for EVERYBODY,you certainly don't need a database for that. Just store the results in a tab-delimited text file. Manipulate the text file with a server-side script of your choice (PHP, Perl, shell...). Trigger the server-side script to run with a simple AJAX query.

Share this post


Link to post
Share on other sites
I know this is [i]months [/i]after my original post, and I had intended to reply sooner but I totally forgot.

What I ended up doing was going with a local high score so that the player is only trying to beat their own score each time rather than a global score board.

I used local storage that I'd read up on in [url="http://www.developria.com/2010/11/html5-recipes-storage-101.html"]this tutorial[/url] and it worked really well.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this