input handlers
This commit is contained in:
@@ -5,6 +5,7 @@ import { GdRoot } from './data/GdRoot';
|
||||
import { SimCommand } from './sim/commands/SimCommand';
|
||||
import { VisMain } from './vis/VisMain';
|
||||
import { SplashComponent } from '../splash/splash.component';
|
||||
import { SimCommandStartNextWave } from './sim/commands/SimCommandStartNextWave';
|
||||
|
||||
@Component({
|
||||
selector: 'app-game',
|
||||
@@ -27,7 +28,6 @@ export class GameComponent {
|
||||
const gdRoot = await this.loadGdRoot();
|
||||
this.simMain.setGdRoot(gdRoot);
|
||||
this.visMain = new VisMain(this.simMain, SplashComponent.assetPreloader, this.wrapperRef.nativeElement, this.canvasRef.nativeElement);
|
||||
window.addEventListener('resize', _ => this.visMain.onResized());
|
||||
}
|
||||
|
||||
start() {
|
||||
@@ -35,15 +35,24 @@ export class GameComponent {
|
||||
}
|
||||
|
||||
stop() {
|
||||
this.visMain.start();
|
||||
this.visMain.stop();
|
||||
}
|
||||
|
||||
step() {
|
||||
this.simMain.step();
|
||||
this.visMain.onRender();
|
||||
}
|
||||
|
||||
rewind() {
|
||||
//this.simMain.rewindToZero();
|
||||
if (this.simMain.currentLevel)
|
||||
this.simMain.currentLevel.currentStep = -1;
|
||||
|
||||
this.simMain.currentStep = -1;
|
||||
}
|
||||
|
||||
startNextWave() {
|
||||
this.simMain.addCommand(new SimCommandStartNextWave());
|
||||
this.simMain.currentLevel!.paused = false;
|
||||
}
|
||||
|
||||
fastForward() {
|
||||
|
||||
Reference in New Issue
Block a user