added item chests, audio and deployment
Signed-off-by: Pascal Syma <pascal@syma.dev>
@@ -31,6 +31,23 @@ pipeline {
|
|||||||
steps {
|
steps {
|
||||||
echo 'Deploying....'
|
echo 'Deploying....'
|
||||||
dir("dist") {
|
dir("dist") {
|
||||||
|
withCredentials([sshUserPrivateKey(credentialsId: 'id_rsa', keyFileVariable: 'identity', passphraseVariable: '', usernameVariable: 'userName')])
|
||||||
|
{
|
||||||
|
script {
|
||||||
|
def remote = [:]
|
||||||
|
remote.name = "1blu"
|
||||||
|
remote.host = "webhosting72.1blu.de"
|
||||||
|
remote.allowAnyHosts = true
|
||||||
|
remote.user = userName
|
||||||
|
remote.identityFile = identity
|
||||||
|
|
||||||
|
sshCommand remote: remote, command: "mkdir www/mi2.mama.productions/releases/${BUILD_NUMBER}"
|
||||||
|
sshPut remote: remote, from: "${WORKSPACE}\\dist\\", into: "www/mi2.mama.productions/releases/${BUILD_NUMBER}"
|
||||||
|
sshCommand remote: remote, command: "rm www/mi2.mama.productions/public"
|
||||||
|
sshCommand remote: remote, command: "ln -s releases/${BUILD_NUMBER}/dist www/mi2.mama.productions/public"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
bat 'git init'
|
bat 'git init'
|
||||||
bat 'git add .'
|
bat 'git add .'
|
||||||
bat 'git config --global user.email "jenkins@bosym.de"'
|
bat 'git config --global user.email "jenkins@bosym.de"'
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<!--
|
<!--
|
||||||
~ Copyright (c) 2020. Pascal Syma <pascal@syma.dev>
|
~ Copyright (c) 2020. Antonio Martinez Casadesus and Pascal Syma.
|
||||||
~ All rights reserved.
|
~ All rights reserved.
|
||||||
-->
|
-->
|
||||||
|
|
||||||
@@ -13,8 +13,7 @@
|
|||||||
body {
|
body {
|
||||||
height: 100%;
|
height: 100%;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
background-color: gray;
|
background-color: black;
|
||||||
/*TODO: Change to black later on: background-color: black;*/
|
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -22,7 +22,11 @@ export default class TextElement {
|
|||||||
|
|
||||||
if (item.name === "action") {
|
if (item.name === "action") {
|
||||||
this.text.setInteractive(new Phaser.Geom.Rectangle(0, 0, this.text.width, this.text.height), Phaser.Geom.Rectangle.Contains)
|
this.text.setInteractive(new Phaser.Geom.Rectangle(0, 0, this.text.width, this.text.height), Phaser.Geom.Rectangle.Contains)
|
||||||
|
.on('pointerover', () => {
|
||||||
|
this.scene.sound.play('menu_hover', {volume: 0.3});
|
||||||
|
})
|
||||||
.on('pointerdown', () => {
|
.on('pointerdown', () => {
|
||||||
|
this.scene.sound.play('menu_click', {volume: 0.5});
|
||||||
let action = item.properties.filter(obj => obj.name === "action");
|
let action = item.properties.filter(obj => obj.name === "action");
|
||||||
if (action.length <= 0)
|
if (action.length <= 0)
|
||||||
return;
|
return;
|
||||||
@@ -33,6 +37,7 @@ export default class TextElement {
|
|||||||
case "pause_resume":
|
case "pause_resume":
|
||||||
this.endMyself();
|
this.endMyself();
|
||||||
scene.scene.resume('Game');
|
scene.scene.resume('Game');
|
||||||
|
this.scene.scene.get('Game').music.play();
|
||||||
break;
|
break;
|
||||||
case "pause_exit":
|
case "pause_exit":
|
||||||
this.endMyself();
|
this.endMyself();
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 202 KiB After Width: | Height: | Size: 86 KiB |
|
Before Width: | Height: | Size: 178 KiB After Width: | Height: | Size: 72 KiB |
|
Before Width: | Height: | Size: 173 KiB After Width: | Height: | Size: 72 KiB |
|
Before Width: | Height: | Size: 168 KiB After Width: | Height: | Size: 71 KiB |
|
After Width: | Height: | Size: 3.8 KiB |
|
After Width: | Height: | Size: 192 B |
|
After Width: | Height: | Size: 1.7 KiB |
|
After Width: | Height: | Size: 2.2 KiB |
|
After Width: | Height: | Size: 1.7 KiB |
|
After Width: | Height: | Size: 2.7 KiB |
@@ -28,7 +28,6 @@ export default class Hitbox extends Entity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
overlap(obj) {
|
overlap(obj) {
|
||||||
this.setData('active', false);
|
|
||||||
obj.hit(this.getData('dmg'));
|
obj.hit(this.getData('dmg'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,41 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2020. Antonio Martinez Casadesus and Pascal Syma.
|
||||||
|
* All rights reserved.
|
||||||
|
*/
|
||||||
|
|
||||||
|
import Interactable from "./Interactable";
|
||||||
|
import Item from "./Item";
|
||||||
|
|
||||||
|
export default class Chest extends Interactable {
|
||||||
|
|
||||||
|
constructor(scene, item) {
|
||||||
|
super(scene, item.x, item.y, 'chest');
|
||||||
|
|
||||||
|
this.setFrame(4);
|
||||||
|
this.body.setAllowGravity(false);
|
||||||
|
this.setOrigin(0.5, 1);
|
||||||
|
|
||||||
|
this.setData('opened', false);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
canInteract() {
|
||||||
|
return !this.getData('opened');
|
||||||
|
}
|
||||||
|
|
||||||
|
interact() {
|
||||||
|
super.interact();
|
||||||
|
this.setData('opened', true);
|
||||||
|
|
||||||
|
this.play('chest_open');
|
||||||
|
|
||||||
|
const options = [/*"slow", "speed", "storm", */"heal"];
|
||||||
|
|
||||||
|
let item = new Item(this.scene, {
|
||||||
|
x: this.x,
|
||||||
|
y: this.y - this.height
|
||||||
|
}, options[Math.floor(Math.random() * options.length)])
|
||||||
|
|
||||||
|
this.scene.interactables.add(item);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -17,6 +17,9 @@ export default class Zombie extends Enemy {
|
|||||||
|
|
||||||
this.dieAnimation = 'zombie_die';
|
this.dieAnimation = 'zombie_die';
|
||||||
this.hitAnimation = 'zombie_hit';
|
this.hitAnimation = 'zombie_hit';
|
||||||
|
|
||||||
|
this.setData('hp', 2);
|
||||||
|
this.setData('dmg', 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ export default class Entity extends Phaser.GameObjects.Sprite {
|
|||||||
}
|
}
|
||||||
|
|
||||||
hit(dmg) {
|
hit(dmg) {
|
||||||
if (dmg <= 0)
|
if (dmg === 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (this.hitCooldown)
|
if (this.hitCooldown)
|
||||||
@@ -25,8 +25,8 @@ export default class Entity extends Phaser.GameObjects.Sprite {
|
|||||||
|
|
||||||
this.hitCooldown = true;
|
this.hitCooldown = true;
|
||||||
|
|
||||||
this.setData('hp', this.getData('hp') - dmg);
|
const newHp = this.getData('hp') - dmg;
|
||||||
console.log(this, this.getData('hp'));
|
this.setData('hp', newHp < 0 ? 0 : newHp);
|
||||||
|
|
||||||
// play hit animation
|
// play hit animation
|
||||||
const shouldDie = this.getData('hp') <= 0;
|
const shouldDie = this.getData('hp') <= 0;
|
||||||
@@ -38,6 +38,7 @@ export default class Entity extends Phaser.GameObjects.Sprite {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (this.hitAnimation !== null) {
|
if (this.hitAnimation !== null) {
|
||||||
|
// TODO: bug, not working, no clue why not
|
||||||
this.anims.stop();
|
this.anims.stop();
|
||||||
this.play(this.hitAnimation)
|
this.play(this.hitAnimation)
|
||||||
.once('animationcomplete', () => {
|
.once('animationcomplete', () => {
|
||||||
|
|||||||
@@ -0,0 +1,16 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2020. Antonio Martinez Casadesus and Pascal Syma.
|
||||||
|
* All rights reserved.
|
||||||
|
*/
|
||||||
|
|
||||||
|
import Entity from "./Entity";
|
||||||
|
|
||||||
|
export default class Interactable extends Entity {
|
||||||
|
|
||||||
|
canInteract() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
interact() {
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,30 +1,43 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2020. Pascal Syma <pascal@syma.dev>
|
* Copyright (c) 2020. Antonio Martinez Casadesus and Pascal Syma.
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import Entity from "./Entity";
|
import Interactable from "./Interactable";
|
||||||
|
|
||||||
export default class Item extends Entity {
|
export default class Item extends Interactable {
|
||||||
|
|
||||||
constructor(scene, obj) {
|
constructor(scene, obj, texture) {
|
||||||
super(scene, obj.x, obj.y, obj.properties.filter(obj => obj.name === "texture")[0].value);
|
super(scene, obj.x, obj.y, texture);
|
||||||
this.body.setAllowGravity(false);
|
this.body.setAllowGravity(false);
|
||||||
|
|
||||||
|
this.setData('texture', texture);
|
||||||
|
|
||||||
this.setDisplaySize(16, 16);
|
this.setDisplaySize(16, 16);
|
||||||
|
|
||||||
this.setData('collectable', true);
|
this.setData('collectable', true);
|
||||||
|
|
||||||
|
this.play('item_' + texture);
|
||||||
}
|
}
|
||||||
|
|
||||||
canPickup() {
|
canInteract() {
|
||||||
return this.getData('collectable');
|
return this.getData('collectable');
|
||||||
}
|
}
|
||||||
|
|
||||||
pickup() {
|
interact() {
|
||||||
this.setData('collectable', false);
|
this.setData('collectable', false);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
use(user) {
|
||||||
|
switch (this.getData('texture')) {
|
||||||
|
case "heal":
|
||||||
|
user.hit(-2)
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
this.die();
|
||||||
|
}
|
||||||
|
|
||||||
drop() {
|
drop() {
|
||||||
this.setData('collectable', true);
|
this.setData('collectable', true);
|
||||||
|
|
||||||
|
|||||||
@@ -6,6 +6,8 @@
|
|||||||
import Entity from "./Entity";
|
import Entity from "./Entity";
|
||||||
import AttackA from "./Attacks/AttackA";
|
import AttackA from "./Attacks/AttackA";
|
||||||
import AttackB from "./Attacks/AttackB";
|
import AttackB from "./Attacks/AttackB";
|
||||||
|
import Item from "./Item";
|
||||||
|
import Chest from "./Chest";
|
||||||
|
|
||||||
export default class Player extends Entity {
|
export default class Player extends Entity {
|
||||||
|
|
||||||
@@ -34,17 +36,34 @@ export default class Player extends Entity {
|
|||||||
this.hitAnimation = 'hit';
|
this.hitAnimation = 'hit';
|
||||||
}
|
}
|
||||||
|
|
||||||
pickup(item) {
|
interact(item) {
|
||||||
if (this.items.length >= 1) {
|
|
||||||
this.items.shift().setPosition(this.x, this.y).drop();
|
if (item instanceof Item) {
|
||||||
|
if (this.items.length >= 1) {
|
||||||
|
this.items.shift().setPosition(this.x, this.y).drop();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
item.interact();
|
||||||
|
|
||||||
|
this.items[0] = item;
|
||||||
|
} else if (item instanceof Chest) {
|
||||||
|
item.interact();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
console.log(item);
|
|
||||||
|
|
||||||
item.pickup();
|
hit(dmg) {
|
||||||
|
super.hit(dmg);
|
||||||
this.items[0] = item;
|
if (this.getData('hp') > this.scene.hearts.length)
|
||||||
|
this.setData('hp', this.scene.hearts.length);
|
||||||
|
|
||||||
|
for (let i = this.getData('hp'); i < this.scene.hearts.length; i++) {
|
||||||
|
this.scene.hearts[i].alpha = 0;
|
||||||
|
}
|
||||||
|
for (let i = 0; i < this.getData('hp'); i++) {
|
||||||
|
this.scene.hearts[i].alpha = 1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
update(...args) {
|
update(...args) {
|
||||||
@@ -103,7 +122,7 @@ export default class Player extends Entity {
|
|||||||
this.items.forEach(i => i.setPosition(this.body.x, this.body.y - 16));
|
this.items.forEach(i => i.setPosition(this.body.x, this.body.y - 16));
|
||||||
|
|
||||||
if (this.scene.keyAction1.isDown && this.items.length >= 1) {
|
if (this.scene.keyAction1.isDown && this.items.length >= 1) {
|
||||||
this.items.shift().die();
|
this.items.shift().use(this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -114,6 +133,7 @@ export default class Player extends Entity {
|
|||||||
.once('animationcomplete', () => {
|
.once('animationcomplete', () => {
|
||||||
this.setFrame(51);
|
this.setFrame(51);
|
||||||
this.scene.scene.pause();
|
this.scene.scene.pause();
|
||||||
|
this.scene.music.pause();
|
||||||
this.scene.scene.launch('GUI', {key: 'Dead'}).bringToTop('GUI');
|
this.scene.scene.launch('GUI', {key: 'Dead'}).bringToTop('GUI');
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -49,8 +49,13 @@ export default class GUI extends Phaser.Scene {
|
|||||||
|
|
||||||
new Player(this, s, 'char' + charKey).play('idle' + charKey, true)
|
new Player(this, s, 'char' + charKey).play('idle' + charKey, true)
|
||||||
.setInteractive()
|
.setInteractive()
|
||||||
|
.on('pointerover', () => {
|
||||||
|
this.sound.play('menu_hover', {volume: 0.3});
|
||||||
|
})
|
||||||
.on('pointerdown', () => {
|
.on('pointerdown', () => {
|
||||||
|
|
||||||
|
this.sound.play('menu_click', {volume: 0.5});
|
||||||
|
|
||||||
if (this.textures.exists('char'))
|
if (this.textures.exists('char'))
|
||||||
this.textures.removeKey('char');
|
this.textures.removeKey('char');
|
||||||
|
|
||||||
|
|||||||
@@ -5,13 +5,13 @@
|
|||||||
|
|
||||||
import Player from "../entities/Player";
|
import Player from "../entities/Player";
|
||||||
import Bat from "../entities/Enemys/Bat";
|
import Bat from "../entities/Enemys/Bat";
|
||||||
import Item from "../entities/Item";
|
|
||||||
import Storage from "../Storage";
|
import Storage from "../Storage";
|
||||||
import Win from "../entities/Win";
|
import Win from "../entities/Win";
|
||||||
import TextElement from "../TextElement";
|
import TextElement from "../TextElement";
|
||||||
import DamageEntity from "../entities/Enemys/DamageEntity";
|
import DamageEntity from "../entities/Enemys/DamageEntity";
|
||||||
import Zombie from "../entities/Enemys/Zombie";
|
import Zombie from "../entities/Enemys/Zombie";
|
||||||
import Skeleton from "../entities/Enemys/Skeleton";
|
import Skeleton from "../entities/Enemys/Skeleton";
|
||||||
|
import Chest from "../entities/Chest";
|
||||||
|
|
||||||
export default class Game extends Phaser.Scene {
|
export default class Game extends Phaser.Scene {
|
||||||
|
|
||||||
@@ -24,7 +24,7 @@ export default class Game extends Phaser.Scene {
|
|||||||
default: 'arcade',
|
default: 'arcade',
|
||||||
arcade: {
|
arcade: {
|
||||||
gravity: {y: 300},
|
gravity: {y: 300},
|
||||||
debug: true
|
// debug: true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -196,6 +196,40 @@ export default class Game extends Phaser.Scene {
|
|||||||
frameRate: 15
|
frameRate: 15
|
||||||
});
|
});
|
||||||
|
|
||||||
|
this.anims.create({
|
||||||
|
key: 'chest_open',
|
||||||
|
frames: this.anims.generateFrameNumbers('chest', {start: 0, end: 3}),
|
||||||
|
frameRate: 10
|
||||||
|
});
|
||||||
|
|
||||||
|
this.anims.create({
|
||||||
|
key: 'item_heal',
|
||||||
|
frames: this.anims.generateFrameNumbers('heal', {start: 0, end: 7}),
|
||||||
|
frameRate: 10,
|
||||||
|
repeat: -1
|
||||||
|
});
|
||||||
|
|
||||||
|
this.anims.create({
|
||||||
|
key: 'item_slow',
|
||||||
|
frames: this.anims.generateFrameNumbers('slow', {start: 0, end: 10}),
|
||||||
|
frameRate: 10,
|
||||||
|
repeat: -1
|
||||||
|
});
|
||||||
|
|
||||||
|
this.anims.create({
|
||||||
|
key: 'item_speed',
|
||||||
|
frames: this.anims.generateFrameNumbers('speed', {start: 0, end: 7}),
|
||||||
|
frameRate: 10,
|
||||||
|
repeat: -1
|
||||||
|
});
|
||||||
|
|
||||||
|
this.anims.create({
|
||||||
|
key: 'item_storm',
|
||||||
|
frames: this.anims.generateFrameNumbers('storm', {start: 0, end: 11}),
|
||||||
|
frameRate: 10,
|
||||||
|
repeat: -1
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
const mapKey = "map";
|
const mapKey = "map";
|
||||||
const mapTilesetKey = "tiles";
|
const mapTilesetKey = "tiles";
|
||||||
@@ -216,7 +250,8 @@ export default class Game extends Phaser.Scene {
|
|||||||
const spawnPoint = map.findObject("Player/Enemys", obj => obj.name === "player");
|
const spawnPoint = map.findObject("Player/Enemys", obj => obj.name === "player");
|
||||||
|
|
||||||
this.enemys = this.add.group();
|
this.enemys = this.add.group();
|
||||||
this.items = this.add.group();
|
this.environment = this.add.group();
|
||||||
|
this.interactables = this.add.group();
|
||||||
|
|
||||||
map.objects[0].objects.filter(obj => obj.name === "bat").forEach(s => {
|
map.objects[0].objects.filter(obj => obj.name === "bat").forEach(s => {
|
||||||
let bat = new Bat(this, s);
|
let bat = new Bat(this, s);
|
||||||
@@ -232,12 +267,12 @@ export default class Game extends Phaser.Scene {
|
|||||||
});
|
});
|
||||||
|
|
||||||
map.objects[0].objects.filter(obj => obj.type === "dmg").forEach(s => {
|
map.objects[0].objects.filter(obj => obj.type === "dmg").forEach(s => {
|
||||||
this.enemys.add(new DamageEntity(this, s))
|
this.environment.add(new DamageEntity(this, s))
|
||||||
});
|
});
|
||||||
|
|
||||||
map.objects[0].objects.filter(obj => obj.name === "item").forEach(s => {
|
map.objects[0].objects.filter(obj => obj.name === "chest").forEach(s => {
|
||||||
let item = new Item(this, s);
|
let chest = new Chest(this, s);
|
||||||
this.items.add(item)
|
this.interactables.add(chest)
|
||||||
});
|
});
|
||||||
|
|
||||||
this.wins = this.add.group();
|
this.wins = this.add.group();
|
||||||
@@ -283,8 +318,19 @@ export default class Game extends Phaser.Scene {
|
|||||||
this.player.hit(e.getData('dmg'));
|
this.player.hit(e.getData('dmg'));
|
||||||
})
|
})
|
||||||
|
|
||||||
this.physics.add.overlap(this.player, this.wins, (p, w) => {
|
this.physics.add.overlap(this.player, this.enemys, (p, e) => {
|
||||||
console.log("win!");
|
if (e.getData('active'))
|
||||||
|
this.player.hit(e.getData('dmg'));
|
||||||
|
})
|
||||||
|
|
||||||
|
this.physics.add.overlap(this.player, this.environment, (p, e) => {
|
||||||
|
if (e.getData('active'))
|
||||||
|
this.player.hit(e.getData('dmg'));
|
||||||
|
})
|
||||||
|
|
||||||
|
this.physics.add.overlap(this.enemys, this.environment, (p, e) => {
|
||||||
|
if (e.getData('active'))
|
||||||
|
p.hit(e.getData('dmg'));
|
||||||
})
|
})
|
||||||
|
|
||||||
let controls = Storage.get().controls;
|
let controls = Storage.get().controls;
|
||||||
@@ -299,9 +345,9 @@ export default class Game extends Phaser.Scene {
|
|||||||
this.keyAction2 = this.input.keyboard.addKey(controls.use_right.bind);
|
this.keyAction2 = this.input.keyboard.addKey(controls.use_right.bind);
|
||||||
this.keyEsc = this.input.keyboard.addKey(Phaser.Input.Keyboard.KeyCodes.ESC);
|
this.keyEsc = this.input.keyboard.addKey(Phaser.Input.Keyboard.KeyCodes.ESC);
|
||||||
|
|
||||||
this.physics.add.overlap(this.player, this.items, (p, i) => {
|
this.physics.add.overlap(this.player, this.interactables, (p, i) => {
|
||||||
if (this.keyPickup.isDown && i.canPickup()) {
|
if (this.keyPickup.isDown && i.canInteract()) {
|
||||||
p.pickup(i);
|
p.interact(i);
|
||||||
this.keyPickup.reset();
|
this.keyPickup.reset();
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@@ -311,12 +357,26 @@ export default class Game extends Phaser.Scene {
|
|||||||
console.log(s);
|
console.log(s);
|
||||||
new TextElement(this, s);
|
new TextElement(this, s);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
this.hearts = [];
|
||||||
|
for (let i = 0; i < this.player.getData('hp'); i++) {
|
||||||
|
this.hearts.push(this.add.image(i * 16, 0, 'heart')
|
||||||
|
.setScrollFactor(0, 0)
|
||||||
|
.setOrigin(0, 0));
|
||||||
|
}
|
||||||
|
|
||||||
|
this.music = this.sound.add('background_start', {volume: 0.5})
|
||||||
|
.once('complete', () => {
|
||||||
|
this.music = this.sound.add('background_loop', {loop: true, volume: 0.5});
|
||||||
|
this.music.play();
|
||||||
|
})
|
||||||
|
this.music.play();
|
||||||
}
|
}
|
||||||
|
|
||||||
update(time, delta) {
|
update(time, delta) {
|
||||||
if (this.keyEsc.isDown) {
|
if (this.keyEsc.isDown) {
|
||||||
this.scene.pause();
|
this.scene.pause();
|
||||||
|
this.music.pause();
|
||||||
this.input.keyboard.keys.forEach(k => k.reset());
|
this.input.keyboard.keys.forEach(k => k.reset());
|
||||||
this.scene.launch('GUI', {key: 'Pause'}).bringToTop('GUI');
|
this.scene.launch('GUI', {key: 'Pause'}).bringToTop('GUI');
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -21,6 +21,17 @@ import batDie from "../assets/BatDie.png";
|
|||||||
import item_01 from "../assets/items/itemshard_01.png";
|
import item_01 from "../assets/items/itemshard_01.png";
|
||||||
import item_02 from "../assets/items/itemshard_02.png";
|
import item_02 from "../assets/items/itemshard_02.png";
|
||||||
import item_03 from "../assets/items/itemshard_03.png";
|
import item_03 from "../assets/items/itemshard_03.png";
|
||||||
|
import heal from "../assets/items/heal.png";
|
||||||
|
import slow from "../assets/items/slow.png";
|
||||||
|
import speed from "../assets/items/speed.png";
|
||||||
|
import storm from "../assets/items/storm.png";
|
||||||
|
import heart from "../assets/heart.png";
|
||||||
|
import chest from "../assets/chest.png";
|
||||||
|
|
||||||
|
import menu_click from "../assets/audio/menu_click.wav";
|
||||||
|
import menu_hover from "../assets/audio/menu_hover.wav";
|
||||||
|
import background_start from "../assets/audio/background_start.wav";
|
||||||
|
import background_loop from "../assets/audio/background_loop.wav";
|
||||||
|
|
||||||
export default class Preload extends Phaser.Scene {
|
export default class Preload extends Phaser.Scene {
|
||||||
|
|
||||||
@@ -34,6 +45,7 @@ export default class Preload extends Phaser.Scene {
|
|||||||
this.load.image("item_01", item_01);
|
this.load.image("item_01", item_01);
|
||||||
this.load.image("item_02", item_02);
|
this.load.image("item_02", item_02);
|
||||||
this.load.image("item_03", item_03);
|
this.load.image("item_03", item_03);
|
||||||
|
this.load.image("heart", heart);
|
||||||
this.load.spritesheet('charA', charA, {frameWidth: 79, frameHeight: 63, margin: 1, spacing: 2});
|
this.load.spritesheet('charA', charA, {frameWidth: 79, frameHeight: 63, margin: 1, spacing: 2});
|
||||||
this.load.spritesheet('charB', charB, {frameWidth: 79, frameHeight: 63, margin: 1, spacing: 2});
|
this.load.spritesheet('charB', charB, {frameWidth: 79, frameHeight: 63, margin: 1, spacing: 2});
|
||||||
this.load.spritesheet('charC', charC, {frameWidth: 79, frameHeight: 63, margin: 1, spacing: 2});
|
this.load.spritesheet('charC', charC, {frameWidth: 79, frameHeight: 63, margin: 1, spacing: 2});
|
||||||
@@ -44,11 +56,21 @@ export default class Preload extends Phaser.Scene {
|
|||||||
this.load.spritesheet('buttontiles', buttontiles, {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('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.spritesheet('batDie', batDie, {frameWidth: 48, frameHeight: 32/*, margin: 1, spacing: 2*/});
|
||||||
|
this.load.spritesheet('chest', chest, {frameWidth: 32, frameHeight: 32, margin: 1, spacing: 2});
|
||||||
|
this.load.spritesheet('heal', heal, {frameWidth: 16, frameHeight: 16, margin: 1, spacing: 2});
|
||||||
|
this.load.spritesheet('storm', storm, {frameWidth: 16, frameHeight: 16, margin: 1, spacing: 2});
|
||||||
|
this.load.spritesheet('speed', speed, {frameWidth: 16, frameHeight: 16, margin: 1, spacing: 2});
|
||||||
|
this.load.spritesheet('slow', slow, {frameWidth: 16, frameHeight: 16, margin: 1, spacing: 2});
|
||||||
this.load.tilemapTiledJSON("map", map);
|
this.load.tilemapTiledJSON("map", map);
|
||||||
this.load.tilemapTiledJSON("menu", menu);
|
this.load.tilemapTiledJSON("menu", menu);
|
||||||
|
|
||||||
this.load.atlas({key: 'skeleton', textureURL: skeletonSprite, atlasURL: skeletonAtlas});
|
this.load.atlas({key: 'skeleton', textureURL: skeletonSprite, atlasURL: skeletonAtlas});
|
||||||
|
|
||||||
|
this.load.audio('menu_click', menu_click);
|
||||||
|
this.load.audio('menu_hover', menu_hover);
|
||||||
|
this.load.audio('background_start', background_start);
|
||||||
|
this.load.audio('background_loop', background_loop);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
create() {
|
create() {
|
||||||
@@ -113,4 +135,4 @@ export default class Preload extends Phaser.Scene {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||