Search the Community
Showing results for tags 'SQL'.
-
Hi everyone. I'm trying to learn something about how to load database information in my phaser games. Currently, I want to load some questions for a quizz game from a SQL database. I've searched online and I found a method that works but I don't know if it's the best option. Making a XMLHttpRequest I can load a PHP file in which I load the db info and then parse it into a JSON. As I said, it works, but then I don't know how to send the results back to the game, since is an asynchronous proccess. Let me explain myself with the code: Quizz.Game.prototype = { create: function(){ this.getQuestion(); }, getQuestion: function(){ var request = new XMLHttpRequest(); request.open('POST', 'getQuestion.php', true); request.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=UTF-8'); request.onload = function(){ if(request.status >= 200 && request.status < 400){ //Correct var result = JSON.parse(request.responseText); this.sendQuestion(result); } else{ //Error } } request.send(); }, sendQuestion: function(){ //The next code } }; In this example I tried to load the question and then print it on screen or something, but I get the error 'this.sendQuestion()' is not a function, seems like the context is no longer 'this'... I guess my question is if you have some procedure you usually use for do this, or if there's a better way of doing it. Thank you for sharing! Gonzalo.
-
I am starting to work on a game that is going to have a list of characters and stats for those characters (around 100-200 character each with at least 6 stats). When trying to think of how to create these characters in a way that they are easily readable I've hit a hiccup. Should I be trying to store these in a database and using ajax to pull the information out and use it? My other thought was to use an excel sheet to create a json file and read that. Is there a common practice for this type of work in Phaser?
-
Hi ! I'm making a game with JSON file for data, I use node-webkit for distribute the game, but I would like to update data without re-download the app. What's is the best way for the app to communicate with a database, AJAX call, Socket.io, or ? (it's not about which database management systems and system on server, it's how to communicate between the server and the app) How do you make ? Make you one request for update the game, store response in localStorage, or one request each time you need data ? How millisecondes do you have between request and response ? Informations : I can choose your best way for your solution, big data one time, many small requests, or moderate frequency and size requests. Regards, Arrowbaz
-
Am looking for qualified online tools programmer for permanent position in Coventry, UK. Key Attributes Highly proficient C# programmer In-depth knowledge of multiple areas from the following ◦ WCF, ◦ SQL Databases – Entity Framework, ◦ ASP .Net MVC ◦ HTML 5 – CSS3 – JavaScript ◦ WPF - Prism ◦ Asynchronous programming, Rx – Reactive Extensions ◦ Cloud based data processing, application hosting and server programming using Windows Azure, Amazon AWS or other cloud services provider. At least 3 years of programming experience in the games industry or a similar leading-edge software industry such social media, internet content providers or search engines. Experience in a variety of programming languages, scripting languages & technologies, suited to developing tools applications in an effective manner Positive and outgoing personality Excellent creative problem solving abilities Experience of breaking down large tasks into a comprehensive set of sub-tasks, and estimating how long the tasks will take Excellent organisational abilities Excellent written and verbal communication skills Excellent bug finding & fixing skills Excellent User-Interface design skills Have a passion for developing high-quality software CVs and more info @ [email protected]