shtanton

Members
  • Content Count

    13
  • Joined

  • Last visited

About shtanton

  • Rank
    Member

Recent Profile Visitors

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

  1. So I've been making a game in Phaser and I want it to auto scale to the size of the window so it is filled but without changing the aspect ratio, I discovered that I could do this using scaleMode = SHOW_ALL and it almost works. If I make the window smaller, the game is scaled down and the aspect ratio is maintained, however, once I've done this I can no longer scale the game up again so it remains in a smaller version even when I make the window bigger again. Here is the code I'm using: this.scale.scaleMode = Phaser.ScaleManager.SHOW_ALL; this.scale.pageAlignHorizontally = true; this.game.stage.backgroundColor = "#AAAAAA"; Thanks in advance for any help!
  2. Thanks, this really helped!
  3. Hi I have a tilemap that's I'm using but I need to get the value of a tile at a certain location on the tilemap and haven't been able to find any way to do this Basically one of my layers is for hitboxes so in order for my collision script to work, the program needs to see whether there is a hitbox at the location the player is trying to move to Thanks in advance
  4. Thanks to both fillmoreb and umz!
  5. The example still allows the player to move diagonally which is what I'm trying to avoid, I don't know why the "else if" statements aren't doing this
  6. I couldn't find a method that interacted with my map the way I intended it to, I have a layer in the json map called hitboxes that either has 0 or a value for whether the sprite should collide with it, if you have a way that phaser can do this with the built in physics and still stay in the 64x64 grid alignment then I'm open to suggestions, thanks!
  7. I'm making a top down game where the player moves smoothly around the plane but is confined to a 64x64 grid, I have achieved this by allowing them to move if they are exactly positioned on one of the 64x64 tiles and if they are, the game tweens them to the appropriate tile. The problem is that despite my best efforts it is still possible to move diagonally which would cause a lot of bugs in my collision code. This is the code I am using update: function () { if (player.x%64 === 0 && player.y%64 === 0) { if (game.input.keyboard.isDown(Phaser.KeyCode.W)) { game.add.tween(player).to({y: player.y-64}, 250, Phaser.Easing.Linear.None, true); } else if (game.input.keyboard.isDown(Phaser.KeyCode.S)) { game.add.tween(player).to({y: player.y+64}, 250, Phaser.Easing.Linear.None, true); } else if (game.input.keyboard.isDown(Phaser.KeyCode.A)) { game.add.tween(player).to({x: player.x-64}, 250, Phaser.Easing.Linear.None, true); } else if (game.input.keyboard.isDown(Phaser.KeyCode.D)) { game.add.tween(player).to({x: player.x+64}, 250, Phaser.Easing.Linear.None, true); } } }, Any help would be great! Thanks in advance
  8. Thanks for the feedback, I've implemented the iteration using forEach but the event I was talking about would be triggered when a sprite comes within a certain distance of another sprite
  9. c9.io is a completely free hosting site and IDE for node.js php etc and having usede it a bit I haven't had any problems
  10. Hi I need to find the distance between a player sprite and the closest sprite to it in a group of sprites, I know this can be done by iterating through each of the sprites in the group and checking them individually however, I was hoping phaser had a built in way of accomplishing this. Once the player is within a certain distance, it will die so if phaser has an event for this that will work as well. Thanks for any help
  11. I need a way to allow the user to select a colour by clicking on a certain point of a wheel. The colour wheel that I am using looks like this (Sorry for huge image) : I would like a way for the user to be able to click somewhere on the wheel, and for phaser to be able to get the hex value of that point. I know that this can be done with canvas but my game uses webGL as well so I need the solution to work with both of possible. Thanks for any help
  12. I have a rope very similar to the phaser example here http://phaser.io/examples/v2/sprites/rope However, mine has a simple spritesheet consisting of only 2 frames (256x96 each). This is the code that should add the spritesheet to the rope but it doesn't work: rope = game.add.rope(100, 100, "ropeImg", 0, points); I have used the same code in a sprite and the spritesheet functions correctly, so the image isn't the problem Thanks for any help