Search the Community

Showing results for tags 'ajax'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • HTML5 Game Coding
    • News
    • Game Showcase
    • Coding and Game Design
  • Frameworks
    • Phaser
    • Pixi.js
    • Babylon.js
    • Panda.js
    • melonJS
    • Haxe JS
    • Kiwi.js
  • General
    • General Talk
  • Business
    • Collaborations (un-paid)
    • Jobs (Hiring and Freelance)
    • Services Offered

Found 13 results

  1. Ajax inside phaser not working

    Hello I'm just trying to get a simple ajax function to work inside phaser just to play around with it. But I can't seem to get it to work. The function is just supposed to send two variables to PHP and get back a sentence where those two variables are part of it. But I only get the basic sentence back. And I have tried to use the function outside phaser with just an onclick bottom function, and their it works fine. So it must have something to do with phaser. heres the code in phaser And here is the php I have a sprite where i use the events.onInputDown.add function. But i only get While when i just use a botton in html and plane javascript i get
  2. Game with AJAX->PHP

    I'm new to game development. I want to create a game that is decided on the server side with PHP. The graphics will be shown using Canvas and I would hope that some graphics would be used from Illustrator. I need to know if the pixi.js framework can be used to communicate via AJAX to represent different graphics through user interaction. Example. User makes a decision -> values are calculated on the server side -> sent back and represented with graphics. Is this possible? I took a glimpse at the documentation and searched for AJAX but found nothing.
  3. Hi, I'm working on a medical application where anatomical 3d Models are shown in the Browser. At the moment I am working with Threejs, but I am looking for alternatives and Babylon.js looks very good, especially from a documentation perspective. But I cant find much information about loading Scenes/STLs using XHR Requests. In most tutorials they are loaded as assets directly from the webserver the app is hosted on. So my Questions are: Is it possible to load a scene from an application server which is not the webserver using http GET, including an x-auth-token in the header ? Is it possible to load the file as a binary stream, or in a small format? (Because the models often have a high poly-count) Thanks in advance :-)
  4. Ajax callback in Phaser using states

    Hey everybody, excuse my poor english ! I was using a single JS file for my program structured like this : index.html with <div id="timediv"></div> script.js with my Phaser code including anim function called in ajax.js. This function was declared after the update in script.js. ajax.js with function refreshdiv() which call lance() which call anim() every 60 seconds. Everything was ok like this Now I want to use states. I made : bootState, loadState and the main state called scriptState. But where do I have to place anim() declaration now ? I tried different places (in scriptState, after update, in create, in update, in bootState init etc...) but I have always the same message : Thanks a lot for your help !
  5. Hi, About my project: It is intended to be an up to 2 player street-fighter/tekken type of game. For a game dev class I have to create and deploy a javascript game. I would like to add the feature that the user can use their phone as a (wireless ideally) gamepad/controller and their desktop would be the monitor to show the game (this would all have to happen in real time). I don't have any back end development skills, nor do I really have the time to pick them up, so something like Websocket would be impractical (I know there is Kaazing, but I followed their documentation step by step and this caused issues very early). My question is can I do something like this in real time with Ajax? I do not know how to use Ajax just yet, but I figure I can pick this up much faster than learning backend. If not is their something where I can just copy the code entirely include it within my project (ofcourse giving the proper credit where its due) and edit the front end to apply to my game & gamepad.
  6. XHR with cocoon.io

    I developed an HTML5 app and i used cocoon.io as compiler and webview as renderer, when i launch the app from my phone XHR doesn't wotk, looking at console i have a message "404 not found", but url exist and if i launch app from a browser it wotks!!!! Is It possibile cocoon compiler disable Ajax request?
  7. Ajax

    Does bjs have a built-in way to make ajax calls (e.g. to a php script) or would I have to write my own script for that? Also, under the hood does bjs use jQuery or any other framework to load assets or is it completely independent?
  8. Scroll position reset on mobile

    Hi guys, I have a strange problem: I load a minimal Phaser game via an AJAX request somewhere in my page, and the scroll positions resets on top of the page... only on mobile, it doesn't happen on desktop. I don't know why and it's driving me crazy. I have set up a minimal code that will reproduce the error on mobile. It is divided in two files. First, the index html where the AJAX request is made: <!DOCTYPE html><html><head> <title>TEST</title> <script src="https://cdnjs.cloudflare.com/ajax/libs/phaser/2.4.3/phaser.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script></head><body> <div id="box" style="margin-top:2000px"> <div id="test"></div> </div> <button id="btnload">LOAD</button> <script type="text/javascript"> $("#btnload").click(function() { $.ajax({ type: "GET", url: "test2.html", success: function(response) { $('#test').html(response); }, complete: function(xhr, status) {}, error: function() { alert("Error : could not connect to server"); } }); return false; }); </script></body></html>Then the second file that is used to give a response to the AJAX request (that is, an empty Phaser game) : <script type="text/javascript">// GAME OBJECTvar game = new Phaser.Game( 550, // width 380, // height Phaser.CANVAS, // renderer (CANVAS for better compatibility) 'test', // container HTML ID { preload: preload, create: create, update: update }, // available functions false // transparent background);function preload() {}function create() { game.stage.backgroundColor = '#000000';}function update() {}</script>When clicking on the "LOAD" button in index, the Phaser is correctly loaded, but the page resets itself on top. That is not wanted. How can I avoid this problem?
  9. phaser - mighty - ajax-php-mysql

    Hi, I want to connect with a database to save the scores, but, on first, I'm making a test. I'm trying with this sample code to know if I could receive simply "text" request, var pause_ajax = this.game.add.text(this.game.world.centerX, this.game.world.centerY+30, "connection"); pause_ajax.inputEnabled = true; pause_ajax.events.onInputUp.add(function () { var ajaxUrl = "http://www.anotherurlnotinmighty.es/php.php"; $.ajax({ url: ajaxUrl, dataType: "html", method: "post", beforeSend: function() { }, success: function() { alert("work"); }, error: function(){ alert("error") } }); }); The php file is on another server. When I click the label, this makes the connection but it don't recive anything. ResponseText="" php.php <?php session_start(); print "test"; ?> jQuery is correctly imported on my project. There are any other best option to save the scores on dataBase? Thanks
  10. Webcam performer seeking for developer to create an app. Hi! I need a software (game) which could be compatible with the website that I'm using to broadcast. The idea is - objects falling down in the broadcast window are operated by visitors from my chat, for example, when they press key 1. I found varieties of web cam games in google, but they all have to be operated by player who has the camera. What I'm looking for is a software which could allow people from the chat to be involved in the game too. DM if interested.
  11. load json from server with ajax

    Hi everyone i need a bit help with this and phaser what is the best way to load a json data from a server with jquery ajax, can i use jquery with phaser? can i use a ajax call like a webapp for example $.ajax({ type: GET,POST ETC, url: somewhere, data:some data, callback function....... }) or exist another way to do this . This is my first time with phaser and i am developing a game with this features: 1) i have a main view with a image logo 2) this second view is sign up form (i need send a json to the server) 3) the third view is for instructions and has the start game buttom 4) the next view is the first level 5) this view is after finish the level in this view we have a question (i need to do a get request to load questions and answers from the server and then send a POST request the answer to the server again)
  12. In 'preload' I'm using game.load.json('test', 'test.json');to load some data. This starts an asynchronous request, so I can only use the results in 'create' : var jsoncontents = game.cache.getJSON('test');But now I want to load some other json, based on the contents of the first json file. Somehow I need a synchronous request. With jQuery you can specify if an ajax-request should be asynchronous or not. Any way to achieve the same in Phaser?
  13. Hello Anybody, I just encountered a problem when preloading json, with IE9. I tracked the problem down the Phaser.Loader.jsonLoadComplete handler is using this._xhr.responseText instead of this._ajax.responseText when window.XDomainRequest is used. I checked the master/dev and parallel-loader branches there doesn't seem to be fix in place yet, is this a bug or am I missing something else here? Regards, Brad