// Write your code here
// - `context` is the canvas context
// - `persistent` is an empty object which is preserved between frames
if(persistent.i === undefined) {
persistent.i = 0;
}
if(persistent.jumping === undefined) {
persistent.jumping = false;
}
if(persistent.jumpTime === undefined) {
persistent.jumpTime = 0;
}
if(persistent.sprite === undefined) {
persistent.sprite = 0;
}
if(persistent.shellSprite === undefined) {
persistent.shellSprite = 0;
}
// Background
persistent.i += 1;
context.fillStyle = "#406f1c";
context.fillRect(0, 0, 32, 32);
// Background spheres
const bgOffset = persistent.i / 4 % 170 * -1
context.fillStyle = "#5e8226";
context.beginPath();
context.arc(bgOffset + 70, 30, 34, 0, 2 * Math.PI);
context.fill();