diff --git a/.DS_Store b/.DS_Store index 5008ddf..8a0587b 100644 Binary files a/.DS_Store and b/.DS_Store differ diff --git a/assets/.DS_Store b/assets/.DS_Store new file mode 100644 index 0000000..ac509dc Binary files /dev/null and b/assets/.DS_Store differ diff --git a/assets/img/.DS_Store b/assets/img/.DS_Store new file mode 100644 index 0000000..4082006 Binary files /dev/null and b/assets/img/.DS_Store differ diff --git a/src/Game/game.ts b/src/Game/game.ts index 1c540f6..b306af5 100644 --- a/src/Game/game.ts +++ b/src/Game/game.ts @@ -17,7 +17,7 @@ class Game { } public nextLevel() { - if (this.currentLevelNumber < 3) { + if (this.currentLevelNumber < 7) { this.currentLevelNumber++; this.level = this.levelFactory.generateLevel( this.currentLevelNumber, diff --git a/src/Game/levelFactory.ts b/src/Game/levelFactory.ts index c57afae..514b666 100644 --- a/src/Game/levelFactory.ts +++ b/src/Game/levelFactory.ts @@ -12,9 +12,13 @@ class LevelFactory { public numbersGridLevel1: number[][]; - public levelImage: p5.Image; public numbersGridLevel2: number[][]; public numbersGridLevel3: number[][]; + public numbersGridLevel4: number[][]; + public numbersGridLevel5: number[][]; + public numbersGridLevel6: number[][]; + public numbersGridLevel7: number[][]; + public levelImage: p5.Image; constructor() { // prettier-ignore @@ -74,8 +78,80 @@ class LevelFactory { [10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10], ]; + // prettier-ignore + this.numbersGridLevel4= [ + [10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10], + [10, 20, 13, 20, 20, 20, 20, 20, 20, 14, 20, 14, 11, 14, 20, 20, 20, 20, 14, 20, 11, 14, 18, 20, 10], + [10, 20, 11, 11, 11, 11, 11, 13, 11, 11, 11, 11, 11, 20, 11, 11, 11, 20, 11, 20, 11, 11, 11, 13, 10], + [10, 20, 11, 20, 13, 20, 11, 20, 20, 20, 20, 20, 20, 20, 20, 14, 11, 20, 11, 20, 14, 20, 20, 20, 10], + [10, 14, 11, 20, 11, 14, 11, 20, 11, 11, 11, 11, 11, 20, 11, 11, 11, 20, 11, 11, 11, 20, 11, 20, 10], + [10, 20, 11, 20, 11, 20, 11, 14, 11, 20, 14, 20, 11, 20, 20, 13, 13, 20, 20, 11, 13, 20, 11, 14, 10], + [10, 14, 11, 20, 11, 14, 11, 20, 11, 20, 11, 20, 11, 20, 20, 11, 11, 11, 20, 11, 20, 11, 11, 20, 10], + [10, 11, 11, 20, 11, 20, 11, 14, 11, 20, 11, 16, 11, 20, 20, 14, 14, 11, 20, 11, 20, 14, 11, 20, 10], + [10, 20, 20, 14, 11, 20, 11, 20, 11, 20, 11, 11, 11, 20, 20, 11, 11, 11, 20, 11, 11, 20, 11, 20, 17], + [10, 20, 11, 11, 11, 20, 11, 20, 11, 14, 20, 20, 13, 20, 20, 20, 20, 20, 20, 11, 14, 20, 11, 11, 10], + [10, 20, 11, 20, 14, 20, 13, 20, 11, 11, 11, 11, 11, 20, 11, 11, 11, 11, 20, 11, 20, 11, 11, 16, 10], + [10, 20, 11, 20, 11, 11, 11, 11, 11, 20, 20, 20, 20, 20, 11, 20, 14, 11, 20, 11, 20, 14, 11, 20, 10], + [10, 20, 11, 20, 11, 20, 20, 20, 13, 20, 20, 11, 11, 20, 11, 20, 11, 11, 20, 11, 11, 11, 11, 20, 10], + [10, 15, 11, 16, 11, 14, 11, 14, 11, 20, 20, 14, 20, 20, 11, 14, 20, 13, 20, 14, 20, 14, 20, 13, 10], + [10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10], +]; + + // prettier-ignore + this.numbersGridLevel5= [ + [10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10], + [10, 15, 20, 20, 20, 20, 11, 16, 11, 20, 20, 20, 14, 20, 20, 20, 11, 20, 20, 13, 20, 20, 18, 20, 10], + [10, 11, 11, 11, 11, 20, 11, 20, 11, 20, 11, 11, 11, 11, 11, 20, 11, 20, 11, 11, 11, 11, 11, 13, 10], + [10, 20, 20, 20, 20, 20, 11, 20, 11, 20, 20, 20, 20, 14, 11, 20, 11, 20, 14, 11, 20, 14, 11, 14, 10], + [10, 20, 11, 11, 11, 20, 11, 14, 11, 20, 11, 13, 11, 11, 11, 20, 11, 11, 11, 11, 20, 20, 11, 20, 10], + [10, 20, 11, 16, 11, 20, 11, 20, 11, 20, 11, 20, 11, 20, 20, 20, 14, 20, 20, 14, 20, 20, 11, 20, 10], + [10, 20, 11, 14, 11, 14, 11, 20, 11, 20, 11, 20, 11, 11, 11, 20, 11, 13, 11, 11, 11, 20, 11, 16, 10], + [10, 20, 11, 20, 11, 20, 11, 14, 11, 20, 11, 20, 20, 14, 11, 20, 11, 20, 11, 14, 11, 20, 11, 11, 10], + [10, 20, 11, 14, 11, 20, 11, 11, 11, 20, 11, 20, 11, 11, 11, 20, 11, 20, 11, 14, 11, 20, 11, 20, 17], + [10, 20, 11, 20, 11, 20, 20, 20, 20, 20, 11, 20, 20, 14, 11, 20, 11, 14, 11, 20, 11, 14, 11, 20, 10], + [10, 20, 11, 14, 11, 11, 11, 11, 11, 20, 11, 20, 11, 11, 11, 13, 11, 20, 11, 20, 11, 11, 11, 20, 10], + [10, 20, 20, 20, 20, 20, 11, 20, 13, 20, 11, 20, 11, 14, 20, 20, 11, 16, 11, 20, 20, 20, 20, 20, 10], + [10, 11, 11, 20, 11, 20, 11, 20, 11, 20, 11, 20, 11, 11, 11, 13, 11, 11, 11, 20, 11, 11, 11, 11, 10], + [10, 14, 20, 14, 11, 14, 20, 14, 11, 14, 11, 14, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 14, 10], + [10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10], +]; + // prettier-ignore + this.numbersGridLevel6= [ + [10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10], + [10, 16, 20, 20, 20, 14, 14, 11, 14, 11, 14, 13, 20, 20, 20, 11, 14, 14, 20, 11, 14, 20, 20, 20, 12], + [10, 20, 11, 11, 11, 11, 11, 11, 20, 11, 20, 11, 20, 11, 11, 11, 11, 11, 20, 11, 20, 11, 11, 20, 10], + [10, 14, 11, 14, 20, 20, 20, 13, 20, 11, 20, 11, 20, 11, 18, 16, 20, 11, 20, 11, 20, 13, 11, 20, 10], + [10, 20, 11, 11, 11, 11, 20, 20, 20, 20, 20, 11, 20, 11, 14, 11, 20, 11, 20, 11, 20, 14, 11, 14, 10], + [10, 20, 20, 20, 20, 20, 20, 11, 11, 11, 20, 11, 20, 11, 11, 11, 20, 11, 14, 11, 20, 11, 11, 11, 10], + [10, 20, 11, 11, 11, 11, 14, 11, 14, 11, 14, 11, 14, 20, 20, 20, 20, 11, 20, 11, 20, 16, 20, 11, 10], + [10, 20, 11, 20, 20, 20, 20, 11, 14, 11, 20, 11, 11, 11, 11, 11, 11, 11, 20, 14, 20, 20, 20, 20, 10], + [10, 13, 11, 20, 11, 11, 11, 11, 20, 11, 20, 20, 20, 20, 20, 14, 20, 20, 20, 11, 11, 11, 11, 20, 10], + [10, 20, 11, 20, 20, 14, 20, 20, 20, 11, 20, 11, 11, 11, 20, 11, 20, 11, 11, 11, 14, 13, 11, 20, 10], + [10, 20, 11, 11, 20, 11, 11, 11, 11, 11, 20, 11, 14, 11, 20, 11, 20, 14, 11, 20, 20, 20, 11, 14, 10], + [10, 14, 13, 11, 20, 20, 20, 20, 14, 11, 20, 20, 18, 11, 14, 11, 20, 18, 11, 20, 11, 20, 11, 20, 10], + [10, 11, 11, 11, 20, 11, 20, 11, 11, 11, 11, 11, 11, 11, 20, 11, 11, 11, 11, 20, 11, 20, 11, 20, 10], + [15, 20, 20, 20, 14, 11, 20, 20, 20, 14, 14, 20, 20, 16, 20, 20, 20, 14, 14, 20, 11, 20, 14, 20, 10], + [10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10], + ]; + // prettier-ignore + this.numbersGridLevel7= [ + [10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10], + [10, 15, 20, 16, 14, 20, 20 ,20, 20, 20, 11, 20 ,11, 11, 11, 20, 20, 20, 11, 20, 20, 14, 11, 20, 10], + [10, 14, 11, 11, 11, 20, 11, 20, 11, 13, 20, 20, 20, 11, 20, 20, 11, 14, 11, 20, 20, 20, 20, 20, 10], + [10, 20, 20, 13, 11, 20, 11, 20, 11, 20, 11, 11, 11, 20, 14, 20, 11, 11, 11, 20, 11, 11, 20, 11, 10], + [10, 20, 11, 11, 11, 14, 11, 20, 11, 14, 20, 14, 11, 20, 11, 20, 13, 20, 20, 20, 14, 11, 13, 14, 10], + [10, 20, 14, 11, 20, 14, 11, 20, 11, 20, 20, 11, 14, 20, 11, 20, 11, 11, 20, 20, 11, 11, 20, 11, 10], + [10, 11, 11, 20, 20, 13, 11, 20, 11, 20, 20, 20, 11, 20, 11, 20, 14, 11, 20, 20, 11, 20, 14, 30, 10], + [10, 20, 11, 14, 11, 11, 20, 20, 20, 20, 11, 13, 11, 20, 11, 20, 20, 11, 18, 20, 11, 11, 11, 20, 10], + [10, 14, 20, 20, 20, 20, 13, 11, 20, 11, 20, 20, 11, 20, 11, 11, 11, 11, 11, 20, 14, 11, 20, 20, 17], + [10, 20, 11, 11, 11, 13, 11, 11, 20, 11, 14, 11, 20, 20, 20, 20, 20, 20, 20, 20, 11, 11, 14, 20, 10], + [10, 20, 11, 14, 11, 14, 14, 11, 20, 11, 20, 11, 20, 11, 11, 11, 16, 20, 11, 20, 11, 14, 11, 20, 10], + [10, 20, 11, 14, 11, 14, 14, 11, 20, 11, 20, 11, 14, 11, 14, 11, 20, 20, 11, 16, 11, 18, 11, 20, 10], + [10, 20, 20, 14, 11, 11, 11, 11, 20, 11, 20, 11, 11, 11, 20, 11, 11, 20, 11, 14, 20, 13, 11, 20, 10], + [10, 11, 11, 13, 20, 14, 14, 20, 20, 16, 20, 20, 16, 20, 18, 20, 14, 20, 11, 11, 11, 14, 20, 20, 10], + [10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10], + ] - this.levelImage = new p5.Image(1000, 600); } @@ -98,10 +174,26 @@ class LevelFactory { selectedLevelGrid = this.numbersGridLevel2; levelImage = levelTwo; colorWall = "#7851A9"; - } else { + } else if (levelNumber === 3) { selectedLevelGrid = this.numbersGridLevel3; levelImage = levelThree; colorWall = "#b776a5"; + } else if (levelNumber === 4) { + selectedLevelGrid = this.numbersGridLevel4; + levelImage = levelFour; + colorWall = "#900002"; + } else if (levelNumber === 5) { + selectedLevelGrid = this.numbersGridLevel5; + levelImage = levelFive; + colorWall = "#53185d"; + } else if (levelNumber === 6) { + selectedLevelGrid = this.numbersGridLevel6; + levelImage = levelSix; + colorWall = "#10740b"; + } else { + selectedLevelGrid = this.numbersGridLevel7; + levelImage = levelSeven; + colorWall = "#1E77A4"; } for (let y = 0; y < selectedLevelGrid.length; y++) { diff --git a/src/sketch.ts b/src/sketch.ts index 0f28ca4..a75fc4f 100644 --- a/src/sketch.ts +++ b/src/sketch.ts @@ -4,6 +4,10 @@ let playerImages: p5.Image[]; let levelOne: p5.Image; let levelTwo: p5.Image; let levelThree: p5.Image; +let levelFour: p5.Image; +let levelFive: p5.Image; +let levelSix: p5.Image; +let levelSeven: p5.Image; let backgroundImg: p5.Image; let endScreenStar: p5.Image; let smallStarsEndScreen: p5.Image; @@ -57,6 +61,10 @@ function preload() { levelOne = loadImage("./assets/img/levelOne.png"); levelTwo = loadImage("./assets/img/levelTwo.png"); levelThree = loadImage("./assets/img/levelThree.png"); + levelFour = loadImage ("./assets/img/levelFour.png"); + levelFive = loadImage ("./assets/img/levelFive.png"); + levelSix = loadImage ("./assets/img/levelSix.png"); + levelSeven = loadImage ("./assets/img/levelSeven.png"); beerImg = loadImage("./assets/img/beer.png"); formulaImg = loadImage("./assets/img/formula.png"); clockImg = loadImage("./assets/img/clock.png");