Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
// this.scheduler.add(new PlayerController(), true) // Add the player to the scheduler
this.scheduler.add(this.player, true) // Add the player to the scheduler
this.scheduler.add(this.display, true)
let actors = this.map.getActors()
for (let actor of actors) {
if (actor.seenTiles) actor.seenTiles = []
// Some 'actor' objects do not take turns, such as ladders / items
if (actor !== this.player && actor instanceof Actor) {
this.scheduler.add(actor, true)
// if the actor is goal driven, clear their current goals
if (actor.subscribeToEventStream) actor.clearGoals()
}
}
// emit a new spawned event when each actor gets loaded in
actors.forEach(actor => this.eventStream.emit('EntitySpawnedEvent', { entity: actor }))
this.engine = new ROT.Engine(this.scheduler) // Create new engine with the newly created scheduler
},
setup() {
this.scheduler = new ROT.Scheduler.Speed();
this.engine = new ROT.Engine(this.scheduler);
/* if(false) {
this.loadOldData();
return;
}
*/
this.startNewGame();
}
setup() {
this.scheduler = new ROT.Scheduler.Speed();
this.engine = new ROT.Engine(this.scheduler);
/* if(false) {
this.loadOldData();
return;
}
*/
this.startNewGame();
}