Welcome to my Website!

Challenge: Moles in Holes

Made using: Khan Academy Computer Science

Challenge: Calculator

Made using: Khan Academy Computer Science

Spin-off of "Project: Fish Tank"

Made using: Khan Academy Computer Science

Challenge: Your First Painting App

Made using: Khan Academy Computer Science

Challenge: Your First Button

Made using: Khan Academy Computer Science

Spin-off of "Project: Magic 8-Ball"

Made using: Khan Academy Computer Science

Whack-A-Mole

Made using: Khan Academy Computer Science

To learn more HTML/CSS, check out these tutorials!

/* Some starter code to help with Whack-A-Mole */ var moleLocation = 0; var interval = 2; //will change mole location every two seconds var once = true; var rock = getImage("cute/Rock"); var drawMole = function(moleX, moleY) { noStroke(); fill(125, 93, 43); ellipse(moleX, moleY, 60, 60); // face fill(255, 237, 209); ellipse(moleX, moleY+10, 33, 28); fill(0, 0, 0); ellipse(moleX-10, moleY-15, 10, 10); // eyes ellipse(moleX+10, moleY-15, 10, 10); ellipse(moleX, moleY-5, 10, 10); // nose ellipse(moleX, moleY+10, 20, 5); // mouth }; var changeMoleLocation = function() { var randomDecimal = random(0, 4); moleLocation = Math.floor(randomDecimal); once = false; }; var draw = function() { imageMode(CENTER); background(52, 168, 83); // green grass fill(0, 0, 0); ellipse(200, 200, 100, 30); // holes! ellipse(70, 119, 100, 30); ellipse(300, 60, 100, 30); ellipse(297, 350, 100, 30); if(moleLocation === 0) { drawMole(70, 100); } else if (moleLocation === 1) { drawMole(200,200); } else if(moleLocation === 2) { drawMole (70,119); } else if(moleLocation ===3) { drawMole (300,60); } //Udate with further conditionals for more locations //Update Mole Location var time = second(); if (time % interval === 0) { if(once) { changeMoleLocation(); } } else { once = true; } //Debug Text text("Mole Location: " + moleLocation, 10, 20, 200, 20); //Draw an object that acts as a hammer image(rock, mouseX, mouseY, 50, 50); //Set the position to the mouseX and mouseY //Determine Distance between hammer and mole //If distance is within a range---HIT! };