From bb34faa035458f96fa4229897615d0a3f8a68b79 Mon Sep 17 00:00:00 2001 From: felixtsu Date: Fri, 28 Aug 2020 16:53:54 +0800 Subject: [PATCH 1/4] speed -> rate should use rate of the followingSprite to calculate maxMomentumDiff --- libs/game/sprite.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/game/sprite.ts b/libs/game/sprite.ts index 9d66bdff5..6736bb18f 100644 --- a/libs/game/sprite.ts +++ b/libs/game/sprite.ts @@ -931,7 +931,7 @@ class Sprite extends sprites.BaseSprite { return; } - const maxMomentumDiff = timeDiff * turnRate * (speed / 50); + const maxMomentumDiff = timeDiff * turnRate * (rate / 50); const angleToTarget = Math.atan2(dy, dx); // to move directly towards target, use this... From 07bedca2ce6561ea914c2b391d59c2d5115641e7 Mon Sep 17 00:00:00 2001 From: felixtsu Date: Wed, 28 Jul 2021 10:02:16 +0800 Subject: [PATCH 2/4] Chinese character support MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Every Chinese character is considered a break character 65292 for period(。) 12290 for comma (,) --- libs/game/textDialogs.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libs/game/textDialogs.ts b/libs/game/textDialogs.ts index d8641cd50..0ff94674b 100644 --- a/libs/game/textDialogs.ts +++ b/libs/game/textDialogs.ts @@ -665,7 +665,10 @@ namespace game { return charCode <= 32 || (charCode >= 58 && charCode <= 64) || (charCode >= 91 && charCode <= 96) || - (charCode >= 123 && charCode <= 126); + (charCode >= 123 && charCode <= 126) || + (charCode >= 19968 && charCode <= 40869) || + charCode == 12290 || + charCode == 65292; } function breakIntoPages(text: string, lineLengths: number[]): string[][] { From 0cb099a86f6be90135a519086f3a38666a9c3c53 Mon Sep 17 00:00:00 2001 From: felixtsu Date: Sun, 19 Jun 2022 10:03:20 +0800 Subject: [PATCH 3/4] fix https://github.com/microsoft/pxt-arcade/issues/4819 --- libs/game/physics.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libs/game/physics.ts b/libs/game/physics.ts index abcff98c6..85873bb43 100644 --- a/libs/game/physics.ts +++ b/libs/game/physics.ts @@ -596,6 +596,8 @@ class ArcadePhysicsEngine extends PhysicsEngine { protected tilemapOverlaps(sprite: Sprite, overlappedTiles: tiles.Location[]) { const alreadyHandled: tiles.Location[] = []; + let currentTileMap = game.currentScene().tileMap + for (const tile of overlappedTiles) { if (alreadyHandled.some(l => l.column === tile.column && l.row === tile.row)) { continue; @@ -605,12 +607,13 @@ class ArcadePhysicsEngine extends PhysicsEngine { const tileOverlapHandlers = game.currentScene().tileOverlapHandlers; if (tileOverlapHandlers) { tileOverlapHandlers - .filter(h => h.spriteKind == sprite.kind() && h.tileKind.equals(tiles.getTileImage(tile))) + .filter(h => h.spriteKind == sprite.kind() && h.tileKind.equals(currentTileMap.getTileImage(tile))) .forEach(h => h.handler(sprite, tile)); } } } + /** * Returns sprites that overlap with the given sprite. If type is non-zero, also filter by type. * @param sprite From 549d91b2c16517aa5eeb3a5e588fe56c0b17cb0d Mon Sep 17 00:00:00 2001 From: felixtsu Date: Sun, 19 Jun 2022 10:19:26 +0800 Subject: [PATCH 4/4] fix https://github.com/microsoft/pxt-arcade/issues/4819 --- libs/game/physics.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/game/physics.ts b/libs/game/physics.ts index 85873bb43..925491739 100644 --- a/libs/game/physics.ts +++ b/libs/game/physics.ts @@ -607,7 +607,7 @@ class ArcadePhysicsEngine extends PhysicsEngine { const tileOverlapHandlers = game.currentScene().tileOverlapHandlers; if (tileOverlapHandlers) { tileOverlapHandlers - .filter(h => h.spriteKind == sprite.kind() && h.tileKind.equals(currentTileMap.getTileImage(tile))) + .filter(h => h.spriteKind == sprite.kind() && h.tileKind.equals(currentTileMap.getTileImage(tile.tileSet))) .forEach(h => h.handler(sprite, tile)); } }