Skip to content

Repository files navigation

# Escape Game
A terminal-based ASCII escape game written in C


## How to Build
```
make escape
```

## How to Run
```
./escape <map_file>
```
Example:
```
./escape map.txt
```
## Check for memory leaks 
```
valgrind ./escape <map_file>
```

## How to Play
| Key | Action         |
|-----|----------------|
| `w` | Move UP        |
| `s` | Move DOWN      |
| `a` | Move LEFT      |
| `d` | Move RIGHT     |
| `u` | Undo last move |

Move the player `P` to reach the goal `G` before the water `~` floods the map.
Triggering the trap `@` removes all trapdoors `X` and starts the flood. Don't drown.

## File Structure
|-----------------------------------|---------------------------------------------|
| File                              | Purpose                                     |
|-----------------------------------|---------------------------------------------|
| `escape.c`                        | Main entry point and game loop              |
| `game.c / game.h`                 | Player movement, flood fill, undo snapshots |
| `fileHandling.c / fileHandling.h` | Map loading, rendering, memory management   | 
| `linkedlist.c / linkedlist.h`     | Generic linked list used for undo           |
| `terminal.c / terminal.h`         | Raw keypress input (no Enter needed)        |
| `color.c / color.h`               | Terminal background/foreground colors       |
| `newSleep.c / newSleep.h`         | Sleep utility                               |
|-----------------------------------|---------------------------------------------|

## Clean Build
```
make clean
```

About

game submitted for my final assignment submission - uni - unix and c programming

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages