happy Posted November 5, 2013 Share Posted November 5, 2013 Hey, I've been playing a few of the games in the show case forum, and most of the games there have multiple levels that you need to unlock by achieving a certain score. They also mostly save the current level of the user so that the browser window can be closed, reopened and the unlocked level is still available. Do you guys relay on your js framework or engine for this or do you use raw JavaScript for it? I'm using the limejs at the moment and they have nothing available for this sort of thing, I'm interested to how everyone tackles this. Cheers,h Quote Link to comment Share on other sites More sharing options...
Consty Posted November 5, 2013 Share Posted November 5, 2013 If your question is how to save unlocked levels locally, I suggest looking into the localStorage API. http://slides.html5rocks.com/#web-storage You can easily save data (like unlocked level id's etc...) and retrieve it at the start of your game to unlock the required levels. Quote Link to comment Share on other sites More sharing options...
happy Posted November 5, 2013 Author Share Posted November 5, 2013 Thanks Consty. Quote Link to comment Share on other sites More sharing options...
1-800-STAR-WARS Posted November 19, 2013 Share Posted November 19, 2013 I use Amplify to abstract away local storage stuff - http://amplifyjs.com/ Also comes with AJAX and Pub/Sub - I use it instead of heavyweight libraries like JQuery haden 1 Quote Link to comment Share on other sites More sharing options...
happy Posted November 26, 2013 Author Share Posted November 26, 2013 Thanks for your addition, Lewis. What do you guys do about cross device support? I'm assuming that Local Storage will only work when a browser is being used, so for native android applications etc, it falls over. Also looking at amplifyjs, I think a similar situation exists there to. I've not ported anything to a mobile device yet, infact all I have this far is names of packages such as phonegap for me to explore when I'm ready to start porting. I'm trying to bare in mind that at some point I will port to mobile devices so I'm trying to be careful with incompatible elements I put into my game, such as HTML5 audio, Local Storage and so forth. Cheers, Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.