diff --git a/src/Entry.ts b/src/Entry.ts index ffbc044..7f058cd 100644 --- a/src/Entry.ts +++ b/src/Entry.ts @@ -206,6 +206,18 @@ export class Entry { this.locate_x(x, obj) this.locate_y(y, obj) } + rotate_relative(angle: number, obj: EntrySprite) { + obj.angle += angle + } + direction_relative(angle: number, obj: EntrySprite) { + obj.direction += angle + } + rotate_absolute(angle: number, obj: EntrySprite) { + obj.angle = angle + } + direction_absolute(angle: number, obj: EntrySprite) { + obj.direction = angle + } /* 생김새 */ show(obj: EntrySprite) { @@ -301,7 +313,7 @@ export class Entry { /* 계산 */ angle(n: number) { - return n + return Number(n) } calc_basic( a: number, @@ -341,9 +353,9 @@ export class Entry { case "y": return -target.y + 135 case "rotation": - return target.rotation + return target.angle case "direction": - throw "Unimplemented: direction" + throw target.direction case "picture_index": return target.currentTextureIndex case "size": diff --git a/src/EntrySprite.ts b/src/EntrySprite.ts index cd187a4..c22e216 100644 --- a/src/EntrySprite.ts +++ b/src/EntrySprite.ts @@ -5,6 +5,7 @@ import type { Entry } from "./Entry.ts" export class EntrySprite extends Sprite { textureIds: string[] = [] currentTextureIndex = 0 + direction = 0 scene = "" isClone = false @@ -43,6 +44,8 @@ export class EntrySprite extends Sprite { x: entity.scaleX, y: entity.scaleY, } + //sprite.angle = entity.rotation + //sprite.direction = entity.direction sprite.scene = scene project.scenes[scene].addChild(sprite) return sprite