2021-02-02 18:24:57 -05:00
|
|
|
import Game from "./Wolfie2D/Loop/Game";
|
|
|
|
import default_scene from "./default_scene";
|
2020-08-03 16:51:20 -04:00
|
|
|
|
2021-02-02 18:24:57 -05:00
|
|
|
// The main function is your entrypoint into Wolfie2D. Specify your first scene and any options here.
|
|
|
|
(function main(){
|
|
|
|
// These are options for initializing the game
|
|
|
|
// Here, we'll simply set the size of the viewport, and make the background of the game black
|
2020-11-15 08:26:49 -05:00
|
|
|
let options = {
|
|
|
|
viewportSize: {x: 800, y: 600},
|
2021-02-02 18:24:57 -05:00
|
|
|
clearColor: {r: 0, g: 0, b: 0},
|
2020-11-15 08:26:49 -05:00
|
|
|
}
|
|
|
|
|
2021-02-02 18:24:57 -05:00
|
|
|
// Create our game. This will create all of the systems.
|
|
|
|
const demoGame = new Game(options);
|
2020-11-16 11:02:45 -05:00
|
|
|
|
2021-02-02 18:24:57 -05:00
|
|
|
// Run our game. This will start the game loop and get the updates and renders running.
|
|
|
|
demoGame.start();
|
2020-08-03 16:51:20 -04:00
|
|
|
|
2021-02-02 18:24:57 -05:00
|
|
|
// For now, we won't specify any scene options.
|
|
|
|
let sceneOptions = {};
|
2020-08-11 19:55:05 -04:00
|
|
|
|
2021-02-02 18:24:57 -05:00
|
|
|
// Add our first scene. This will load this scene into the game world.
|
|
|
|
demoGame.getSceneManager().addScene(default_scene, sceneOptions);
|
|
|
|
})();
|