fix: add missing rotate/scale components to Kaplay objects for TypeScript
Added k.rotate(0) and k.scale(1) to game objects that use .angle and .scale properties — fixes vue-tsc build failure in Docker. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.6
parent
c87bff01a8
commit
bb9a966d4e
@@ -1354,7 +1354,7 @@ export async function createFightScene(config: FightSceneConfig) {
|
|||||||
const lx = W * (0.1 + i * 0.15)
|
const lx = W * (0.1 + i * 0.15)
|
||||||
const cone = k.add([
|
const cone = k.add([
|
||||||
k.rect(30, GROUND_Y * 0.7), k.pos(lx, 10), k.anchor('top'),
|
k.rect(30, GROUND_Y * 0.7), k.pos(lx, 10), k.anchor('top'),
|
||||||
k.color(safeColor(k, lightColors[i])), k.opacity(0.04), k.z(2),
|
k.color(safeColor(k, lightColors[i])), k.opacity(0.04), k.z(2), k.rotate(0),
|
||||||
])
|
])
|
||||||
k.add([k.circle(4), k.pos(lx + 15, 8), k.anchor('center'), k.color(safeColor(k, lightColors[i])), k.opacity(0.4), k.z(2)])
|
k.add([k.circle(4), k.pos(lx + 15, 8), k.anchor('center'), k.color(safeColor(k, lightColors[i])), k.opacity(0.4), k.z(2)])
|
||||||
const baseAngle = (i - 3) * 5
|
const baseAngle = (i - 3) * 5
|
||||||
@@ -1368,7 +1368,7 @@ export async function createFightScene(config: FightSceneConfig) {
|
|||||||
for (let s = 0; s < 4; s++) {
|
for (let s = 0; s < 4; s++) {
|
||||||
k.add([k.rect(20, 18), k.pos(sx, GROUND_Y - 20 - s * 20), k.color(safeColor(k, '#111111')), k.opacity(0.5), k.z(1)])
|
k.add([k.rect(20, 18), k.pos(sx, GROUND_Y - 20 - s * 20), k.color(safeColor(k, '#111111')), k.opacity(0.5), k.z(1)])
|
||||||
k.add([k.circle(6), k.pos(sx + 10, GROUND_Y - 11 - s * 20), k.anchor('center'), k.color(safeColor(k, '#222222')), k.opacity(0.4), k.z(1)])
|
k.add([k.circle(6), k.pos(sx + 10, GROUND_Y - 11 - s * 20), k.anchor('center'), k.color(safeColor(k, '#222222')), k.opacity(0.4), k.z(1)])
|
||||||
const speakerCone = k.add([k.circle(4), k.pos(sx + 10, GROUND_Y - 11 - s * 20), k.anchor('center'), k.color(safeColor(k, '#1a1a1a')), k.opacity(0.3), k.z(1)])
|
const speakerCone = k.add([k.circle(4), k.pos(sx + 10, GROUND_Y - 11 - s * 20), k.anchor('center'), k.color(safeColor(k, '#1a1a1a')), k.opacity(0.3), k.z(1), k.scale(1)])
|
||||||
speakerCone.onUpdate(() => { speakerCone.scale = k.vec2(1 + Math.sin(k.time() * 8 + s) * 0.05) })
|
speakerCone.onUpdate(() => { speakerCone.scale = k.vec2(1 + Math.sin(k.time() * 8 + s) * 0.05) })
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1523,7 +1523,7 @@ export async function createFightScene(config: FightSceneConfig) {
|
|||||||
for (let i = 0; i < 12; i++) {
|
for (let i = 0; i < 12; i++) {
|
||||||
const emoji = k.add([
|
const emoji = k.add([
|
||||||
k.circle(6 + Math.random() * 6), k.pos(Math.random() * W, Math.random() * GROUND_Y),
|
k.circle(6 + Math.random() * 6), k.pos(Math.random() * W, Math.random() * GROUND_Y),
|
||||||
k.color(safeColor(k, ['#ffcc00', '#ff4444', '#44ff44', '#4444ff', '#ff44ff', '#44ffff'][i % 6])), k.opacity(0.12), k.z(1),
|
k.color(safeColor(k, ['#ffcc00', '#ff4444', '#44ff44', '#4444ff', '#ff44ff', '#44ffff'][i % 6])), k.opacity(0.12), k.z(1), k.scale(1),
|
||||||
])
|
])
|
||||||
const bx = emoji.pos.x, by = emoji.pos.y
|
const bx = emoji.pos.x, by = emoji.pos.y
|
||||||
emoji.onUpdate(() => {
|
emoji.onUpdate(() => {
|
||||||
@@ -1650,7 +1650,7 @@ export async function createFightScene(config: FightSceneConfig) {
|
|||||||
for (let i = 0; i < 20; i++) {
|
for (let i = 0; i < 20; i++) {
|
||||||
const gx = Math.random() * W
|
const gx = Math.random() * W
|
||||||
const grassH = 5 + Math.random() * 10
|
const grassH = 5 + Math.random() * 10
|
||||||
const grass = k.add([k.rect(1, grassH), k.pos(gx, GROUND_Y - grassH), k.color(safeColor(k, '#8a7830')), k.opacity(0.2), k.z(3)])
|
const grass = k.add([k.rect(1, grassH), k.pos(gx, GROUND_Y - grassH), k.color(safeColor(k, '#8a7830')), k.opacity(0.2), k.z(3), k.rotate(0)])
|
||||||
grass.onUpdate(() => { grass.angle = Math.sin(k.time() * 1.2 + i) * 5 })
|
grass.onUpdate(() => { grass.angle = Math.sin(k.time() * 1.2 + i) * 5 })
|
||||||
}
|
}
|
||||||
// Elephant silhouette
|
// Elephant silhouette
|
||||||
|
|||||||
Reference in New Issue
Block a user