• Content Count

  • Joined

  • Last visited

About cornstipated

  • Rank

Recent Profile Visitors

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

  1. cornstipated

    Recommended approach in setting collision properties

    If you dont want to use indices there is another way setCollisionByProperty You'll have to add the property to the tile in Tiled
  2. cornstipated

    Update tween END value

    good god just create the tween when you know what value to tween to
  3. You can control roundpixels/antialiasing on a per texture basis by using sprite.texture.setFilter(filtermode) Phaser.Textures.FilterMode.LINEAR or Phaser.Textures.FilterMode.Nearest
  4. cornstipated

    Object Specific Event Handlers

    this.input.on('drop', function (pointer, gameObject, dropZone) { if(gameObject.myondrop) gameObject.myondrop(pointer,dropZone,whatever) });
  5. cornstipated

    How do I call a callback function when two objects stop overlapping?

    it is one way but it is so desperately dependant on phaser. Why not a simple check for distance in the npc update loop
  6. cornstipated

    How to replace arrow keys with wasd movement?

    this.cursors = this.input.keyboard.addKeys( {up:Phaser.Input.Keyboard.KeyCodes.W, down:Phaser.Input.Keyboard.KeyCodes.S, left:Phaser.Input.Keyboard.KeyCodes.A, right:Phaser.Input.Keyboard.KeyCodes.D});
  7. cornstipated

    Destroying a Blitter

    blitter.children.each(function(bob,context){bob.destroy()},this) is a way
  8. the code would definitely help but it might be something as simple as trying to use something you have not loaded yet. IE scene.js references player.js but player.js is loaded after scene.js (the order of the script elements matter)
  9. cornstipated

    Help understanding createContainer

    parent isnt created automatically. If there an element with id parent then createContainer flag will append a properly styled div to it and create the canvas in there. If parent has a bogus value then it will just default to the body element
  10. cornstipated

    Extending GameObjects?

    class MySprite extends Phaser.GameObjects.Sprite { constructor (scene, x, y,myExtra) { super(scene, x, y); this.myExtra = myExtra; this.setTexture('cachedtexturekey'); this.setPosition(x, y); } preload() { } create() { } preUpdate (time, delta) { // do stuff with this.myExtra } } Yes you can example above. Those 3 functions overload function of the baseclass GameObject that are called at various points of the object lifecycle. You could Also overload Sprite specific methods like preUpdate if you needed to. All and all it is just javascript and you can do what you want with it. The extended class istance can be pooled too
  11. cornstipated

    Rotating / changing angular velocity

    physicsenabledgameobject.body.angularVelocity = 100; positive for clockwise, body also has angularDrag for damping, both are in degrees per second
  12. cornstipated

    Killing a Tween

    var tobeinterrupted = this.tweens.add({targets: this.titleGraphic, scaleX: 1, scaleY: 1, duration: 1000, ease: Phaser.Math.Easing.Back.Out}); tobeinterrupted.stop(); This is the controlled way to do it with single tween granularity. Anyhow both your ways should work too you should try better or more specific test cases
  13. cornstipated

    animations object

    this.anims.create({ key: 'open_1', frames: this.anims.generateFrameNames('open1'), repeat: 0 }); this.op1 = this.add.sprite(490, 400).setScale(0.6).play('open_1'); op1.on('animationcomplete', ethis.openComplete, this); op1 no longer block scoped and available as this.op1 in callback since you are passing the this context. Good enough?
  14. cornstipated

    WebGL: too many errors

    there seems to actually be a bug mr davey use graphics and do a generate texture and destroy. The texture gets destroyed in 3.13