Improve handpainted battle unit readability

This commit is contained in:
2026-06-30 22:18:34 +09:00
parent 6eb3f029c3
commit 3092b295e6
101 changed files with 1405 additions and 16 deletions

View File

@@ -7,7 +7,6 @@ const unitWalkFrameCount = 8;
export const unitBaseFramesPerDirection = unitIdleFrameCount + unitWalkFrameCount;
export const unitSheetFrameSize = 313;
const unitWalkFrameRate = 10;
const unitIdleFrameRate = 5;
const unitSheetRows: Record<UnitDirection, number> = {
south: 0,
east: 1,
@@ -99,10 +98,12 @@ export function ensureUnitAnimations(scene: Phaser.Scene, keys: Iterable<string>
key,
frame: unitSheetRows[direction] * unitBaseFramesPerDirection + unitIdleFrameCount + frameIndex
}));
const idleFrames = Array.from({ length: unitIdleFrameCount }, (_, frameIndex) => ({
key,
frame: unitSheetRows[direction] * unitBaseFramesPerDirection + frameIndex
}));
const idleFrames = [
{
key,
frame: unitSheetRows[direction] * unitBaseFramesPerDirection
}
];
const walkAnimationKey = `${key}-walk-${direction}`;
const idleAnimationKey = `${key}-idle-${direction}`;
@@ -119,7 +120,7 @@ export function ensureUnitAnimations(scene: Phaser.Scene, keys: Iterable<string>
scene.anims.create({
key: idleAnimationKey,
frames: idleFrames,
frameRate: unitIdleFrameRate,
frameRate: 1,
repeat: -1
});
}