Implement Engine Step Method
This commit is contained in:
parent
9030d31e97
commit
ac9a7c7591
2 changed files with 5 additions and 2 deletions
|
@ -39,8 +39,7 @@ class AppComponent implements OnInit {
|
||||||
}
|
}
|
||||||
|
|
||||||
void onStepClicked() {
|
void onStepClicked() {
|
||||||
engine.running = false;
|
engine.step();
|
||||||
engine.update();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void onResetClicked() {
|
void onResetClicked() {
|
||||||
|
|
|
@ -60,6 +60,10 @@ class Engine {
|
||||||
void update() {
|
void update() {
|
||||||
// print("updating");
|
// print("updating");
|
||||||
if(!grid.update()) running = false;
|
if(!grid.update()) running = false;
|
||||||
|
|
||||||
|
void step() {
|
||||||
|
running = false;
|
||||||
|
_grid.update();
|
||||||
}
|
}
|
||||||
|
|
||||||
void render([num interp]) {
|
void render([num interp]) {
|
||||||
|
|
Loading…
Reference in a new issue