Skip to content

Commit c7e1c32

Browse files
authored
Create Blake C.js
1 parent f62ea68 commit c7e1c32

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

Diff for: Blake C.js

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
var present = createSprite(200, 270, 30, 30);
2+
present.setAnimation("present");
3+
var surprise1 = createSprite(100, 200, 75, 75);
4+
surprise1.setAnimation("bike");
5+
surprise1.visible = false;
6+
var surprise2 = createSprite(300, 200, 75, 75);
7+
surprise2.setAnimation("puppy");
8+
surprise2.visible = false;
9+
var shake_count = 0;
10+
function draw() {
11+
background("green");
12+
if (mouseDidMove()) {
13+
present.rotation = randomNumber(-10, 10);
14+
shake_count = shake_count + 1;
15+
}
16+
if (shake_count > 100){
17+
present.visible = false;
18+
surprise1.visible = true;
19+
surprise2.visible = true;
20+
}
21+
// Make the surprises do cool stuff
22+
surprise1.rotation = surprise1.rotation + 1;
23+
surprise2.x = 275 + randomNumber(0,50);
24+
surprise2.y = 175 + randomNumber(0, 50);
25+
fill('black');
26+
textSize(20);
27+
text("Move the mouse to get your present", 25, 360);
28+
drawSprites();
29+
}

0 commit comments

Comments
 (0)