fix player collision box
This commit is contained in:
parent
43d6932716
commit
94bdb0a9c8
1 changed files with 3 additions and 3 deletions
|
@ -1,5 +1,5 @@
|
||||||
import { computed, reactive } from 'vue'
|
import { computed, reactive } from 'vue'
|
||||||
import { RECIPROCAL } from '../level/def'
|
import { RECIPROCAL, STAGE_WIDTH, STAGE_HEIGHT } from '../level/def'
|
||||||
|
|
||||||
export interface Moveable {
|
export interface Moveable {
|
||||||
x: number, // position on x-axis (fixed for the player)
|
x: number, // position on x-axis (fixed for the player)
|
||||||
|
@ -10,8 +10,8 @@ export interface Moveable {
|
||||||
}
|
}
|
||||||
|
|
||||||
const player = reactive({
|
const player = reactive({
|
||||||
x: 16,
|
x: (STAGE_WIDTH + 2) / 2,
|
||||||
y: 10,
|
y: (STAGE_HEIGHT + 2) / 2,
|
||||||
lastDir: 0,
|
lastDir: 0,
|
||||||
vx: 0,
|
vx: 0,
|
||||||
vy: 1, // always falling, because of gravity
|
vy: 1, // always falling, because of gravity
|
||||||
|
|
Loading…
Add table
Reference in a new issue