From 94bdb0a9c809c0d729f97c18e88c049ccb587530 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Norman=20K=C3=B6hring?= Date: Sun, 12 Feb 2023 20:36:51 +0100 Subject: [PATCH] fix player collision box --- src/util/usePlayer.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/util/usePlayer.ts b/src/util/usePlayer.ts index 11c6e1f..fd7a0cc 100644 --- a/src/util/usePlayer.ts +++ b/src/util/usePlayer.ts @@ -1,5 +1,5 @@ import { computed, reactive } from 'vue' -import { RECIPROCAL } from '../level/def' +import { RECIPROCAL, STAGE_WIDTH, STAGE_HEIGHT } from '../level/def' export interface Moveable { x: number, // position on x-axis (fixed for the player) @@ -10,8 +10,8 @@ export interface Moveable { } const player = reactive({ - x: 16, - y: 10, + x: (STAGE_WIDTH + 2) / 2, + y: (STAGE_HEIGHT + 2) / 2, lastDir: 0, vx: 0, vy: 1, // always falling, because of gravity