Restore soft island collision
This commit is contained in:
parent
37509b6f50
commit
f3eb0dfaaf
@ -206,8 +206,7 @@ class GameScene extends Phaser.Scene {
|
||||
obstacle.body.setCircle(island.radius);
|
||||
|
||||
this.physics.add.collider(this.player, obstacle, () => {
|
||||
this.playerSpeed = 0;
|
||||
this.player.setVelocity(0, 0);
|
||||
this.playerSpeed *= 0.7;
|
||||
});
|
||||
this.physics.add.collider(this.pirates, obstacle);
|
||||
this.physics.add.overlap(
|
||||
|
||||
@ -230,7 +230,7 @@ test('player propulsion smoke emits at world engine positions with per-particle
|
||||
assert.doesNotMatch(source, /this\.playerSmoke\.setParticleSpeed\(/);
|
||||
});
|
||||
|
||||
test('environment physics adds wind, hard island collision, turbulence, and projectile interaction', async () => {
|
||||
test('environment physics adds wind, soft island collision, turbulence, and projectile interaction', async () => {
|
||||
const source = await read('src/game-v4.js');
|
||||
|
||||
assert.match(source, /ENVIRONMENT_ISLANDS/);
|
||||
@ -239,7 +239,7 @@ test('environment physics adds wind, hard island collision, turbulence, and proj
|
||||
assert.match(source, /this\.createEnvironmentPhysics\(\)/);
|
||||
assert.match(source, /this\.physics\.add\.staticImage/);
|
||||
assert.match(source, /obstacle\.body\.setCircle\(island\.radius\)/);
|
||||
assert.match(source, /this\.physics\.add\.collider\(this\.player, obstacle, \(\) => \{[\s\S]*?this\.playerSpeed = 0;[\s\S]*?this\.player\.setVelocity\(0, 0\);/);
|
||||
assert.match(source, /this\.physics\.add\.collider\(this\.player, obstacle, \(\) => \{[\s\S]*?this\.playerSpeed \*= 0\.7;/);
|
||||
assert.match(source, /this\.physics\.add\.collider\(this\.pirates, obstacle\)/);
|
||||
assert.match(source, /this\.physics\.add\.overlap\(\s*this\.playerShots,[\s\S]*?this\.hitEnvironmentProjectile/);
|
||||
assert.match(source, /this\.environmentWind = environmentWindAt\(\{/);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user