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:
+16
-12
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user