From 7ff12dc19bd333495f8b75523b96b00a42124cab Mon Sep 17 00:00:00 2001 From: Gnlow Date: Tue, 5 Dec 2023 10:29:38 +0900 Subject: [PATCH] impl: move_direction --- src/Entry.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Entry.ts b/src/Entry.ts index 8ab1301..fa0e7ff 100644 --- a/src/Entry.ts +++ b/src/Entry.ts @@ -190,6 +190,10 @@ export class Entry { } /* 움직임 */ + move_direction(n: number, obj: EntrySprite) { + obj.x += n * Math.sin(toRadian(obj.direction)) + obj.y -= n * Math.cos(toRadian(obj.direction)) + } move_x(n: number, obj: EntrySprite) { obj.x += n }