display scores
parent
42165639f2
commit
6405deb338
@ -1,15 +1,42 @@
|
|||||||
class Bank {
|
class Bank {
|
||||||
constructor() {
|
constructor(options) {
|
||||||
|
options = options || {};
|
||||||
|
this.position = {
|
||||||
|
x: options.x,
|
||||||
|
y: options.y
|
||||||
|
};
|
||||||
|
this.width = options.width;
|
||||||
|
this.height = options.height;
|
||||||
}
|
}
|
||||||
|
|
||||||
draw(x, y, w, h) {
|
draw() {
|
||||||
|
let corner = {
|
||||||
|
x: this.position.x - this.width*0.5,
|
||||||
|
y: this.position.y - this.height*0.5
|
||||||
|
};
|
||||||
|
let half = {
|
||||||
|
width: this.width * 0.5,
|
||||||
|
height: this.height * 0.5,
|
||||||
|
};
|
||||||
tint(Colors.Eggplant);
|
tint(Colors.Eggplant);
|
||||||
let purple = color(Colors.Eggplant);
|
let purple = color(Colors.Eggplant);
|
||||||
noFill();
|
noFill();
|
||||||
stroke(purple);
|
stroke(purple);
|
||||||
strokeWeight(2);
|
strokeWeight(2);
|
||||||
rect(x, y, w, h);
|
rect(corner.x, corner.y, this.width, this.height);
|
||||||
image(Images.bank, x, y, w, h);
|
image(Images.bank, corner.x, corner.y, this.width, this.height);
|
||||||
|
|
||||||
|
if (debug) {
|
||||||
|
strokeWeight(4);
|
||||||
|
stroke('#FF0000');
|
||||||
|
point(this.position.x, this.position.y);
|
||||||
|
strokeWeight(1);
|
||||||
|
noFill();
|
||||||
|
rect(corner.x, corner.y, this.width, this.height);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Bank.prototype.bounds = bounds;
|
||||||
|
Bank.prototype.outOfBounds = outOfBounds;
|
||||||
|
Bank.prototype.overlaps = overlaps;
|
||||||
|
@ -1,15 +1,43 @@
|
|||||||
class Store {
|
class Store {
|
||||||
constructor() {
|
constructor(options) {
|
||||||
|
options = options || {};
|
||||||
|
this.position = {
|
||||||
|
x: options.x,
|
||||||
|
y: options.y
|
||||||
|
};
|
||||||
|
this.width = options.width;
|
||||||
|
this.height = options.height;
|
||||||
}
|
}
|
||||||
|
|
||||||
draw(x, y, w, h) {
|
draw() {
|
||||||
|
let corner = {
|
||||||
|
x: this.position.x - this.width*0.5,
|
||||||
|
y: this.position.y - this.height*0.5
|
||||||
|
};
|
||||||
|
let half = {
|
||||||
|
width: this.width * 0.5,
|
||||||
|
height: this.height * 0.5,
|
||||||
|
};
|
||||||
tint(Colors.Eggplant);
|
tint(Colors.Eggplant);
|
||||||
let purple = color(Colors.Eggplant);
|
let purple = color(Colors.Eggplant);
|
||||||
noFill();
|
noFill();
|
||||||
|
|
||||||
stroke(purple);
|
stroke(purple);
|
||||||
strokeWeight(2);
|
strokeWeight(2);
|
||||||
rect(x, y, w, h);
|
rect(corner.x, corner.y, this.width, this.height);
|
||||||
image(Images.restaurant, x, y, w, h);
|
image(Images.restaurant, corner.x, corner.y, this.width, this.height);
|
||||||
|
|
||||||
|
if (debug) {
|
||||||
|
strokeWeight(4);
|
||||||
|
stroke('#FF0000');
|
||||||
|
point(this.position.x, this.position.y);
|
||||||
|
strokeWeight(1);
|
||||||
|
noFill();
|
||||||
|
rect(corner.x, corner.y, this.width, this.height);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Store.prototype.bounds = bounds;
|
||||||
|
Store.prototype.outOfBounds = outOfBounds;
|
||||||
|
Store.prototype.overlaps = overlaps;
|
||||||
|
Loading…
Reference in New Issue