From 4fd5430c5430f35ed4f0300b8e4519337b495baf Mon Sep 17 00:00:00 2001 From: root Date: Fri, 26 Apr 2024 22:19:37 +0200 Subject: [PATCH] Use Phavuer wherever possible --- package-lock.json | 12 ++-- .../assets/avatar/default/base_right_down.png | Bin 0 -> 1938 bytes public/assets/{tilesets => tiles}/default.png | Bin src/App.vue | 4 +- src/components/Game.vue | 38 +++++++++++ src/components/World.vue | 46 +++++++++++++ src/components/game/Screen.vue | 39 ----------- src/scenes/mapScene.js | 63 ------------------ 8 files changed, 92 insertions(+), 110 deletions(-) create mode 100644 public/assets/avatar/default/base_right_down.png rename public/assets/{tilesets => tiles}/default.png (100%) create mode 100644 src/components/Game.vue create mode 100644 src/components/World.vue delete mode 100644 src/components/game/Screen.vue delete mode 100644 src/scenes/mapScene.js diff --git a/package-lock.json b/package-lock.json index f27b6be..aaeedb6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2860,9 +2860,9 @@ } }, "node_modules/electron-to-chromium": { - "version": "1.4.749", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.749.tgz", - "integrity": "sha512-LRMMrM9ITOvue0PoBrvNIraVmuDbJV5QC9ierz/z5VilMdPOVMjOtpICNld3PuXuTZ3CHH/UPxX9gHhAPwi+0Q==", + "version": "1.4.750", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.750.tgz", + "integrity": "sha512-9ItEpeu15hW5m8jKdriL+BQrgwDTXEL9pn4SkillWFu73ZNNNQ2BKKLS+ZHv2vC9UkNhosAeyfxOf/5OSeTCPA==", "dev": true }, "node_modules/emoji-regex": { @@ -4791,9 +4791,9 @@ ] }, "node_modules/react-is": { - "version": "18.3.0", - "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.3.0.tgz", - "integrity": "sha512-wRiUsea88TjKDc4FBEn+sLvIDesp6brMbGWnJGjew2waAc9evdhja/2LvePc898HJbHw0L+MTWy7NhpnELAvLQ==", + "version": "18.3.1", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.3.1.tgz", + "integrity": "sha512-/LLMVyas0ljjAtoYiPqYiL8VWXzUUdThrmU5+n20DZv+a+ClRoevUzw5JxU+Ieh5/c87ytoTBV9G1FiKfNJdmg==", "dev": true }, "node_modules/read-package-json-fast": { diff --git a/public/assets/avatar/default/base_right_down.png b/public/assets/avatar/default/base_right_down.png new file mode 100644 index 0000000000000000000000000000000000000000..51637f7f65a74fc452da68c4b169bd21ec722a61 GIT binary patch literal 1938 zcmV;D2W|L?P)cJpg5n+p479zSX8nTNn0R?+_`_InId-LABjs4)U@6DSx-~9jl z|3ClCY|F<#{0Uuj%uJp+l^>5!wdl4H@Iy2_IDk~9-}ZiD+Ip`;>`B-$GkG>VH~_OZ zh)}!-MmmZ1SXij@D4j%UC5MUW$ulp~3p!+}Ous$pj&Wu;D}?bxuD>7Xe>KLj#7 zRa)IG0su}A%S{o;@RTrLI06cr_{8keYVgbJ-@Y5+r{9kN0ABp^7rU1meKh}o-Oum5 z!btZ;94p%MRB34?2LMQA`k7kicV1zB=M_5Y_kN%xJRYBFnOj}QT6U9>9_06MdRWGr zmrq%}k?xDacW+)k#gBK!l!RJVx|ZE!vGgFnhp1^a{2QlAIlijks#1~?s2fim2l+il zLKnfyT|CE-Ctb^KvhvfzGHT_D?K(XyV`BP=a;nk}Z89m1r+kt0DriTV;lTk$N=P}> zbCb>&A&~+NY2^+8-m|_hLP{@EnSNAvi^vy_nDu%|Mrd(MqWD~f8djmYTg1KDCHAZ$ zca)GPA`ls+8MShS1q36Vgn=aP$9tIMb2HBQjg63IdH{}65eYR60OoFy)eFUYkcwM% zok#^jK4}7gOV@{(By#FtAc@dQ4pokf>XcS;RxY$Ei{s#jlr&wsKE#qELO79O7bQ)y zs>6v4%v;|e6z{?C;D9aFV1#_qWTca5H4*@*tvj>(qF2+iIgqGlIUB`;m$!v+~G+W;VJ)GeAL zB14kFtW>s8rw@3^N_?jW5p^j!-LCV5F0RFETf%OC247UN?B9*?&7mlpDeSM&0^q*(XaplG}d~kaVm|e06`AFboFjuc$6`mh2 zEC?Nt>n_lHYVX-|q<;RjA)(HGT4!e`yB{4LRo2_z-xr=ge{dVG7nia2({~L*e&%+{ zn0d0xmoEbVy1Tn=WIH=MwzAiY%jo>#YqV`-f!QUymAXmmMn>gShp_M>hm+Cm5#YJ|%yu559y*Imr&(dGvczmiQ09gJL zh{O;!fZ35-f?EKVA#`?jVtad=sfJzo)Ed_6G4V-Z-RpYLA6&u~>$dgmQ}LWRd)e z*bTlVBt{ZN*~Zvgitp)lu3J5IjlLod+e%ew$ek7E$EK$zTHfUgM=(*WzXxgn+F|Wl(B6!1LhJt*jq{4gN5e300jWP8Vq*G9 zeF5q`)4LwYI)RtKNLzE>NohlfI_LIRL0XOvV*nX&YrVNz4*&oF07*qoM6N<$f;^F&RsaA1 literal 0 HcmV?d00001 diff --git a/public/assets/tilesets/default.png b/public/assets/tiles/default.png similarity index 100% rename from public/assets/tilesets/default.png rename to public/assets/tiles/default.png diff --git a/src/App.vue b/src/App.vue index 37d0651..27cb5d0 100644 --- a/src/App.vue +++ b/src/App.vue @@ -1,9 +1,9 @@ \ No newline at end of file diff --git a/src/components/Game.vue b/src/components/Game.vue new file mode 100644 index 0000000..687d8c2 --- /dev/null +++ b/src/components/Game.vue @@ -0,0 +1,38 @@ + + + \ No newline at end of file diff --git a/src/components/World.vue b/src/components/World.vue new file mode 100644 index 0000000..acd2c6e --- /dev/null +++ b/src/components/World.vue @@ -0,0 +1,46 @@ + + + \ No newline at end of file diff --git a/src/components/game/Screen.vue b/src/components/game/Screen.vue deleted file mode 100644 index 17676de..0000000 --- a/src/components/game/Screen.vue +++ /dev/null @@ -1,39 +0,0 @@ - - - - - \ No newline at end of file diff --git a/src/scenes/mapScene.js b/src/scenes/mapScene.js deleted file mode 100644 index 6741a66..0000000 --- a/src/scenes/mapScene.js +++ /dev/null @@ -1,63 +0,0 @@ -import Phaser from 'phaser'; - -class Example extends Phaser.Scene -{ - constructor () { - super(); - } - - preload () { - this.load.image('tiles', '/assets/tilesets/default.png'); - } - - create () { - const mapData = new Phaser.Tilemaps.MapData({ - orientation: Phaser.Tilemaps.Orientation.ISOMETRIC, - format: Phaser.Tilemaps.Formats.ARRAY_2D, - width: 10, - height: 10, - tileWidth: 64, - tileHeight: 32, - }); - - const map = new Phaser.Tilemaps.Tilemap(this, mapData); - const tileset = map.addTilesetImage('default', 'tiles'); - const layer = map.createBlankLayer('layer', tileset); - - const data = [ - [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ], - [ 0, 1, 1, 1, 1, 1, 1, 1, 1, 0 ], - [ 0, 1, 1, 1, 1, 1, 1, 1, 1, 0 ], - [ 0, 1, 1, 1, 1, 1, 1, 1, 1, 0 ], - [ 0, 1, 1, 1, 1, 1, 1, 1, 1, 0 ], - [ 0, 1, 1, 1, 1, 1, 1, 1, 1, 0 ], - [ 0, 1, 1, 1, 1, 1, 1, 1, 1, 0 ], - [ 0, 1, 1, 1, 1, 1, 1, 1, 1, 0 ], - [ 0, 1, 1, 1, 1, 1, 1, 1, 1, 0 ], - [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ], - ]; - - let y = 0; - - data.forEach(row => { - row.forEach((tile, x) => { - layer.putTileAt(tile, x, y); - }); - y++; - }); - - // middle of the screen by default - const centerX = map.widthInPixels / 1.5; - const centerY = map.heightInPixels / 2; - layer.setPosition(centerX, centerY); - - let cam = this.cameras.main; - this.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; - }); - } -} - -export default Example; \ No newline at end of file