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() {
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