fix player collision box

This commit is contained in:
Norman Köhring 2023-02-12 20:36:51 +01:00
parent 43d6932716
commit 94bdb0a9c8

View file

@ -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