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 ctx = undefined
var game = {
level: 1,
speed: 1,
gameOver: false,
frames: 0,
timer: 0,
}
window.onload = function () {
init()
}
@ -21,21 +29,27 @@ function keyDownPressed(e){
}
function keyDownPressed(e){
function keyUpPressed(e){
}
function clearGame(){
ctx.save();
ctx.fillStyle = 'white';
ctx.fillReact(100, 100, 100, 100);
ctx.fill();
ctx.restore();
function clearGame() {
ctx.clearRect(0, 0, canvasWidth, canvasHeight);
}
function updateGame() {
game.frames++;
}
function drawGame() {
}
function gameLoop(timestamp){
clearGame();
updateGame();
drawGame();
window.requestAnimationFrame(gameLoop);
clearGame();
updateGame();
drawGame();
window.requestAnimationFrame(gameLoop);
}