pong: fix undefined function

This commit is contained in:
Trianta 2024-12-30 17:00:50 -06:00
parent 43f652f695
commit e2f111dd36

View File

@ -92,7 +92,7 @@ class PongCore {
} }
start() { start() {
setInterval(g_pong.loop, g_pong.timeout); setInterval(this.loop, this.timeout);
} }
reset() { reset() {
@ -111,13 +111,13 @@ class PongCore {
// Game loop // Game loop
loop() { loop() {
// Reset of needed // Reset of needed
if (this.gameover) if (g_pong.gameover)
this.reset(); g_pong.reset();
this.simulate(); g_pong.simulate();
this.draw(); g_pong.draw();
this.updatePageText(); g_pong.updatePageText();
} }
// Simulate game logic // Simulate game logic