diff --git a/.DS_Store b/.DS_Store index 4e7066b..d08fa97 100644 Binary files a/.DS_Store and b/.DS_Store differ diff --git a/assets/.DS_Store b/assets/.DS_Store index 341e4c3..1012b83 100644 Binary files a/assets/.DS_Store and b/assets/.DS_Store differ diff --git a/assets/cats_vs_mice.png b/assets/cats_vs_mice.png new file mode 100644 index 0000000..6408aa1 Binary files /dev/null and b/assets/cats_vs_mice.png differ diff --git a/sketch.js b/sketch.js index 7896b68..c6bdb76 100644 --- a/sketch.js +++ b/sketch.js @@ -1,5 +1,5 @@ -import { StartScene } from './StartScene.js'; -import { GameScene } from './GameScene.js'; +import { StartScene } from './src/scenes/StartScene.js'; +import { GameScene } from './src/scenes/GameScene.js'; export let mgr; export let startPageAni; diff --git a/src/.DS_Store b/src/.DS_Store new file mode 100644 index 0000000..3813d60 Binary files /dev/null and b/src/.DS_Store differ diff --git a/classes/Cat.js b/src/classes/Cat.js similarity index 98% rename from classes/Cat.js rename to src/classes/Cat.js index 4a73ede..e84cf33 100644 --- a/classes/Cat.js +++ b/src/classes/Cat.js @@ -1,8 +1,8 @@ +import { catAnimation, imageAssets } from '../../sketch.js'; import { gameFrame } from '../constants/Prototype.js'; -import { catAnimation, imageAssets } from '../sketch.js'; -import { grid, cheeses, activeCats, activeMice, mouseGroup, throwableGroup, gameSprites } from '../GameScene.js'; +import { grid, cheeses, activeCats, activeMice, mouseGroup, throwableGroup, gameSprites } from '../scenes/GameScene.js'; +import { calculateCell } from '../logic/Helper.js'; import { Yarn, Snowball } from './Throwable.js'; -import { calculateCell } from '../Helper.js'; export const throwables = []; const catAniDesc = { diff --git a/classes/Mouse.js b/src/classes/Mouse.js similarity index 96% rename from classes/Mouse.js rename to src/classes/Mouse.js index 5370749..b171dfb 100644 --- a/classes/Mouse.js +++ b/src/classes/Mouse.js @@ -1,7 +1,7 @@ +import { mouseAnimation } from '../../sketch.js'; import { gameFrame } from '../constants/Prototype.js'; -import { mouseAnimation } from '../sketch.js'; -import { activeMice, mouseGroup, gameSprites } from '../GameScene.js'; -import { updateGameProgress } from '../Controller.js'; +import { activeMice, mouseGroup, gameSprites } from '../scenes/GameScene.js'; +import { updateGameProgress } from '../logic/Controller.js'; import { Snowball } from './Throwable.js'; const mouseAniDesc = { diff --git a/classes/RobotVacuum.js b/src/classes/RobotVacuum.js similarity index 94% rename from classes/RobotVacuum.js rename to src/classes/RobotVacuum.js index af8adb9..6d11f0a 100644 --- a/classes/RobotVacuum.js +++ b/src/classes/RobotVacuum.js @@ -1,6 +1,6 @@ +import { imageAssets } from '../../sketch.js'; import { gameFrame } from '../constants/Prototype.js'; -import { imageAssets } from '../sketch.js'; -import { activeMice, catGroup, throwableGroup, gameSprites, robotVacuums } from '../GameScene.js'; +import { activeMice, catGroup, throwableGroup, gameSprites, robotVacuums } from '../scenes/GameScene.js'; export class RobotVacuum { constructor(x, y, row) { diff --git a/classes/Throwable.js b/src/classes/Throwable.js similarity index 89% rename from classes/Throwable.js rename to src/classes/Throwable.js index 9d60d1c..66d2f3c 100644 --- a/classes/Throwable.js +++ b/src/classes/Throwable.js @@ -1,6 +1,6 @@ +import { imageAssets } from '../../sketch.js'; import { gameFrame } from '../constants/Prototype.js'; -import { imageAssets } from '../sketch.js'; -import { gameSprites } from '../GameScene.js'; +import { gameSprites } from '../scenes/GameScene.js'; export class Throwable { constructor(x, y, point, img, width) { diff --git a/constants/Colors.js b/src/constants/Colors.js similarity index 100% rename from constants/Colors.js rename to src/constants/Colors.js diff --git a/constants/Prototype.js b/src/constants/Prototype.js similarity index 100% rename from constants/Prototype.js rename to src/constants/Prototype.js diff --git a/level/Level1.js b/src/level/Level1.js similarity index 100% rename from level/Level1.js rename to src/level/Level1.js diff --git a/level/WinLose.js b/src/level/WinLose.js similarity index 100% rename from level/WinLose.js rename to src/level/WinLose.js diff --git a/Controller.js b/src/logic/Controller.js similarity index 93% rename from Controller.js rename to src/logic/Controller.js index 4351ae8..fa2ed6b 100644 --- a/Controller.js +++ b/src/logic/Controller.js @@ -1,5 +1,5 @@ -import { showWinningScreen } from './level/WinLose.js'; -import { level1Mice } from './level/Level1.js'; +import { level1Mice } from '../level/Level1.js'; +import { showWinningScreen } from '../level/WinLose.js'; const cheeseCount = document.getElementById('cheeseCount'); const gameProgress = document.getElementById('gameProgress'); diff --git a/Helper.js b/src/logic/Helper.js similarity index 95% rename from Helper.js rename to src/logic/Helper.js index cb952cb..ab3f46f 100644 --- a/Helper.js +++ b/src/logic/Helper.js @@ -1,4 +1,4 @@ -import { gameFrame } from "./constants/Prototype.js"; +import { gameFrame } from "../constants/Prototype.js"; /** * Calculates the grid cell (row and column) corresponding to the given mouse coordinates diff --git a/GameScene.js b/src/scenes/GameScene.js similarity index 94% rename from GameScene.js rename to src/scenes/GameScene.js index 3d58910..f9f56d5 100644 --- a/GameScene.js +++ b/src/scenes/GameScene.js @@ -1,13 +1,13 @@ -import { prototypeFrame, gameFrame } from './constants/Prototype.js'; -import { Colors } from './constants/Colors.js'; -import { imageAssets, selectedCatType, resetCatType } from './sketch.js'; -import { createCat, SleepyCat, throwables } from './classes/Cat.js'; -import { spawnMouse } from './classes/Mouse.js'; -import { drawRobotVacuums } from './classes/RobotVacuum.js'; -import { level1Mice } from './level/Level1.js'; -import { showLosingScreen } from './level/WinLose.js'; -import { updateCatButtons, updateCheeseCount, restartGameProgress } from './Controller.js'; -import { calculateCell, isCellValid } from './Helper.js'; +import { imageAssets, selectedCatType, resetCatType } from '../../sketch.js'; +import { prototypeFrame, gameFrame } from '../constants/Prototype.js'; +import { Colors } from '../constants/Colors.js'; +import { createCat, SleepyCat, throwables } from '../classes/Cat.js'; +import { spawnMouse } from '../classes/Mouse.js'; +import { drawRobotVacuums } from '../classes/RobotVacuum.js'; +import { level1Mice } from '../level/Level1.js'; +import { showLosingScreen } from '../level/WinLose.js'; +import { updateCatButtons, updateCheeseCount, restartGameProgress } from '../logic/Controller.js'; +import { calculateCell, isCellValid } from '../logic/Helper.js'; const gameParent = document.getElementById('gameFrame'); const upperContainer = document.getElementById('upperContainer'); diff --git a/StartScene.js b/src/scenes/StartScene.js similarity index 89% rename from StartScene.js rename to src/scenes/StartScene.js index 432d603..3aa376b 100644 --- a/StartScene.js +++ b/src/scenes/StartScene.js @@ -1,4 +1,4 @@ -import { startPageAni } from './sketch.js'; +import { startPageAni } from '../../sketch.js'; export function StartScene() { this.enter = function() {