• Content Count

  • Joined

  • Last visited

About nandobtz

  • Rank

Recent Profile Visitors

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

  1. It worked graciously! Thanks a lot Flow! Much appreciated!
  2. I've been trying for HOURS. It seems that the player isn't responding to the game.physics.p2.setBounds. I know it's asking a lot but would you be able to look at the code and tell me if you see anything that could be blocking it? You'd find it under Game.create = function You can see this modified version of the game here: game.physics.p2.enable(player) is under Game.Cplayer = function Should it be under the 'create' function? I've tried it but it didn't work.
  3. That's exactly what I need (besides the broken left bound). I'm still not sure why I can't implement it into my game. Grr. Frustrating. Please let me know when you figure the broken left side. Thanks!
  4. Hey Flow, do you happen to have a codepen for your code? I'd like to see it working live. Thanks
  5. Here's the complete piece of code inside the Create Function: Game.create = function () { this.time.advancedTiming=true; Game.playerMap = {}; deadland = game.add.tileSprite(world.x1 - 1200, world.y1 - 1200, world.x2*2, world.y2*2, 'deadland');; land = game.add.tileSprite(world.x1, world.y1, world.x2, world.y2, 'earth'); land.fixedToCamera = false; land.boundsPadding = 100;; // Enable p2 physics game.physics.startSystem(Phaser.Physics.P2JS); - 1200, world.y1 - 1200, world.x2*2, world.y2*2); deadland.alpha = 0.7; land.alpha = 1; game.physics.p2.setBounds(world.x1, world.y1, world.x2, world.y2); game.physics.p2.gravity.y = 0; game.physics.p2.gravity.x = 0; = 1;; this.stage.disableVisibilityChange = true; rest of the code... And here's the game live, if that helps:
  6. I've tried with game.physics.p2.setBounds(world.x1, world.y1, world.x2, world.y2); and game.physics.arcade.setBounds(world.x1, world.y1, world.x2, world.y2); I've tried with number as well. None of them seem to work. Player still goes to the darker area.
  7. My idea is to do like most multiplayer .io games do when the player reaches the boundaries. You can't go to the darker area., for example: Notice that the player always stays centered because of that extra area. The 'deadland' tileSprite, in my case, would be the darker area. I can do it without this deadland sprite, but the darker area would be a black background instead: The player can go there anyway. I need it to stop at the game world (lighter area)
  8. My goal is to make the player stay centered on the canvas at all times, even when he reaches the boundaries of the world. This is how it is now: And I've modified the code to be like this: deadland = game.add.tileSprite(world.x1 - 1200, world.y1 - 1200, world.x2*2, world.y2*2, 'deadland'); land = game.add.tileSprite(world.x1, world.y1, world.x2, world.y2, 'earth'); land.fixedToCamera = false; land.boundsPadding = 100; -1200, world.y1 -1200, world.x2*2, world.y2*2); game.physics.startSystem(Phaser.Physics.P2JS); deadland.alpha = 0.7; land.alpha = 1; But now the player isn't stopping at the 'earth' size bounds. He goes all the way to the 'deadzone': How do I do it so the player won't go beyond the 'earth' bounds? Thanks!
  9. I'm using phaser ce v2.10.1. Not sure if it makes any difference. It worked fine for me.
  10. Yes, it is a multiplayer game, kind of like agario and diepio. You can check it at (you won't see any players there because I haven't advertised it yet. Still in beta testing) If you want to check the multiplayer factor, I'd suggest you to open the game in 2 tabs or 2 different browsers. If you have a pretty good PC, you won't see any different in the move speed. But you can try to open the game in many tabs until your PC slows down. Then you will notice that move speed difference.
  11. I'm aware that the client's computer GPU might affect the game's performance (smoothness and freezing). But the game I'm creating now is being affected differently. The client's GPU is literally affecting his player movement speed globally (even on the other player's views, not only locally for him). If you check other .io games like and, even with a slow computer, you will notice that the player movement speed is is the same (based on the same player level). It skips a few frames and it isn't smooth at all. But the movement speed is the same. Every player on my game needs to have the same movement speed (that's one of the most important features of my game). I've also noticed that if I'm using the maximized window, the game slows down. But if I use like half browser screen, it comes back to being fast again: It wasn't supposed to happen. If you need further information from me, please let me know. Please help. Thanks in advance.
  12. Wonderful, wonderful! I was able to implement it perfectly. Now that's exactly what I needed. The only thing I changed was the "var scale = Math.max(1, Math.max(scaleX, scaleY));" to var scale = Math.max(0.5, Math.max(scaleX, scaleY)); so players with smaller screen will have a similar view to bigger screen (not cut out). Thank you again, Samme. You're a savior!
  13. That's almost it, yes! Thank you samme! I will try to implement it and let you know how it goes. EDIT: The only thing I noticed that doesn't fit with what I need is the WIDTH. On your pen, the height fills the screen. But the width doesn't fill the screen (see black bars on the left and right side). Any way to fix that too?
  14. Noob here using Phaser. But here's my issue: I'm struggling to get to a perfect scale on the game I'm building. The best option for me so far is Phaser.ScaleManager.RESIZE; But this method doesn't have a limit to the canvas size. If an user has a huge screen, say 30 inches, he'd have a lot of advantage over an user with a medium size screen, say 17 inches. The 30 inches user would have much more view of the world. I've tried to set the canvas to a fixed size, like 1280x720, then dynamically resize the canvas style. And using Phaser.ScaleManager.SHOW_ALL; But it doesn't do the trick because it shows the black borders and I can't get rid of it. To make it clear what I want to achieve, I'm building an online multiplayer game (.io). If you notice the most famous .io games like, and, the game scale is perfect for any screen size. If the screen is too big, the game doesn't show more screen. It just adjusts for a more zoomed game. Here's a gif of what I need and how my game is now: Notice that in agario, the screen only goes so far before the game starts to scale. My game: Notice how much of the world I can see after scaling my game. Meaning that there is no limit for the canvas. Please let me know if you need more information in order to help me out here! Thanks in advance!