
# đą Run The Cat
## đŠâđģ Student Information
Name : Nadia Azzahra Putri Arvi
Student ID : 20210747
Email : nadia.arvi@kaist.ac.kr
## đ Table of Contents
- [đą Run The Cat](#-run-the-cat)
- [đŠâđģ Student Information](#-student-information)
- [đ Table of Contents](#-table-of-contents)
- [đŽ Game Description](#-game-description)
- [đšī¸ How It Works](#ī¸-how-it-works)
- [âī¸ Installing \& Running The Game](#ī¸-installing--running-the-game)
- [đ§ Code Structure](#-code-structure)
- [đđģ Repository Structure](#-repository-structure)
- [đ§Š Key Modules and Responsibilities](#-key-modules-and-responsibilities)
- [đĻ Tech Stack \& Resources](#-tech-stack--resources)
- [đ§ Built With](#-built-with)
- [đšī¸ Game Framework \& Libraries](#ī¸-game-framework--libraries)
- [đ¨ Assets Used](#-assets-used)
- [đ Known Issues](#-known-issues)
- [⨠Special Features](#-special-features)
- [đ Acknowledgements](#-acknowledgements)
## đŽ Game Description
Run The Cat is a puzzle-platformer game where players guide a cat through various levels using coding-like commands. The game teaches basic programming concepts through interactive gameplay.
### đšī¸ How It Works
Figure 1. A snapshot of the game interface showing key UI components.
In this game, players must:
1. Select commands from the `blocks` panel â only these available blocks can be used.
2. Arrange the selected blocks into a sequence using the `steps` panel.
3. Define macro commands in the `loop` panel to optimize and reduce repetition.
4. Execute the move using the `run` button to guide the cat.
5. Collect keys and reach the flag to complete the level.
## âī¸ Installing & Running The Game
To play the game, follow these steps:
1. Clone the repository
```bash
git clone https://github.com/nadiarvi/run-the-cat.git
```
2. Navigate to the project directory:
```bash
cd run-the-cat
```
3. Install dependencies and start the game:
```bash
npm install
npm start
```
## đ§ Code Structure
Figure 2. UML Diagram and Class Relations
### đđģ Repository Structure
```bash
run-the-cat/
âââ README.md
âââ index.html # Main HTML file to load the game
âââ lib/ # External libraries (p5.js, SceneManager, etc.)
â âââ p5.clickable.js
â âââ p5.js
â âââ scenemanager.js
â âââ scenemanager_.js
âââ package.json # Project metadata and dependencies
âââ public/
â âââ assets/ # Images, sprites, and other media assets
âââ src/ # Main source code
âââ components/ # Reusable game components (Cat, Flag, etc.)
âââ main.js # Game entry point
âââ scenes/ # Level or scene logic
âââ style.css # Styles for the game UI
âââ utils/ # Utility functions and UI helpers
```
### đ§Š Key Modules and Responsibilities
- index.html: Entry point of the application; initializes canvas and loads all scripts.
- lib/: Contains external libraries such as p5.js, p5.clickable, and p5.SceneManager for rendering, UI, and scene handling.
- public/assets/: Includes all images, sprites, and media used in the game and README visuals.
- src/components/: Contains constructors for individual game elements such as:
- Cat: Handles player character movement, physics, and animation.
- Key and Flag: Interactive objects related to level progression.
- src/scenes/: Implements level logic using SceneManager.
- src/utils/: Includes styling helpers, themes, and reusable UI logic.
- main.js: Boots up the game and loads the initial scene.
- style.css: Provides global styling for in-game UI and layout.
## đĻ Tech Stack & Resources
### đ§ Built With
| Tech | Description |
|------|-------------|
|  | Markup structure |
|  | Styling and layout |
|  | Game logic and interactivity |
|  | Development tooling |
### đšī¸ Game Framework & Libraries
| Library | Purpose |
|---------|---------|
| [](https://p5js.org/) | Core game rendering and animation |
| [p5.SceneManager](https://github.com/mveteanu/p5.SceneManager) | Manage different game scenes and levels |
| [p5.clickable](https://github.com/Lartu/p5.clickable) | Create clickable UI elements (i.e. buttons) |
| [p5.play](https://p5play.org/) | Sprite handling and physics engine |
### đ¨ Assets Used
| Asset | Source & Credits |
|-------|------------------|
| đą **Cat Sprite** | [Free Street Animal Pixel Art Asset Pack](https://craftpix.net/freebies/free-street-animal-pixel-art-asset-pack/?num=1&count=301&sq=cat&pos=4) by [CraftPix.net](https://craftpix.net) |
| đŠ **Flag Animation** | [Free Flag with Animation](https://ankousse26.itch.io/free-flag-with-animation) by [ankousse26](https://ankousse26.itch.io) |
| đ **Key Sprite** | [FREE Pixel Art Key Pack â Animated](https://karsiori.itch.io/pixel-art-key-pack-animated) by [karsiori](https://karsiori.itch.io) |
## đ Known Issues
- **Restart Bug**
After restarting a level, the cat's movement becomes slightly jittery, unlike on a fresh load. This is likely due to the sprite or state not being fully reset. A temporary fix is in place, but it may still cause minor visual glitches.
- **Clickable Background After Completion**
When a level is completed and the overlay is displayed, the background remains interactive. This allows players to accidentally trigger cat movement even though the game should not be playable.
- **Sprite Can Move Outside the Frame**
When the Cat sprite moves beyond the visible frame, it becomes unresponsive to controls. Currently, there is no boundary-checking logic implemented to prevent the sprite from leaving the playable area.
## ⨠Special Features
_No additional features beyond the core requirements were implemented._
## đ Acknowledgements
All assets and libraries used have been credited in the [đĻ Tech Stack & Resources](#-tech-stack--resources) section above. Code examples were referenced from the official documentation of the respective libraries. LLMs were used for debugging assistance.