A Top-down view shooting game framework.
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.
To start a .event
CG.TwilightWarsLib.initialize()
.then(() => {
CG.TwilightWarsLib.events.startEvents('test/test.events', 'arena');
})
To manually setup the game:
CG.TwilightWarsLib.initialize()
.then(() =>
let mapSource = 'test/test.twmap';
CG.Base.resourceManager.addAppSource(mapSource);
CG.Base.resourceManager.load(() => {
let mapResource = new CG.TWMap.resources.MapResource();
mapResource.importBase64(CG.Base.resourceManager.getText(mapSource));
mapResource.loadTextures(() => {
CG.Base.pixi.initialize(600, 500);
let game = new CG.TwilightWarsLib.games.Game();
CG.Base.pixi.root.addChild(game);
game.initResources(mapResource);
game.start();
console.log('tw game created');
let me = new CG.TwilightWarsLib.games.actors.Actor(game, 'me');
game.addActor(me, new MyActorController(me), 32, 100, 0, null);
game.gameCamera.setFocus(me);
game.interface.setMe(me);
let ai = new CG.TwilightWarsLib.games.actors.Actor(game, 'ai');
ai.camp = CG.TwilightWarsLib.games.datas.Camp.CAMP2;
ai.actorClip.headClip.clip.gotoAndStop(5);
game.addActor(ai, new CG.TwilightWarsLib.games.actors.controllers.AIController(ai), 160, 300, 0, null);
game.createStuff(null, 64 + 16, 128 + 16,
CG.TwilightWarsLib.games.items.StuffInfo.getByCode('sword'),
game.stuffManager.useNextStuffId(), true);
});
});
})
We use SemVer for versioning.