Jump to content

misfit

Members
  • Content Count

    8
  • Joined

  • Last visited

About misfit

  • Rank
    Newbie

Recent Profile Visitors

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

  1. Hi, I hope I have titled this question correctly. I would like to know how to check that this.load.on has ' progress' or 'complete' or any other event that I can use if I need to ( or any other object in Phaser 3). Is there a way to check it? Thanks!
  2. misfit

    checkWorldBounds

    Hi, I had some trouble with checkworldbounds as well. I would suggest that you just create a new gameObject collider outside the camera bounds ( or group of them if you need to check all bounds) and check collision with it. Hope it will help. this.bottom_collider = new Phaser.Physics.Arcade.Sprite(this,0,this.cameras.main.height,).setOrigin(0, 0); //no idea if it is necessary this.bottom_collider.width = this.cameras.main.width; //add to scene this.add.existing(this.bottom_collider); //add to physics this.physics.add.existing(this.bottom_collider,true);
  3. So i want to add listener to when the sprite goes out of bounds of the screen. It doesn't seem to fire up. Am I missing something? I saw a post here about this but it uses this.physics.world.on("worldbounds".. but isn't there a way to encapsulate the listener inside a new Sprite child class? Btw is there a list of events i can listen to? Thanks! class Meteor extends Phaser.Physics.Arcade.Sprite{ constructor(scene,x,y,key_texture,frame){ super(scene,x,y,key_texture,frame); this.scene = scene; this.scene.addToWorld(this); this.scene.physics.add.existing(this,false)
  4. Hi, I have been going through a tutorial on recreating FruitNinja (unimportant maybe). I am a beginner in JS with experiance in Java. I need some help or reference where to get it - I have 2 states like this: var FruitNinja = FruitNinja || {}; FruitNinja.JSONLevelState = function () { "use strict"; Phaser.State.call(this); }; FruitNinja.JSONLevelState.prototype = Object.create(Phaser.State.prototype); FruitNinja.JSONLevelState.prototype.constructor = FruitNinja.JSONLevelState; (...) FruitNinja.JSONLevelState.prototype.create = function () { this.create_prefab(prefab_name, t
  5. Hello, I have been using phaser 2.6.2 and this emitter worked fine: var emitter = this.game.add.emitter(hitMeteor.body.x+hitMeteor.body.width/2, hitMeteor.body.y+hitMeteor.body.height/2, 6); emitter.makeParticles('meteorPiece'); emitter.minParticleSpeed.setTo(hitMeteor.body.width/2,-hitMeteor.body.height/2); emitter.maxParticleSpeed.setTo(70,hitMeteor.body.height/2); emitter.gravity = 0; emitter.start(true,1000,null,100); Today I have copied a new version (phaser 2.7.3) and the particles just stay in place rotating like their speed was equa
  6. Hello, I have recently started using Phaser too. If you are familiar with Udemy.com learning site there is a free Phaser video tutorial that covers all the basics. There are also many examples like https://phaser.io/examples/v2/sprites/out-of-bounds showing how to spawn/respawn enemies outside the screen and many more. There you can find basic solutions for many ideas for your game. Good luck!
  7. Hello, I want to move group of sprites toward the player: var goBack = this.game.add.tween(this.pullGroup); goBack.to({x: this.player.world.x,y: this.player.world.y},2000); goBack.start(); But it seems that the group treats coordinates x, y as starting from group (like it has its own coordinate system) and not from Canvas' (0,0). How to make the tween movement work with world coordinate system and not in group (0,0)? Thanks for help, Edit #1 Ok I have overcome this problem by dividing player.x - child[0].x and the same for y.
  8. Hi I have a similar problem. My game uses: buildEmitter: function(){ this.burst = this.add.emitter(0, 0, 80); this.burst.minParticleScale = 0.3; this.burst.maxParticleScale = 1.2; this.burst.minParticleSpeed.setTo(-30, 30); this.burst.maxParticleSpeed.setTo(30,-30); //this.burst.maxParticles = 80; this.burst.makeParticles('explosion',0,20,true,false); this.input.onDown.add(this.fireBurst, this); }, fireBurst: function(pointer){ //passing input this.burst.emitX = pointer.x; //do emitting in coords of the pointer (finger) this.b
×
×
  • Create New...