feat: expand campaign and refine puzzle visuals and controls

This commit is contained in:
cabinw
2026-09-09 11:02:45 +08:00
parent 9f8990b579
commit 70b021d4cc
66 changed files with 41108 additions and 10553 deletions
+2 -2
View File
@@ -31,7 +31,7 @@ class CocosPainter {
return new Color((rgb >> 16) & 255, (rgb >> 8) & 255, rgb & 255, alpha);
}
sprite(index: number, x: number, y: number, radius: number) {
if (!this.frames.length) return false;
if (!this.frames[index]) return false;
if (!this.pool[this.cursor]) {
const node = new Node('Tile'); node.layer = this.root.layer; node.parent = this.root;
node.addComponent(UITransform);const mask=node.addComponent(Mask);mask.type=Mask.Type.GRAPHICS_STENCIL;
@@ -94,7 +94,7 @@ export class HexTrailsBoard extends Component {
this.painter = new CocosPainter(this.node,graphics,arrowGraphics,ui.width,ui.height,this.tileAtlas);
this.node.on(Node.EventType.TOUCH_END,this.onTouch,this);
this.node.on(Node.EventType.SIZE_CHANGED,this.redraw,this);
this.loadLevel(this.levelAsset?.json ?? LEVELS[Math.max(0,Math.min(23,this.levelIndex))]);
this.loadLevel(this.levelAsset?.json ?? LEVELS[Math.max(0,Math.min(LEVELS.length-1,this.levelIndex))]);
}
onDestroy() {
this.node.off(Node.EventType.TOUCH_END,this.onTouch,this);