stash work

This commit is contained in:
root
2024-04-28 17:11:08 +02:00
parent 518da6be8d
commit 8ef50ecc54
4 changed files with 156 additions and 15 deletions

View File

@ -10,20 +10,20 @@
<script setup lang="ts">
import 'phaser';
import { Game, Scene } from 'phavuer'
import { Game, Scene, useGame } from 'phavuer'
import World from '@/components/World.vue'
const gameConfig = {
name: 'New Quest',
scale: {
mode: Phaser.Scale.FIT,
autoCenter: Phaser.Scale.CENTER_BOTH,
mode: Phaser.Scale.NONE,
width: window.innerWidth / 1.5,
height: window.innerHeight / 1.5,
zoom: 1.5
},
type: Phaser.CANVAS,
physics: { default: 'arcade' },
// physics: { default: 'arcade' },
pixelArt: true,
width: 1200,
height: 800,
}
const preload = (scene) => {
@ -39,7 +39,7 @@ const create = (scene) => {
cam.scrollX -= (p.x - p.prevPosition.x) / cam.zoom;
cam.scrollY -= (p.y - p.prevPosition.y) / cam.zoom;
});
// set camera to center
cam.centerOn(0, 0);
}

View File

@ -1,9 +1,5 @@
<template>
<Image ref="player" texture="player" :x="x" :y="y">
<Body
:enable="true"
:collideWorldBounds="true" />
</Image>
<Image ref="player" texture="player" :x="x" :y="y" />
</template>
<script setup>