5 Replies - 354 Views - Last Post: 18 February 2013 - 09:03 AM

#1 jskidd3  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 57
  • Joined: 16-September 12

Game Log In in Canvas

Posted 18 February 2013 - 08:23 AM

Hello,

I'm working on a really basic snake style game but want to add some log in/registration functionality so I can save particular statistics from the game to the user's profile. I have quite a bit of experience in PHP (profile pages, log in/reg, etc etc) but I have never done this sort of thing in Javascript (which I'm relatively new to). I do know that PHP is a server based language and Javascript is a client based language but I want to create something that can be communicated with inside the canvas itself. For example, when you go onto an MMORPG and you log in, you don't normally log in through an external page, you do it in the game itself. Even then, I wouldn't know how to get information from PHP to Javascript properly.

So yeah, to summarize, a log in system within a canvas that can communicate with a MySQL database.

Thanks!

Is This A Good Question/Topic? 0
  • +

Replies To: Game Log In in Canvas

#2 Dormilich  Icon User is offline

  • 痛覚残留
  • member icon

Reputation: 3525
  • View blog
  • Posts: 10,170
  • Joined: 08-June 10

Re: Game Log In in Canvas

Posted 18 February 2013 - 08:37 AM

View Postjskidd3, on 18 February 2013 - 04:23 PM, said:

So yeah, to summarize, a log in system within a canvas that can communicate with a MySQL database.

that doesn’t work without a server-side language.

as to the example of MMORPGs, are they really canvas or are they flash/Java applets? because a Java applet is an application for itself that runs in the browser, while canvas is "just" an HTML element (with some enhanced graphics capabilities).

to summarise, canvas is just that, a canvas where Java​Script draws on.
Was This Post Helpful? 1
  • +
  • -

#3 jskidd3  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 57
  • Joined: 16-September 12

Re: Game Log In in Canvas

Posted 18 February 2013 - 08:40 AM

Gotcha, thanks for clearing that up, and yes I was referring to the flash applets. Ok, so my next question would be, what is the nearest I can get to something like a flash applets log in system? I'm assuming PHP is going to come in handy now, but how do I get information from PHP into Javascript? For example, let's say the user has logged in and I have their username stored in a variable, I want to display that username inside the canvas, how would I go about doing this?

Thanks
Was This Post Helpful? 0
  • +
  • -

#4 Dormilich  Icon User is offline

  • 痛覚残留
  • member icon

Reputation: 3525
  • View blog
  • Posts: 10,170
  • Joined: 08-June 10

Re: Game Log In in Canvas

Posted 18 February 2013 - 08:59 AM

essentially you would go about that like a normal web page (well, it *is* a normal web page). for writing the name into the canvas, you could just pass JSON serialised data into your Java​Script source and then Java​Script would be responsible to put that data onto the canvas.
Was This Post Helpful? 1
  • +
  • -

#5 jskidd3  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 57
  • Joined: 16-September 12

Re: Game Log In in Canvas

Posted 18 February 2013 - 09:01 AM

Ok thanks again for your help :)
Was This Post Helpful? 0
  • +
  • -

#6 Dormilich  Icon User is offline

  • 痛覚残留
  • member icon

Reputation: 3525
  • View blog
  • Posts: 10,170
  • Joined: 08-June 10

Re: Game Log In in Canvas

Posted 18 February 2013 - 09:03 AM

sure, no problem.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1