• Content count

  • Joined

  • Last visited

About SamTheMighty

  • Rank
    Advanced Member

Contact Methods

  • Website URL
  • Twitter

Profile Information

  • Gender
  • Location
    NRW, Germany

Recent Profile Visitors

1,459 profile views
  1. SamTheMighty

    Shader/Filter displacement in Phaser 3

    @flahhi hey, sorry for the late reply. No I did not find a solution. In fact you can convert the displacement filter but since p3 is build differently to p2; it does nit work- it will render the shader only on objects that are part of the pupeline. The result is that every sprite has it‘s own replacement filter and not the game world. I did not get it working.
  2. I am re-writing this one... thought it was solved but it is not. There is an typescript mismatch between the Phaser3 ts definitions and a body of Phaser.Physics.Arcade.Body. >body< is only defined as an object. So I get typescript errors for using: onFloor(); onCeiling(); setVelocity; etc. etc. for every method which should be available. This can be found in the docs: 1. I enable physics for the sprite 2. run this in a JS file to disable ts. (tested, working, with all methods) 3. run it in ts, I get an error: That <any body method> is not available in type "object". It's not that certain line, but somewere the track of the physics body definition is broken on typescript. (updated docs, ts, phaser to newest version) /** * If this Game Object is enabled for physics then this property will contain a reference to a Physics Body. */ body: object; I don't know how to address this "bug", since it should be fixed in the live code which is automatically generated by the phaser docs repo. And I am not experienced enough in the build process of the docs. maybe someone can look after this and tell me how to. regards
  3. SamTheMighty

    Are particles broken in latest CE? [Done]

    Done. My fault, didn't see amount still passing into start this.start(false, 100, 150, amount);
  4. SamTheMighty

    Call a function in Phaser from external HTML

    As Fenoliù said You can call JS functions everywhere in Phaser if they were defined global and executed before your phaser game runs. if you got a Phaser.Button and have a click event on it, just call a method like: myButtonClickMethod() { login(); } if your "login" function is available, it will execute it. greetings.
  5. ANSWERED Hi, By updating the phaser 2.x version I stumbled upon >all particles are broken<. this is the extended Phaser.Particles.Arcade.Emitter class: as line7>> "this.start(false <- should revive a particle at the emitters position after "lifetime". it just doesn't do anything. All particles are done once, and they do not repeat themselves anymore. Was there a breaking change I did not get? note: The v2.7.x gravity change is not the case here constructor (config: any, amount: number = 10) { super (, config.x, config.y, amount); config.level.layers.effects.add(this); this.setYSpeed(-20, -200); this.setXSpeed(-5, 5); this.makeParticles('assets', 52); this.start(false, 100, 150, amount); //this should revive particles after lifespan(2), but doesn't console.log(this.children); } Any thoughts? regards
  6. SamTheMighty

    A Creeping Death, Fading, light effects, etc

    Hey there, I do not know if the lighting stuff is implemented in the current phaser version; I am a bit out of date on the updates. But what you can do is this: You can write your own "shadowsystem". But this may take a hit on performance. So if you are doing an pixelart game it would be fine, for higher graphics styles like vector and stuff.. it may be too intense. regards
  7. Is there already a way to make a displacement filter in p3? something like that: would like to use it for explosions (shockwave effect) any idears on implementing this effect into p3.? regards
  8. Hi There, I use Arcade physics on Phaser3. And I got multiple moveable bodies which stick on top of each other. For two bodies this works, the third does sink a bit into the second and the forth makes the whole stack collapse and fall through the bodies. (example image attached) (edit) Note: Bodies are not falling through static sprites, the described behavior does only apply to dynamic bodies. I would prefer a "not checking" for weight, - setting velocity Y to 0 on collision does inflict many more problems. So this won't solve the issue. I set the OverlapBias on the Arcade physics to 20 (code below) to prevent bodies with high gravity falling through static sprites. The Y gravity is set to 2000, decreasing this amount does not solve the issue and the gravity amount is needed. arcade: { gravity: {x: 0, y: 2000}, debug: true, overlapBias: 20 } What I came around was thinking to set the weight or mass so that the sprites don't "sink" into each others body. Even tho if a body is falling on onto two bodies which are on top of each other, they complete break and fall through. Does anyone have an idea how to fix this?
  9. A general Question regarding groups / collisiongroups. Or Arcade sprites itself. I got a group of sprites "Minion" and the "level" collision group. 1. The Minions should collide with all sides:( left, up, right, down) with the levelgroup. 2. But for "Minion" vs "Minion" they should only collide top. By setting "checkCollision" I disable the collision with the level-group. Is there an easy way to archieve this behavior?
  10. SamTheMighty

    Arcade.Body : body.blocked (any) is always false

    @samme thanks for clarifying this helped me.
  11. Hey there, I am still struggling a lot with Phaser3 due to the documentation is still in work. I made two simple sprites, that collide, what I experience is that >body.blocked.down< nor the other properties (left, right, top) ever change. They are always: false. No matter if a collision happens or not. A bit of code: //These are the arcade configs: physics: { default: 'arcade', arcade: { gravity: {x: 0, y: 2000}, debug: true, overlapBias: 20 } } //TileA this.plat = this.physics.add.sprite(400, 1100, 'platform'); this.plat.displayWidth = 500; this.plat.body.allowGravity = false; this.plat.body.immovable = true; //TileB is a custom class which just extends this.physics.add.sprite this.minion = new tileB(this, 500, 200); //collision works well with:, this.minion); However, the body.blocked property is logged in my update of the custom (tileB) class - and it is always false. No matter if it's colliding. Here is the code of the tileB class: class tileB extends Phaser.Physics.Arcade.Sprite { constructor(config) { super(config.scene, config.x, config.y, 'minion');; this.scene.add.existing(this); this.scene.layers.minions.add(this); this.controls = this.scene.input.keyboard.createCursorKeys(); //write controls class this.alive = true; this.body.maxVelocity.y = 1500; this.body.setSize(50, 100, false); this.body.setOffset(80, 60);'update', this.update, this); } update() { if( { console.log(this.body.blocked.down) if (this.controls.left.isDown) { this.setVelocityX(-200);'left', true); } else if (this.controls.right.isDown) { this.setVelocityX(200);'right', true); } else { this.setVelocityX(0);'turn'); } if (this.controls.up.isDown && this.body.blocked.down) { this.setVelocityY(-200); } } } } I have looked into the super mario example by @nkholski as he used body.blocked.down too. I had a hard time to find the point I am missing. Would be glad if someone helped me out nkholski's platformer boilerplate: Thanks in advance
  12. SamTheMighty

    [Arcade] body / velocity messed up by update to new Phaser version

    You are right. Thanks for the solution and shame on me for overseeing it. I did not know that setting the property on the collision sprites had such an impact. Thanks a lot! Issue solved.
  13. SamTheMighty

    [Arcade] body / velocity messed up by update to new Phaser version

    Hi, thanks for looking into this. Here's the pen: It's reproducible. (use left / right arrow keys). Seems like velocity x isn't just velocity x. I upgraded from 2.6.2 regards
  14. I just upgraded to Phaser 2.9.3, since then I get a strange behavior. 1. I press Left / Right to change the Sprite's velocity (x). // See update method 2. Sprite has enabled Physics, World.gravity is 2000 // See in create method 3. But the Sprite instead of moving left (negative velocity.x) moves upwards // See attached gif What I figured out till yet: - velocity.y turn to NaN by colliding with a collisionGroup . - velocity.y stays NaN, even if the character moves into the air. (whyever it moves into air..) There is nothing else going on. I tested this as a test-case, not inside my game, to be sure I'm not messing something up. create method: super(, x, y, 'minions'); this.level = state; this.anchor.setTo(0.5);;; this.body.bounce.set(0.5); this.body.setSize(45, 110, 80, 45) update method: if(this.controls.on("left")) { this.body.velocity.x = -500;'walk'); } else if(this.controls.on("right")) { this.body.velocity.x = 500;'walk'); } Anyone have a clue why this happens? Thanks in advance.