Update JS

This commit is contained in:
Bluwww 2025-11-24 14:38:41 +07:00
parent ae9a226bb9
commit 6d84240c67

View File

@ -5,6 +5,14 @@ var canvasHeight = 650;
var c = undefined var c = undefined
var ctx = undefined var ctx = undefined
var game = {
level: 1,
speed: 1,
gameOver: false,
frames: 0,
timer: 0,
}
window.onload = function () { window.onload = function () {
init() init()
} }
@ -21,16 +29,22 @@ function keyDownPressed(e){
} }
function keyDownPressed(e){ function keyUpPressed(e){
} }
function clearGame(){ function clearGame() {
ctx.save(); ctx.clearRect(0, 0, canvasWidth, canvasHeight);
ctx.fillStyle = 'white'; }
ctx.fillReact(100, 100, 100, 100);
ctx.fill(); function updateGame() {
ctx.restore();
game.frames++;
}
function drawGame() {
} }
function gameLoop(timestamp){ function gameLoop(timestamp){