New answers tagged

0

I just ran into this same issue, except I'm using dynamic layers instead of static layers. I was able to get it working by switching from the createDynamicLayer function to the createBlankDynamicLayer function. I modified your code to reflect what worked for me, try it out: const map = this.make.tilemap({ width: 8, height: 8, tileWidth: 32, tileHeight: 32 }...


0

One solution is to wait (and keep polling) to see whether the texture dimensions have changed. async function() { await new Promise(resolve => { let interval = setInterval(() => { if(texture.orig.width !== 0) { resolve(); } }, 20); }); // do things here, texture is loaded }


2

First we'll want to convert to world coordinates: nozzleAngleWorld = nozzleAngleLocal + shipAngleWorld; // Note here: nozzleAngleLocal is the angle your nozzle is *facing*/thrusting // in your local coordinates, NOT the angle of the line from the center of mass through the nozzle. forceWorld = new Vector2( cos(nozzleAngleWorld) * rocketForce, ...


0

This solution is only a workaround and not what I'm exactly looking for but close. It still pushes the player 1 pixel back if the entity collides with player. Player = PASSIVE, Entities = FIXED


1

You have to scale both the jumpVy and the gravity. Explanation: jumpVy is the (upward) velocity of your character. If we never decrease this your character will fly away. Ok, so we decrease the velocity by using the gravity which pulls your character back to ground. Each iteration the upward velocity gets reduced by the gravity until it gets a downward ...


0

I think its due the gravity. you are changing the value of jump but the gravity remain the same so impact of the gravity on both case is same so i suggest increase the value of the jump and reduce the value of gravity it would do the trick.


0

If you want to be sure they wont miss use save data don't give it to them in any form :) You may give them some key to save stored on for example firebase or playfab that they can recover by entering it or just create authentication mechanism that will connect them to all their data saved in cloud. If you don't really care just give them that JSON. If ...


Top 50 recent answers are included