• Content Count

  • Joined

  • Last visited

About rafaholiveira

  • Rank

Contact Methods

  • Website URL

Profile Information

  • Gender
  • Location
  1. From the docs: "setResizeCallback(callback, context) Sets the callback that will be invoked before sizing calculations. This is the appropriate place to call setUserScale if needing custom dynamic scaling." Maybe there is a bug?
  2. Is there a way to set a scale factor in ScaleManager.RESIZE, so all objects are created with that scale? I tried to scale the camera, but I need to calc a new size of the camera to view all visible area of the canvas, but my calc are wrong, because the new size isn't covering everything. This is my calc basically (the code is in haxe, but is similiar to javascript): get the scale factor: public function getScaleFactor(stage:Stage):Float{ var ratioX = stage.width / 420; var ratioY = stage.height / 630; return Math.min(ratioX, ratioY);}scaling the camera: public function scaleCamera(world:World, camera:Camera, scaleFactor:Float):Point{ var size = new Point(camera.width, camera.height); camera.scale.set(scaleFactor, scaleFactor); var sizeScaled = new Point(size.x * scaleFactor, size.y * scaleFactor); var diff = new Point(size.x - sizeScaled.x, size.y - sizeScaled.y); camera.setSize(camera.width + diff.x, camera.height + diff.y); world.resize(camera.width, camera.height); return diff;}With these function I do in the boot state: var scaleFactor = getScaleFactor(stage); var diff = scaleCamera(game.world, camera, scaleFactor);Main.width = game.width + diff.x;Main.height = game.height + diff.y;the variables Main.width and Main.height should have the dimension of the canvas (to position things), but isn't covering everything. I think should have a easy way to set the scale in RESIZE.
  3. I have two basic android devices here, that aren't loading the game, so I was hoping this was webgl.. but I forget to check the images..
  4. I always heard we have to use Canvas fallback in html5 mobile, but then I saw this game in softgames: http://games.softgames.de/road-crossing/?locale=pt&p=m.softgames.de by the way, it looks "almost" exactly as Crossy Road for ios and android, but a closer look and we see that is different. The point here, is that for the look it seems to use webgl (or could be a well made game in 2d). I have a basic android from LG that didn't load, I'd like other people testing in devices that don't support webgl to check if this is really using only webgl.
  5. I opened a issue. https://github.com/photonstorm/phaser/issues/388
  6. For repeated sprites you can use TileSprites, but if the sprites will not change, I think the best option is tilemaps.
  7. I confirm that Tile.setCollision( left, right, up, down) is not working.
  8. With Phaser 1.1.4, how I set up wich sides of a tile will collide in tilemaps?
  9. Phaser.Tileset.getTile uses this.tiles[index], but there is no variable tiles in Tileset. I was trying to set the collision of the faces of the tiles, but Tileset.getTile shows undefined for tiles.
  10. A easy way of change phaser.d.ts, is do a right-click in the class, and choose go to definition. Then check the definition in http://gametest.mobi/phaser/docs/ and put in the end of the class. Some properties of Sprite are inherited from Pixi DisplayObject, like Alpha. In this case I put directly in the Sprite class, for my use. But maybe for the repo this is not the best way.
  11. You can edit phaser.d.ts manually, and include the missing definitions. I have a list of things to include/change, but I need to review first before send to the Repo.
  12. I liked it but I would prefer the movement buttons on a dpad in the bottom side. That way I could play without moving my hand. Could only show possible moves, as shown in the character.
  13. After setting body.drag for a sprite, the sprite changes body.facing many times before stop. Test (the animation for left and right changes with body.facing): http://rafaholiveira.com.br/test-drag/ here is my code: var game = new Phaser.Game(800, 600, Phaser.AUTO, "gameContainer", { preload: preload, create: create, update: update });var quad = null;function preload() { game.load.spritesheet('quad_spsheet', "quad.png", 50, 50);}function create() { quad = game.add.sprite(200, 200, "quad_spsheet"); quad.animations.add("right_anim", [0]); quad.animations.add("left_anim", [1]); quad.body.maxVelocity.x = 250;} function update(){ quad.body.acceleration.x = 0; quad.body.drag.x = 250; if (game.input.keyboard.isDown(Phaser.Keyboard.LEFT)) { quad.body.acceleration.x = -150; } else if (game.input.keyboard.isDown(Phaser.Keyboard.RIGHT)) { quad.body.acceleration.x = 150; } if (quad.body.facing == Phaser.LEFT) quad.animations.play("left_anim"); else if (quad.body.facing == Phaser.RIGHT) quad.animations.play("right_anim");}