samme

Members
  • Content count

    1,083
  • Joined

  • Last visited

  • Days Won

    9

samme last won the day on September 21

samme had the most liked content!

About samme

  • Rank
    Advanced Member

Contact Methods

  • Website URL
    https://github.com/samme

Profile Information

  1. Collisions not working when using Phaser & webpack

    Fixed in phaser-ce/releases/tag/v2.8.8.
  2. bug with setTextBounds with anchor and scale

    I think setTextBounds is intended to work without altering the object's position. Thus pivot. And the pivot is updated when the text content changes to keep it aligned within the bounds (see example below). If you just need to position the text relative to a box, you're correct that it's much simpler. You can probably just use label.alignIn({x: 0, y: 0, width: 200, height: 100}, Phaser.CENTER);
  3. Sprites with separate collision regions?

    Arcade.Body#setSize, examples/v2/arcade-physics/offset-bounding-box Use dummy sprites as children. There are a few, check the Geometry classes. You could apply your own in the filterCallback or collideCallback arguments to collide/overlap. Phaser.Physics.Arcade#skipQuadTree
  4. Another webfont loader

    I haven't seen another example like this so I thought I would share. This method uses a dedicated state for loading the webfont and then moves to the next state once complete (or failed). For me this is a little easier to reason about.
  5. Simple states example

    There is only one file/script. The states are simple objects (no prototype). Three states: Boot, Menu, Game. You move through them with Start, Restart, and Quit. Fun features: Loading bar with setPreloadSprite loadUpdate, loadRender, pause, render, and shutdown callbacks Logs state changes with onStateChange signal so you can see what's happening
  6. Nightmare with Particle Storm & sprites

    You would create, move, and collide your bullet sprites as usual, then emit particles at their positions. examples/v2/particlestorm/mouse-trail
  7. How to add things to cache and restore

    I haven't tried it but I think it would be something like let baseImg = this.make.image(0, 0, 'tempcity'); let bitmap = this.make.bitmapData(baseImg.width, baseImg.height); baseImg.tint = tint; bitmap.draw(baseImg); bitmap.generateTexture(name, function (texture) { let sprite = this.add.sprite(0, 0, texture); }, this); I'm really not sure it's worth the trouble though, unless you're sure that tinting is slowing things down.
  8. Tilemap issue

    Can you add after map = game.add.tilemap(…); console.log('map.tilesets', map.tilesets);
  9. My image will not load

    http://phaser.io/tutorials/getting-started
  10. Can you just add one callback and then treat the different sprites/groups differently?
  11. Game cycle, FPS and optomisation

    Phaser makes exactly one render for every animation frame it receives from the browser. Usually that's 60 renders/s. You can skip renders by turning on lockRender. When forceSingleUpdate is on, Phaser makes exactly one logic update per animation frame. When forceSingleUpdate is off, Phaser tries to make the number of logic updates required to match desiredFps. You can monitor suggestedFps and adjust desiredFps if you like.
  12. Can't play animations

    Set the loop parameter to false in any case. Try this.game.debug.key(this.Q, /* … */);
  13. How to create score modifier based on overlap?

    Here is one way. I have "good" and "bad" zones but the concept is the same.
  14. Game freezes when you click outside of canvas

    Phaser.Stage#disableVisibilityChange
  15. how to access my assets in jsdeliver

    If you make a GitHub repository you can use https://cdn.jsdelivr.net/gh/USERNAME/REPONAME/