2022-02-15 13:57:47 -05:00
|
|
|
|
2021-02-02 18:24:57 -05:00
|
|
|
import Game from "./Wolfie2D/Loop/Game";
|
2022-03-31 20:52:05 -04:00
|
|
|
import MainMenu from "./shattered_sword/Scenes/MainMenu";
|
2022-04-08 18:01:21 -04:00
|
|
|
import RegistryManager from "./Wolfie2D/Registry/RegistryManager";
|
|
|
|
import WeaponTemplateRegistry from "./shattered_sword/Registry/WeaponRegistry";
|
|
|
|
import WeaponTypeRegistry from "./shattered_sword/Registry/WeaponTypeRegistry";
|
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 = {
|
2022-04-19 12:05:52 -04:00
|
|
|
canvasSize: {x : 1920, y:1080},
|
2022-04-13 00:56:43 -04:00
|
|
|
//canvasSize: {x: window.innerWidth, y: window.innerHeight}, // The size of the game
|
2021-04-02 17:14:39 -04:00
|
|
|
clearColor: {r: 0, g: 0, b: 0}, // The color the game clears to
|
2022-04-02 21:09:01 -04:00
|
|
|
inputs: [
|
2022-04-06 15:20:11 -04:00
|
|
|
{name: "left", keys: ["a", "arrowleft"]}, //TODO - add arrow keys
|
|
|
|
{name: "right", keys: ["d", "arrowright"]},
|
2022-04-02 21:09:01 -04:00
|
|
|
{name: "up", keys: ["w"]},
|
|
|
|
{name: "down", keys: ["s"]},
|
|
|
|
{name: "jump", keys: ["x","space"]},
|
|
|
|
{name: "attack", keys: ["j","z","enter"]},
|
2022-04-14 21:22:52 -04:00
|
|
|
{name: "dash", keys: ["k","x"]}, //
|
2022-04-02 21:09:01 -04:00
|
|
|
{name: "skill", keys: ["l","v"]},
|
|
|
|
{name: "inventory", keys: ["i","b"]},
|
|
|
|
{name: "pause", keys: ["escape"]},
|
2022-04-17 19:52:01 -04:00
|
|
|
{name: "tab", keys: ["tab"]},
|
2022-04-09 04:49:30 -04:00
|
|
|
{name: "spawn", keys: ["q"]} //debug feature to test enemy spawning, press q to spawn enemy at current location
|
2022-04-02 21:09:01 -04:00
|
|
|
],
|
2022-03-31 20:52:05 -04:00
|
|
|
useWebGL: false, // Tell the game we want to use webgl
|
|
|
|
showDebug: true // Whether to show debug messages. You can change this to true if you want
|
2020-11-15 08:26:49 -05:00
|
|
|
}
|
|
|
|
|
2022-04-08 18:01:21 -04:00
|
|
|
|
|
|
|
// Set up custom registries
|
|
|
|
let weaponTemplateRegistry = new WeaponTemplateRegistry();
|
|
|
|
RegistryManager.addCustomRegistry("weaponTemplates", weaponTemplateRegistry);
|
|
|
|
|
|
|
|
let weaponTypeRegistry = new WeaponTypeRegistry();
|
|
|
|
RegistryManager.addCustomRegistry("weaponTypes", weaponTypeRegistry);
|
|
|
|
|
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
|
2022-04-02 21:09:01 -04:00
|
|
|
game.start(MainMenu, {});
|
|
|
|
//TODO - change to splash screen once available
|
|
|
|
//game.start(SplashScreen,{});
|
2021-02-19 15:35:57 -05:00
|
|
|
})();
|
|
|
|
|
|
|
|
function runTests(){};
|