you can change this text in the javascript editor. the variable name is text and can be changed by text.textContent = "text"
setInterval(function(){
rect(Math.floor(Math.random() * canvas.width), Math.floor(Math.random() * canvas.height), 5, 5);
}, 100);
game where you can walk around with W A S D
let x = 0;
let y = 0;
const speed = 5;
let keys = {};
document.addEventListener("keydown", (event) => {
keys[event.key] = true;
});
document.addEventListener("keyup", (event) => {
keys[event.key] = false;
});
function game() {
ctx.clearRect(0, 0, canvas.width, canvas.height)
if(keys["w"]) { y -= speed; }
if(keys["s"]) { y += speed; }
if(keys["a"]) { x -= speed; }
if(keys["d"]) { x += speed; }
ctx.fillRect(x, y, 20, 20);
requestAnimationFrame(game);
}
game();
get 600 neocoins every minute!
setInterval(function() {
plusNeocoin();
text.textContent = "neocoins: " + +localStorage.getItem("neocoin");
}, 100);