summary refs log blame commit diff stats
path: root/test/tc_history.py
blob: 18f71e3523707a54d9b20835360eff5441a29dc9 (plain) (tree)
nx">npc.height && player.y + player.height > npc.y) { // collision detected! console.log('collision detected!'); // change the color of the NPC npc.color = 'red'; } // draw // ctx.fillStyle = player.color; ctx.fillRect(player.x, player.y, player.width, player.height); ctx.drawImage(playerSprite, player.x, player.y, player.width, player.height); drawNPC(); // next frame requestAnimationFrame(gameLoop); } // start the game loop requestAnimationFrame(gameLoop);