Cleaned a bit

This commit is contained in:
root 2024-04-26 23:48:58 +02:00
parent 11236c04c1
commit bf379ca2f9
3 changed files with 4 additions and 4 deletions

View File

@ -9,11 +9,12 @@
</template>
<script setup lang="ts">
import 'phaser';
import 'phaser';
import { Game, Scene } from 'phavuer'
import World from '@/components/World.vue'
const gameConfig = {
name: 'New Quest',
scale: {
mode: Phaser.Scale.FIT,
autoCenter: Phaser.Scale.CENTER_BOTH,
@ -29,11 +30,9 @@ const preload = (scene) => {
}
const create = (scene) => {
// Camera drag system
let cam = scene.cameras.main;
// set camera bounds to the size of the map
scene.input.on("pointermove", function (p) {
if (!p.isDown) return;
cam.scrollX -= (p.x - p.prevPosition.x) / cam.zoom;
cam.scrollY -= (p.y - p.prevPosition.y) / cam.zoom;

View File

@ -6,6 +6,7 @@
<script setup>
import { Circle, TilemapLayer, useScene } from 'phavuer'
const scene = useScene()
const mapData = new Phaser.Tilemaps.MapData({
orientation: Phaser.Tilemaps.Orientation.ISOMETRIC,

View File