gnoof

Members
  • Content Count

    11
  • Joined

  • Last visited

About gnoof

  • Rank
    Member
  • Birthday 04/02/1987

Profile Information

  • Gender
    Male
  • Location
    UK
  • Interests
    Games and programming

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. I solved this. Not sure if it's the best way to go about it but I set the scale mode to EXACT_FIT and then just adjust the CSS of the parent div. That way I don't need to touch the canvas at all.
  2. Hello! I'm trying to scale my game using custom CSS rather than ScaleManager (I have some specific dynamic scaling I'd like to do depending on the browser size and aspect ratio and it's just easier to do it using custom CSS). The problem is that even in NO_SCALE mode, when the browser is resized, the canvas inline style width/height values are always overridden with the game's default width and height. I can't seem to find a way to turn this off so that I can customize the canvas width/height myself. Any ideas?
  3. gnoof

    Phaser Score

    I'd recommend learning at least the basics of a server-side language like PHP, Ruby or Node.js as there probably won't be a quick copy/paste "it just works" solution. You'll need a server and a database set up (you can set it up locally for testing with something like XAMPP). Essentially, on the client side, when the player gets a new high score, you probably want to send that data (in your case, score and probably a username) to an endpoint through an AJAX POST request. On the server, you would need some code that would grab that data and add it to a database. (http://www.w3schools.com/php/php_mysql_insert.asp) To display it as a high score table, you'd need a second endpoint, where you'd perform an AJAX GET request. On the server, you would need some code that would return all the items stored in your database in JSON format. (http://www.w3schools.com/php/php_mysql_select.asp) Once this is returned, you then display this data on screen via JavaScript. This is a simplified explanation. If it sounds complicated, just read up a little on server-side web programming in whatever language you prefer (I gave PHP in the examples as it's probably the easiest to play with locally with XAMPP).
  4. I don't feel like there is enough information here to go off. So you want to build a game with an ant on a table (guessing top-down view). You want to control it through arrow keys and want to make it rotate to the direction you are facing. From what I can see, you are doing this by editing CSS style values on DOM elements. Do the requirements of your game state that you must use DOM elements to build your game rather than canvas? If not I think using a game framework that uses HTML5 canvas would make this task much easier for you.
  5. I've just spent half my lunch hour at work playing this. Very good and very addictive! I love the power ups such as jetpack and the ball becoming super bouncy. Makes for some tense games!
  6. Cool, glad you got it working!
  7. Not sure about anything built into Phaser to solve this, but I've just tried this: NoSleep.js (they have a live demo link at the bottom). That seems to work nicely. I left it on my Nexus 5X, chrome browser and the backlight stayed on while I left it alone for 5 minutes.
  8. You should never really need to think about JSON/XML files if you use a texture atlas generator, which will take away your frustrations. It will just generate the JSON/XML for you and you can just call the sprite by name, without worrying about x, y, width etc. I'd recommend TexturePacker or if you want a free solution this looks like it will do the job: Texture Atlas Creator
  9. Hey there. You say it stops the animation "When this function has completed". As JavaScript is asynchronous, could it possibly be that the code to stop your animation is running immediately, rather than waiting for your tween to finish? I think what you might need is the tween onCompleteCallback function. e.g. tween.onComplete.add(stopAnimation, this);