Sign in to follow this  
Codenburger

User account inside app

Recommended Posts

Hi,

I have built a prototype for a simple game.

This game is used by parents and children.

The next stage of the app, is the ability to create a simple user account for the child, managed by the paren.

Steps:

1. The parent would create an account and input the child's name.

2. The account would keep simple data about the game and save the data to be retrieved,

the next time that the game is played.

Is this kind of thing possible in Phaser ?

Thank you to anyone who can give me advice about this.

Codenburger

Share this post


Link to post
Share on other sites

That kind of thing is possible in any modern browser independent of Phaser.

 

Look into local storage. It's easy to use, but the data can potentially be erased and you are limited to a relatively small amount of space (which differs from browser to browser and user settings) of around 5 MB.

For a more permanent solution you will need a server where the data would be stored.

Share this post


Link to post
Share on other sites

Hi horkoda,

 

Thank you, localStore is working fine with Phaser in my app.

 

I am trying to use Javascript to dynamically build a html form, which I want to pass user input to a localStore variable, for a user's name.

 

I basically want to have control of the dom using Javascript, so that I can call on a function which will act like a pop up window whenever called.

 

Codenburger 

Share this post


Link to post
Share on other sites

Yeah, JSON is great.

Note that you can save _anything_ in localStorage you want. Even HTML code.

But that might not be suitable for your scenario, since you've mentioned you're dynamically building the form.

 

Decide for yourself! :)

Share this post


Link to post
Share on other sites

Dynamic form stuff is pretty easy...

var tbFirstName = document.createElement("input");tb.FirstName.name = "tbFirstName";tb.FirstName.placeholder = "Give me your name";tb.FirstName.style.top = "10px";tb.FirstName.style.etc.etc.etc;document.appendChild(tbFirstName);// later...console.log("somebody entered: " + tbFirstName.value);

Share this post


Link to post
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  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.

Loading...
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.