pong: fix undefined function
This commit is contained in:
parent
43f652f695
commit
e2f111dd36
12
src/pong.ts
12
src/pong.ts
@ -92,7 +92,7 @@ class PongCore {
|
||||
}
|
||||
|
||||
start() {
|
||||
setInterval(g_pong.loop, g_pong.timeout);
|
||||
setInterval(this.loop, this.timeout);
|
||||
}
|
||||
|
||||
reset() {
|
||||
@ -111,13 +111,13 @@ class PongCore {
|
||||
// Game loop
|
||||
loop() {
|
||||
// Reset of needed
|
||||
if (this.gameover)
|
||||
this.reset();
|
||||
if (g_pong.gameover)
|
||||
g_pong.reset();
|
||||
|
||||
this.simulate();
|
||||
g_pong.simulate();
|
||||
|
||||
this.draw();
|
||||
this.updatePageText();
|
||||
g_pong.draw();
|
||||
g_pong.updatePageText();
|
||||
}
|
||||
|
||||
// Simulate game logic
|
||||
|
Loading…
Reference in New Issue
Block a user