And thanks for all the fish!
This project is a very small 2D game. Its purpose is to make you work with textures, sprites, and some other very basic gameplay elements.
In the shadowed cloak of night, the ominous Nazgûl, cloaked in darkness and dread, stealthily infiltrated the venerable realm of Rivendell. Their nefarious purpose unveiled itself as they ruthlessly seized the shards of Narsil, the shattered remains of a once-mighty blade, foretelling doom for the free realms. Swiftly, the sons of Elrond, Elladan and Elrohir, undeterred by fear, pursued the Ringwraiths through the eldritch veil of night. Amidst their flight, the Nazgûl, tormented by the relentless pursuit of the elven brethren, faltered. In the dense thickets of the Wilderland, the shards slipped from their ghastly grasp, lost to the shadows. Aragorn, the heir to the throne of Gondor, burdened with destiny, was summoned to retrieve the shards swiftly, for they held the key to the redemption of a kingdom. But in this perilous quest, he was forewarned – beware the Nazgûl, the shadows of Sauron's malevolence, ever watchful, ever haunting, in their relentless pursuit of the One Ring and the heir to the line of Isildur.
Help Strider gather all the shards of Narsil and bring them back to Rivendell, where they shall be reforged! Don't let the Ringwraiths catch you!
The game is written in C language and thus needs the gcc
compiler and some standard C libraries to run. MLX42 is used as the graphics engine, since it is easier to work with than MiniLibX. Since MLX is optimized for the OS, this game can only be played on macOS.
Run the mandatory version:
make
./so_long maps/*.ber
Run the bonus version:
make bonus
./so_long_bonus maps/bonus/*.ber
- Move:
WASD
or↑←↓→
- Sprint (bonus only):
LEFT SHIFT
- Exit:
ESCAPE
-
The map has to be constructed with 3 components: walls, collectibles, and free space.
-
The map can be composed of only these 5 characters:
0
for an empty space1
for a wallC
for a collectibleE
for a map exitP
for the player’s starting position
Bonus difference:
E
for an enemyX
for a map exit
-
The map must contain 1 exit, at least 1 collectible, and 1 starting position to be valid.
-
The map must be rectangular.
-
The map must be closed/surrounded by walls.
-
You have to check if there’s a valid path in the map.
-
If any misconfiguration of any kind is encountered in the file, the program must exit in a clean way, and return "Error\n" followed by an explicit error message of your choice.
Here is a simple valid map (mandatory):
1111111111111
10010000000C1
1000011111001
1P0011E000001
1111111111111
Bonus example:
111111111
1P00001E1
101111111
101C00001
101011111
1000000C1
111011111
1C00000X1
111111111
Feature | Madatory | Bonus |
---|---|---|
player movement |
tile by tile | smoothly between tiles |
player rotation |
only one way | turns whenever you change direction |
move & collect counters |
printed to the terminal | displayed in-game with custom font |
enemies |
none | walk straight until they hit a wall, then choose a new direction randomly, if you walk into them you die |
animations |
none | win and death animations that are 3x3 tiles big |
sprint |
no | yes |