// alert("hello world");
const tileSize = 16;
const babaX = 0;
const babaY = 0;


function setup(){
    createCanvas(800, 400);
    background(51);
}

function draw(){
    fill(255, 204, 0);
    square(babaX, babaY, 16);
}




// Move ASDW
function keyPressed(){
    console.log(`key ${key} is pressed.`)
    if(key=='a'||key=='A') {
        babaX -= tileSize;
        console.log('Left');
    }
    if(key=='s'||key=='S') {
        babaY -= tileSize;
        console.log('Down');
    }
    if(key=='d'||key=='D') {
        babaX += tileSize;
        console.log('Right');
    }
    if(key=='w'||key=='W') {
        babaY += tileSize;
        console.log('Up');
    }
}