xxxxxxxxxx
52
let place;
let score;
let streak;
let bestStreak;
let highScore;
let per;
let shots;
let misses;
let img;
function preload() {
img = loadImage("sloth.png");
}
function setup() {
createCanvas(400, 400);
score = 0;
streak = 0;
bestStreak = 0;
highScore = 0;
per = 100;
shots = 0;
misses = 0;
}
function draw() {
background(220);
noStroke();
text("Score: " + score, 10, height - 100);
text("Streak: " + streak, 10, height - 85);
text("Longest streak: " + bestStreak, 10, height - 70);
text("High score: " + highScore, 10, height - 55);
text("Misses: " + misses, 10, height - 40);
text("Shots: " + shots, 10, height - 25);
text("Percentage: " + per + "%", 10, height - 10);
stroke(255, 0, 0);
strokeWeight(5);
line(width / 2, height * 0.75, width / 2, 0);
image(img, width / 2 - height / 8, height * 0.75, height / 4, height / 4);
}