• Content Count

  • Joined

  • Last visited

About TomLeGrand

  • Rank

Recent Profile Visitors

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

  1. I want to allow the player to see farthest depending on the weapon the player carrying. If the player use a sniper, he can see further than an other weapon (I hope you understand, english isn't my mother langage) I've got an other topic Other problems I have, have been resolved. You can try the example in this topic to see more about what I'm trying to achieve
  2. Great ! This is so cool it's all working as I would ! Thanks a lot But what do you mean by Am i using a old version of Phaser ? If yes how can I get the newest version ?
  3. Hi there, Before reading, I want you to know that you can test my little code here : (Arrows to move the player and mousse to aim in a direction) So, I had some problems using the camera.follow (), moveToPointer () and world.scale.set () functions simultaneously. It seems that the world's scaling influence the x and y properties of world's object (like the camera, the input, etc...). To be more specific, I can't use the camera.follow(player), because the player get out from the camera at some point. The only solution I found was to set the x and y camera's values in the update function but now I don't know how I can get a "smooth effect" without using the camera.follow() function. The moveToPointer() method react badly too, the farthest I go, the worst It get, even with game.input.scale.set(). I'll be glad if you can help me to fix the camera and the moveToPointer() methods
  4. I think you can use the body.setSize(width, height, offsetX, offetsetY) method to scale the hitbox and make it smaller. Let's say you have a sprite called player and you want to reduce his hitbox size by 2, you would have something like this: player.body.setSize(player.body.width/2, player.body.height/2, (player.body.width/2)/2, (player.body.height/2)/2); The 2 firsts parameters are for the height and width, the two lasts are for the starter point of the hitbox. If you want to see the hitbox in the game you can use game.debug.body(player); for a sprite called player or walls.forEach(game.debug.body, game.debug); for a group of sprite (like your walls) Hope it can help you
  5. Cool it works well By that do you mean that my world's scaling need to be equal on height and on width ? This is a link to the fixed example :
  6. Hi, I'm currently making a litlle top-down shooter game with Phaser. I'm using the method bellow to aim towards the mouse's position. sprite.rotation = game.physics.arcade.angleToPointer(sprite); This work very well, but I would like to allow the player to zoom in and out. I was following this idea : which use the method; But when I change the world's scaling, the angleToPointer() method is completly lost and it's impossible to aim. You can try this little exemple I've made to understand what goes wrong : Do someone has an idea to fix this? Thanks for you futur help