samme

Members
  • Content count

    1,470
  • Joined

  • Last visited

  • Days Won

    12

samme last won the day on October 22 2017

samme had the most liked content!

About samme

  • Rank
    Advanced Member

Contact Methods

  • Website URL
    https://github.com/samme
  1. phaser-track: follow things automatically

    See the README and example code.
  2. too many draws, need some help

    I think you would have to use a SpriteBatch (or just ordinary Sprites) to take advantage of WebGL batch drawing.
  3. Error when adding sounds with phaser

    Try window.PhaserGlobal = { disableWebAudio: true }; // new Phaser.Game(…) This works fine in my Chrome and Safari. You could also use Data URLs (although they will be huge). See the notes in https://photonstorm.github.io/phaser-ce/Phaser.Loader.html#audio.
  4. Sprite bounds do not update if sprite is invisible

    This is intentional, although surprising. You can use sprite.renderable = false or sprite.alpha = 0
  5. Please use game.debug.pointer(game.input.activePointer); to verify where Phaser is placing it.
  6. Multiple problems with my phaser-project

    @Arnon could you put the whole project on GitHub, or attach a zip file?
  7. Another scale problem with collisions

    If you're using tilemaps, you have to use TilemapLayer#setScale to scale the collision edges correctly. If you're using Arcade Physics, you have to avoid scaling Groups (or World) and instead scale every sprite individually. But the simplest way is to avoid all of that and just use scaleMode SHOW_ALL etc.
  8. Create a pane of sprites?

    A Group works well as a "layer" for this.
  9. Ticking time bomb in a game

    game.time.events.add(2000, /* … */);
  10. Create objects in groups - Need to be sprites?

    Oh, if you don't use Sprites, you can't use Groups either. Array still has a few useful methods, like forEach and map. Utility libraries like underscore and lodash provide more helpers. Here is underscore (findWhere): var current_player = _.findWhere(players, {name: 'Sally'}); But if you're often looking up players by name, you might just index them that way instead: game.players = { Sally: { color: 'green', score: 0 }, Ana: { color: 'blue', score: 0 }, // […] }; In that case you'd probably want to add a utility library, since Object has few useful iterators built in. Nonetheless, if you're familiar with the Group methods, there's really no harm in using them instead (and don't worry about the invisible sprites). Or is there some sprite you could associate with each player? Game markers?
  11. Create objects in groups - Need to be sprites?

    If you're making things that will never be displayed or positioned at all, you probably don't need to use sprites. game.players = []; game.players.push({ name: 'Sally', color: 'green, score: 0, });
  12. OK, my first snippet was over-contrived, all you actually need is game.plugins.add({ render: function () { var game = this.game; var debug = game.debug; debug.text('Scale: ' + game.scale.width + ' x ' + game.scale.height, 16, 224, 'yellow', debug.font); debug.pointer(game.input.activePointer); } }); Try adding <meta name="viewport" content="initial-scale=1">