Pedro Alpera

Members
  • Content Count

    89
  • Joined

  • Last visited

About Pedro Alpera

  • Rank
    Advanced Member

Contact Methods

  • Website URL
    http://blog.pedroalpera.com
  • Twitter
    PedroAlpera

Profile Information

  • Gender
    Male
  1. Hi, I have started a little project about small games. You can download the source code, first one is a jigsaw puzzle. http://theusualsuspects.pedroalpera.com
  2. I have seen this post about it: http://www.html5gamedevs.com/topic/8546-phaser-using-overlap-with-two-sprites/?hl=overlap Also you could use something like this: http://docs.phaser.io/Phaser.Physics.Arcade.html#distanceBetween distanceToPointer(displayObject, pointer) → {number} Find the distance between two display objects (like Sprites).
  3. Look this template: https://github.com/photonstorm/phaser/tree/master/resources/Project%20Templates/Full%20Screen%20Mobile
  4. Does Phaser support multipack Texture Packer feature? Could I make an animation using multiple images (different files)? Thanks!
  5. Have you tried this example? http://examples.phaser.io/_site/view_full.html?d=input&f=drag.js&t=drag
  6. Look the Project Templates: https://github.com/photonstorm/phaser/tree/master/resources/Project%20Templates I think "Full Screen Mobile" is the one you are looking for.
  7. Look this tutorial: http://www.photonstorm.com/phaser/tutorial-making-your-first-phaser-game This part: // Allow the player to jump if they are touching the ground. if (cursors.up.isDown && player.body.touching.down) { player.body.velocity.y = -350; }
  8. Look this example: http://examples.phaser.io/_site/view_full.html?d=basics&f=06+-+render+text.js&t=06%20-%20render%20text&jsbin=http://jsbin.com/zagob/11/edit?js,output
  9. I have made this example: http://pedroalpera.com/phaser/playground/map_example/ The files are attached to this file, it´s just a rough sketch. map_example.zip
  10. Why not drag a normal sprite and use a mask?
  11. Third option, a layer for graphics and a layer for sprites : More info: http://examples.phaser.io/_site/view_full.html?d=groups&f=group+as+layer.js&t=group%20as%20layer window.onload = function () { var game = new Phaser.Game(800, 600, Phaser.AUTO, 'phaser-example', { preload: preload, create: create, update: update}); var spritesLayer; function preload() { game.load.image('sprite', 'assets/yeoman-logo.png', 17, 17); } function create() { spritesLayer = game.add.group(); spritesLayer.z = 0; graphicsLayer = game.add.group(); graphicsLayer.z = 1; timer = game.time.events.loop(1500, addSprite, this); var graphics = game.add.graphics(0, 0); graphics.beginFill(0xFFFF0B); graphics.drawRect(0, 0, 500, 70); graphics.endFill(); graphicsLayer.add(graphics); } function addSprite () { var sprite = new Phaser.Sprite(game, 20, 30, 'sprite'); spritesLayer.add(sprite); } function update() { }};
  12. Other option could be a container group for the sprites, so you can draw first the group, and then draw the graphic. window.onload = function () { var game = new Phaser.Game(800, 600, Phaser.AUTO, 'phaser-example', { preload: preload, create: create, update: update}); var spritesLayer; function preload() { game.load.image('sprite', 'assets/yeoman-logo.png', 17, 17); } function create() { spritesLayer = game.add.group(); spritesLayer.z = 0; timer = game.time.events.loop(1500, addSprite, this); var graphics = game.add.graphics(0, 0); graphics.beginFill(0xFFFF0B); graphics.drawRect(0, 0, 500, 70); graphics.endFill(); } function addSprite () { var sprite = new Phaser.Sprite(game, 20, 30, 'sprite'); spritesLayer.add(sprite); } function update() { }};
  13. Something like this?: function addSprite () { sprite= game.add.sprite(20, 30, 'sprite'); var graphics = game.add.graphics(0, 0); graphics.beginFill(0xFFFF0B); graphics.drawRect(0, 0, 500, 70); graphics.endFill(); }