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!
Game Log In in Canvas
Page 1 of 15 Replies - 218 Views - Last Post: 18 February 2013 - 09:03 AM
Replies To: Game Log In in Canvas
#2
Re: Game Log In in Canvas
Posted 18 February 2013 - 08:37 AM
jskidd3, 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 JavaScript draws on.
#3
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
Thanks
#4
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 JavaScript source and then JavaScript would be responsible to put that data onto the canvas.
#5
Re: Game Log In in Canvas
Posted 18 February 2013 - 09:01 AM
Ok thanks again for your help
Page 1 of 1
|
|

New Topic/Question
Reply



MultiQuote



|