You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
681 B
29 lines
681 B
import Phaser from "phaser";
|
|
import BootScene from "./scenes/BootScene";
|
|
import PlayScene from "./scenes/PlayScene";
|
|
//import { * } from "./constant";
|
|
|
|
function launch(containerId) {
|
|
const container = document.getElementById(containerId);
|
|
const width = container.clientWidth;
|
|
const height = container.clientHeight;
|
|
return new Phaser.Game({
|
|
type: Phaser.WEBGL,
|
|
width,
|
|
height,
|
|
parent: containerId,
|
|
backgroundColor: 0xbbada0,
|
|
pixelArt: true,
|
|
physics: {
|
|
default: "arcade",
|
|
arcade: {
|
|
//gravity: { y: 300 },
|
|
debug: true,
|
|
},
|
|
},
|
|
scene: [BootScene, PlayScene],
|
|
});
|
|
}
|
|
|
|
export default launch;
|
|
export { launch };
|
|
|