2021-02-02 18:24:57 -05:00
|
|
|
import Game from "./Wolfie2D/Loop/Game";
|
2021-04-02 13:23:34 -04:00
|
|
|
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(){
|
2021-02-19 15:35:57 -05:00
|
|
|
// Run any tests
|
|
|
|
runTests();
|
|
|
|
|
|
|
|
// Set up options for our game
|
2020-11-15 08:26:49 -05:00
|
|
|
let options = {
|
2021-02-19 15:35:57 -05:00
|
|
|
canvasSize: {x: 1200, y: 800}, // The size of the game
|
2021-03-18 17:28:05 -04:00
|
|
|
clearColor: {r: 34, g: 32, b: 52}, // The color the game clears to
|
|
|
|
inputs: [
|
|
|
|
{name: "left", keys: ["a"]},
|
|
|
|
{name: "right", keys: ["d"]},
|
|
|
|
{name: "jump", keys: ["w", "space"]},
|
|
|
|
{name: "run", keys: ["shift"]}
|
|
|
|
],
|
|
|
|
useWebGL: false, // Tell the game we want to use webgl
|
2021-02-19 15:35:57 -05:00
|
|
|
showDebug: false // Whether to show debug messages. You can change this to true if you want
|
2020-11-15 08:26:49 -05:00
|
|
|
}
|
|
|
|
|
2021-02-15 19:44:47 -05:00
|
|
|
// Create a game with the options specified
|
|
|
|
const game = new Game(options);
|
2020-08-03 16:51:20 -04:00
|
|
|
|
2021-02-15 19:44:47 -05:00
|
|
|
// Start our game
|
2021-04-02 13:23:34 -04:00
|
|
|
game.start(default_scene, {});
|
2021-02-19 15:35:57 -05:00
|
|
|
})();
|
|
|
|
|
|
|
|
function runTests(){};
|