added entitys, enemys, bats and custom attack hitboxes for players

added map loading and one-way collision (needs to move to tiled attribute tho)

Signed-off-by: Pascal Syma <pascal@syma.dev>
This commit is contained in:
2020-05-20 11:13:21 +02:00
parent 4a22dbe657
commit a726db1306
22 changed files with 2166 additions and 30 deletions
+16 -12
View File
@@ -5,23 +5,27 @@
import Phaser from "phaser";
import Menu from "./scenes/Menu";
import Preload from "./scenes/Preload";
import Game from "./scenes/Game";
const ratio = 16 / 9; // any ratio you want, 16/9 landscape or 9/16 portrait
const DEFAULT_HEIGHT = 1080; // any height you want
const DEFAULT_HEIGHT = 1080 / 4; // any height you want
const DEFAULT_WIDTH = ratio * DEFAULT_HEIGHT;
const config = {
type: Phaser.AUTO,
scale: {
mode: Phaser.Scale.FIT,
autoCenter: Phaser.Scale.CENTER_BOTH,
width: DEFAULT_WIDTH,
height: DEFAULT_HEIGHT
},
parent: "phaser-example",
scene: [Menu],
// pixelArt: true,
// roundPixels: true
type: Phaser.AUTO,
scale: {
mode: Phaser.Scale.FIT,
autoCenter: Phaser.Scale.CENTER_BOTH,
width: DEFAULT_WIDTH,
height: DEFAULT_HEIGHT
},
parent: "phaser-example",
scene: [Preload, Menu, Game],
pixelArt: true,
antialias: false,
// pixelArt: true,
// roundPixels: true
};
const game = new Phaser.Game(config);