started skeleton and zombie, added GUI and menu system
Signed-off-by: Pascal Syma <pascal@syma.dev>
This commit is contained in:
+16
-1
@@ -6,12 +6,15 @@
|
||||
import logoImg from "../../public/favicon.png";
|
||||
import map from "../assets/lvl1.json";
|
||||
import menu from "../assets/menu.json";
|
||||
import skeletonAtlas from "../assets/skeleton.json";
|
||||
import skeletonSprite from "../assets/skeleton.png";
|
||||
import charA from "../assets/char_a/spritesheet.png";
|
||||
import charB from "../assets/char_b/spritesheet.png";
|
||||
import charC from "../assets/char_c/spritesheet.png";
|
||||
import charD from "../assets/char_d/spritesheet.png";
|
||||
import tiles from "../assets/newtiles.png";
|
||||
import menutiles from "../assets/menu.png";
|
||||
import buttontiles from "../assets/buttons.png";
|
||||
import batFly from "../assets/BatFly.png";
|
||||
import batDie from "../assets/BatDie.png";
|
||||
import item_01 from "../assets/items/itemshard_01.png";
|
||||
@@ -36,17 +39,29 @@ export default class Preload extends Phaser.Scene {
|
||||
this.load.spritesheet('charD', charD, {frameWidth: 79, frameHeight: 63, margin: 1, spacing: 2});
|
||||
this.load.spritesheet('tiles', tiles, {frameWidth: 16, frameHeight: 16, margin: 1, spacing: 2});
|
||||
this.load.spritesheet('menutiles', menutiles, {frameWidth: 16, frameHeight: 16, margin: 1, spacing: 2});
|
||||
this.load.spritesheet('buttontiles', buttontiles, {frameWidth: 16, frameHeight: 16, margin: 1, spacing: 2});
|
||||
this.load.spritesheet('batFly', batFly, {frameWidth: 48, frameHeight: 32/*, margin: 1, spacing: 2*/});
|
||||
this.load.spritesheet('batDie', batDie, {frameWidth: 48, frameHeight: 32/*, margin: 1, spacing: 2*/});
|
||||
this.load.tilemapTiledJSON("map", map);
|
||||
this.load.tilemapTiledJSON("menu", menu);
|
||||
|
||||
this.load.atlas({key: 'skeleton', textureURL: skeletonSprite, atlasURL: skeletonAtlas});
|
||||
|
||||
}
|
||||
|
||||
create() {
|
||||
this.add.image(this.cameras.main.centerX, this.cameras.main.centerY, 'logo').setOrigin(0.5, 0.5).setDisplaySize(this.cameras.main.centerX, this.cameras.main.centerX);
|
||||
setTimeout(() => {
|
||||
this.scene.start('Menu');
|
||||
// this.scene.start('Menu');
|
||||
this.scene.start('GUI', {key: 'MainMenu'});
|
||||
}, 2 * 1000)
|
||||
|
||||
this.anims.create({
|
||||
key: 'idle',
|
||||
frames: this.anims.generateFrameNumbers('charA', {start: 126, end: 131}),
|
||||
frameRate: 10,
|
||||
repeat: -1
|
||||
});
|
||||
}
|
||||
|
||||
loadingScreen() {
|
||||
|
||||
Reference in New Issue
Block a user