-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathwilkens.js
More file actions
70 lines (58 loc) · 1.63 KB
/
wilkens.js
File metadata and controls
70 lines (58 loc) · 1.63 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
function wilkens() {
// creates a new array of sprites
let sprites = [];
// let miniMap = {
// x: 50,
// y: 50,
// size: 400,
// draw: function () {
// fill('orange');
// rect(this.x, this.y, this.size, this.size);
// }
// };
this.setup = function () {
music.stopAll();
music.Wilkens.loop();
// pushes sprites into the sprite array
for(let i = 9; i < 12; i++){
sprites.push(new Sprite(propArray[i], 50 + i * 20, 5, 20, 20));
}
}
this.draw = function () {
wilkensDisplay.draw();
QuadWilkensZone.zone();
player.draw();
player.move(keyCode);
// draws the sprites
for (s of sprites) {
s.draw();
}
// what allows for the props to change image
if (mouseIsPressed && (mouseY < 24) && (mouseY > 3) && (mouseX > 232) && (mouseX < 246)) {
player.image = propArray[9];
}
if (mouseIsPressed && (mouseY < 24) && (mouseY > 3) && (mouseX > 250) && (mouseX < 265)) {
player.image = propArray[10];
}
if (mouseIsPressed && (mouseY < 24) && (mouseY > 3) && (mouseX > 268) && (mouseX < 280)) {
player.image = propArray[11];
}
// let mapOn = false;
// if (keyIsPressed) {
// if (keyCode === SHIFT) {
// mapOn = true;
// } else {
// mapOn = false;
// }
// }
// if (mapOn === true) {
// miniMap.draw();
// }
let QuadDist = dist(player.x, player.y, QuadWilkensZone.x + QuadWilkensZone.size / 2, QuadWilkensZone.y + QuadWilkensZone.size / 2);
if (QuadDist < 50) {
this.sceneManager.showScene(Quad);
player.x = 50;
player.y = 500;
}
}
}