Rename color constants enum

This commit is contained in:
Idrees Hassan
2026-01-18 18:10:43 -05:00
parent ca1495a9f1
commit 579967a302
9 changed files with 788 additions and 752 deletions

View File

@@ -1,5 +1,5 @@
import { Directions } from '../shared.js';
import { Sprite, BirdType } from './sprites.js';
import { PALETTE, BirdType } from './sprites.js';
import Layer from './layer.js';
class Frame {
@@ -25,7 +25,7 @@ class Frame {
this.pixels = layers[0].pixels.map(row => row.slice());
// Pad from top with transparent pixels
while (this.pixels.length < maxHeight) {
this.pixels.unshift(new Array(this.pixels[0].length).fill(Sprite.TRANSPARENT));
this.pixels.unshift(new Array(this.pixels[0].length).fill(PALETTE.TRANSPARENT));
}
// Combine layers
for (let i = 1; i < layers.length; i++) {
@@ -34,7 +34,7 @@ class Frame {
let topMargin = maxHeight - layerPixels.length;
for (let y = 0; y < layerPixels.length; y++) {
for (let x = 0; x < layerPixels[y].length; x++) {
this.pixels[y + topMargin][x] = layerPixels[y][x] !== Sprite.TRANSPARENT ? layerPixels[y][x] : this.pixels[y + topMargin][x];
this.pixels[y + topMargin][x] = layerPixels[y][x] !== PALETTE.TRANSPARENT ? layerPixels[y][x] : this.pixels[y + topMargin][x];
}
}
}