Skip to content
This repository has been archived by the owner on Nov 9, 2021. It is now read-only.

Commit

Permalink
Kleuren spelbord aangepast
Browse files Browse the repository at this point in the history
  • Loading branch information
dylansealy committed Dec 31, 2020
1 parent cc619c6 commit fc2115e
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 10 deletions.
2 changes: 1 addition & 1 deletion dist/assets/js/gameBoard/GameBoard.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ export default class GameBoard {
this.draw = () => {
this.frameRate = Math.round(this.p.frameRate());
this.p.push();
this.p.stroke("#2121DE");
this.p.stroke("#7092BE");
this.p.strokeWeight(3);
this.p.rect(this.xInner, this.yInner, this.innerWidth, this.innerHeight, 4);
this.p.rect(this.xOuter, this.yOuter, this.outerWidth, this.outerHeight, 10);
Expand Down
7 changes: 5 additions & 2 deletions dist/assets/js/gameBoard/Obstacle.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
export default class Obstacle {
constructor(p, v, xMin, yMin, xMax, yMax) {
this.draw = () => {
this.draw = (index) => {
this.p.push();
this.p.stroke("#2121DE");
if (index != 5) {
this.p.fill("#7092BE");
}
this.p.stroke("#7092BE");
this.p.strokeWeight(2);
this.p.rect(this.xPosition, this.yPosition, this.width, this.height, 4);
this.p.pop();
Expand Down
2 changes: 1 addition & 1 deletion dist/assets/js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ const sketch = (p) => {
p.background("black");
v.gameBoard.draw();
for (const obstacle in v.obstacles) {
v.obstacles[obstacle].draw();
v.obstacles[obstacle].draw(obstacle);
}
for (const pellet in v.pellets) {
v.pellets[pellet].draw();
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "hoog-man",
"version": "1.0.0",
"version": "1.0.1",
"repository": {
"type": "git",
"url": "git+https://github.com/DylanSealy/Hoog-Man.git"
Expand Down
2 changes: 1 addition & 1 deletion src/assets/ts/Types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export interface ObstacleInterface {
v: GameVariables;
xPosition: number;
yPosition: number;
draw: () => void;
draw: (index: number) => void;
}
export interface CharacterInterface {
collision: boolean;
Expand Down
2 changes: 1 addition & 1 deletion src/assets/ts/gameBoard/GameBoard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export default class GameBoard implements GameBoardInterface {
this.frameRate = Math.round(this.p.frameRate());
this.p.push();
// Tekent de buitenlijnen.
this.p.stroke("#2121DE");
this.p.stroke("#7092BE");
this.p.strokeWeight(3);
this.p.rect(this.xInner, this.yInner, this.innerWidth, this.innerHeight, 4);
this.p.rect(this.xOuter, this.yOuter, this.outerWidth, this.outerHeight, 10);
Expand Down
5 changes: 3 additions & 2 deletions src/assets/ts/gameBoard/Obstacle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,10 @@ export default class Obstacle implements ObstacleInterface {
this.width = this.v.gameBoard.yInner + this.v.gameBoard.widthUnit * xMax - this.xPosition;
this.p = p;
}
draw: () => void = () => {
draw: (index: number) => void = (index) => {
this.p.push();
this.p.stroke("#2121DE");
if (index != 5) {this.p.fill("#7092BE")}
this.p.stroke("#7092BE");
this.p.strokeWeight(2);
this.p.rect(this.xPosition, this.yPosition, this.width, this.height, 4);
this.p.pop();
Expand Down
2 changes: 1 addition & 1 deletion src/assets/ts/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ const sketch = (p: p5): void => { // Sketch wordt gebruikt voor instance mode p5
p.draw = (): void => {
p.background("black");
v.gameBoard.draw();
for (const obstacle in v.obstacles) {v.obstacles[obstacle].draw();}
for (const obstacle in v.obstacles) {v.obstacles[obstacle].draw(obstacle);}
for (const pellet in v.pellets) {
v.pellets[pellet].draw();
v.pellets[pellet].checkEaten(pellet);
Expand Down

0 comments on commit fc2115e

Please sign in to comment.