homework5 #5

Merged
andrea merged 3 commits from 20220552/homework5:main into 20220552 2026-04-21 23:37:11 +00:00
3 changed files with 46 additions and 0 deletions
Showing only changes of commit 2827e2efc5 - Show all commits

View File

@@ -46,3 +46,49 @@ The gameplay loop is simple and repetitive:
`Play``Collect``Grow``Avoid``Fail``Restart` `Play``Collect``Grow``Avoid``Fail``Restart`
The simplicity of the mechanics allows for immediate understanding, while increasing difficulty creates tension and replayability. The simplicity of the mechanics allows for immediate understanding, while increasing difficulty creates tension and replayability.
## How will the game look like?
```
What are the game elements (e.g. characters, world, interface) and how will they be implemented in code (e.g., modules, classes, objects, functions)? Feel free to use diagrams, flow-charts or any other visual representation to show your plan.
```
The game will feature a dark 3D environment with glowing spheres as the main visual elements, creating a clean and immersive experience.
<img src="environment.png" style="max-height: 300px;">
### Game Elements
- **Player**: glowing sphere with trailing body segments
- **Orbs**: collectible glowing spheres
- **Obstacles**: larger objects that cause collision
- **World**: bounded arena on a flat plane
- **UI**: score, best score, start and game over screens
### Code Structure
The game will be organized into simple modules:
`main.js`
├── `GameManager`
├── `Player`
├── `Orb`
├── `Obstacle`
└── `UI`
- **Player**: movement, growth, collision
- **Orb**: spawning and collection
- **Obstacle**: collision handling
- **GameManager**: game state, score, restart
- **UI**: display elements
### Gameplay Flow
![](flow.png)
### Technical Approach
- Built using **Three.js** for 3D rendering
- Movement constrained to a plane for simplicity
- Objects managed using classes and arrays
- Collision detection using distance checks

BIN
environment.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1002 KiB

BIN
flow.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 933 KiB