-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'refs/remotes/origin/main'
- Loading branch information
Showing
19 changed files
with
1,294 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<title>Road Crossing Game</title> | ||
<link rel="stylesheet" href="./css/style.css"> | ||
<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.4.0/p5.js"></script> | ||
</head> | ||
<body> | ||
<!-- Config --> | ||
<script src="./src/config/constants.js"></script> | ||
<script src="./src/config/game-modes.js"></script> | ||
<script src="./src/config/levels.js"></script> | ||
|
||
<!-- Utils --> | ||
<script src="./src/utils/collision.js"></script> | ||
<script src="./src/utils/storage.js"></script> | ||
|
||
<!-- Entities --> | ||
<script src="./src/entities/player.js"></script> | ||
<script src="./src/entities/car.js"></script> | ||
<script src="./src/entities/item.js"></script> | ||
<script src="./src/entities/obstacle.js"></script> | ||
|
||
<!-- Systems --> | ||
<script src="./src/systems/car-system.js"></script> | ||
<script src="./src/systems/item-system.js"></script> | ||
<script src="./src/systems/obstacle-system.js"></script> | ||
|
||
<!-- UI --> | ||
<script src="./src/ui/ui-manager.js"></script> | ||
<script src="./src/ui/components/button.js"></script> | ||
|
||
<!-- Core --> | ||
<script src="./src/core/game.js"></script> | ||
<script src="./src/core/settings.js"></script> | ||
|
||
<!-- Main --> | ||
<script src="./src/main.js"></script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
body { | ||
margin: 0; | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
height: 100vh; | ||
background: #f0f0f0; | ||
} | ||
|
||
canvas { | ||
border: 1px solid #000; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
// Game constants and configuration | ||
const GAME_STATES = { | ||
MENU: 'menu', | ||
PLAYING: 'playing', | ||
PAUSED: 'paused', | ||
LEVEL_COMPLETE: 'levelComplete', | ||
GAME_OVER: 'gameOver', | ||
LEVEL_SELECT: 'levelSelect', | ||
HELP: 'help', | ||
AUDIO: 'audio' | ||
}; | ||
|
||
// Lane configuration | ||
const LANES = { | ||
SLOW: { x: 225, width: 100 }, | ||
MEDIUM: { x: 325, width: 100 }, | ||
FAST: { x: 425, width: 100 } | ||
}; | ||
|
||
// Pause menu buttons | ||
const PAUSE_BUTTONS = { | ||
resume: { x: 300, y: 250, w: 200, h: 40, text: "Continue Game" }, | ||
restart: { x: 300, y: 300, w: 200, h: 40, text: "Restart" }, | ||
menu: { x: 300, y: 350, w: 200, h: 40, text: "Return to Main Menu" }, | ||
audio: { x: 300, y: 400, w: 200, h: 40, text: "Audio Settings" } | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
// Game mode definitions | ||
const GAME_MODE = { | ||
NORMAL: 'normal', | ||
TESTING: 'testing' | ||
}; | ||
|
||
// Set current game mode - change to NORMAL for regular play | ||
let currentGameMode = GAME_MODE.TESTING; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
// Level configuration | ||
const LEVEL_CONFIG = { | ||
1: { | ||
targetScore: 200, | ||
speedMultiplier: 1, | ||
hasObstacles: false, | ||
speeds: { | ||
slow: 2, | ||
medium: 4, | ||
fast: 6 | ||
}, | ||
carSpawnRates: { | ||
slow: 180, | ||
medium: 150, | ||
fast: 120 | ||
} | ||
}, | ||
2: { | ||
targetScore: 200, | ||
speedMultiplier: 1.2, | ||
hasObstacles: false, | ||
speeds: { | ||
slow: 2.4, | ||
medium: 4.8, | ||
fast: 7.2 | ||
}, | ||
carSpawnRates: { | ||
slow: 60, | ||
medium: 45, | ||
fast: 30 | ||
} | ||
}, | ||
3: { | ||
targetScore: 300, | ||
speedMultiplier: 1.2, | ||
hasObstacles: true, | ||
speeds: { | ||
slow: 2.4, | ||
medium: 4.8, | ||
fast: 7.2 | ||
}, | ||
carSpawnRates: { | ||
slow: 60, | ||
medium: 45, | ||
fast: 60 | ||
} | ||
} | ||
}; |
Oops, something went wrong.