Skip to content

A low level game built with C and raylib Through it we will build our own mini engine and learn everything we could about game dev and graphics.

Notifications You must be signed in to change notification settings

amir-kedis/CRougeLite

Β 
Β 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

CRougeLite
Purr-fectly Perilous Adventures


Overview

CRougeLite is a 2D top-down shooter game where you play as a fancy cat knight who explores the dangerous dungeons and fights enemies to save the dungeon from the evil forces.

It was our way to learn C programming (hence the 'C' in the name) and game development in a pure way with out the help of any game engine or heavy dependence on external libraries. So all the systems except the rendering* was handled by us, that includes (Physics, Assets, Animation, Input, etc.).

Note

*The rendering is done using the amazing library Raylib

Important

As our goal was to learn C and game dev, the code was our best attempt to write clean and readable code (at the time of development πŸ˜†), So feel free to give us your feedback and code review on both code quality and game design. You can be as harsh as you want, we are here to learn and improve. πŸ˜‰

Screenshots

Gameplay
Gameplay showing the player, enemies, health bar, inventory.

R RougeLite
Debug view showing the enemies ranges, enemies path calculated through A* algorithm, and the player position.

R RougeLite
Debug view showing the map colliders, and collectable items.


Gameplay

Watch the demo game play


CLick the image to watch the gameplay demo.


Game Features


1. Character Controller

  • Custom player controller that allows movement, dashes, shooting, and melee attacks.

2. Enemy AI + A* Pathfinding

  • Enemies has a range of sight in which they can see the player and chase them.
  • They use A* pathfinding algorithm to navigate through the map and reach the player.
  • They can attack the player when they are close enough.

3. Physics System

  • handles collisions of rigid bodies, ghost bodies, and other physics interactions.

Note

You can check the collision docs that we wrote here Collision Docs


4. Inventory System and pickups

  • Collectable items that can be picked up by the player.
  • Player can have multiple items in their inventory.
  • once used the item will be removed from the inventory.
  • Players can press F to use the item in their inventory or interact with the environment.

5. Smart optimized asset management and loading

  • Assets are kept to a minimum in one atlas image.
  • Atlas is loaded once at the start and freed when the game is closed.

Asset Management Diagram


6. Animation System

  • Implemented custom sprite animation system.
  • Added an animation controller and animation state machines to allow for complex animation scenarios.

Note

You can check the animation docs that we wrote here Animation Docs

Animation Diagram


7. Debug tools

  • Our debug menu handles:
    • Showing and hiding textures
    • Showing and hiding texture bounds
    • Showing and hiding colliders (Hitboxes)
    • Showing A* pathfinding information
    • Show inventory
    • Enable and control music
    • Control zoom

8. Audio system (music and sound effects)

  • Handles music and ambient
  • Added sound effects with simple adaptive sound design
    • Most sound have random pitch shift to reduce restiveness.

9. Map System (map, colliders, loading, etc.)

  • Map system that handles loading and unloading maps.
  • Map colliders that are used to detect collisions with the player and enemies.

10. Map Editor (to create maps)

  • A simple map editor to create maps.
  • Allows you to place tiles, colliders, and items.
  • Fully implemented in One html file with no dependencies.

Building and Running

  • Run the command one time
cmake -S . -B build
  • then to build the game run
cmake --build build
  • to run
./build/CRougeLite/CRougeLite

Small Dev Logs

Note

We made these early stage of the development.

  • Debug menu
2024-06-23.15-15-56.mp4
  • bullet mechanism animation system map drawing
2024-06-23.12-55-12.mp4
  • Enemies
2024-06-17.12-42-43.mp4
  • Animation
2024-06-16.17-24-16.mp4
  • Basic char movement and bullets
WhatsApp.Video.2024-06-16.at.5.35.25.PM.mp4

Contributors


Marwan Alhameedy


Moamen Hefny


Akram Hany


Amir Kedis

πŸ”’ License

This software is licensed under MIT License. See License for more information.

About

A low level game built with C and raylib Through it we will build our own mini engine and learn everything we could about game dev and graphics.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C 85.4%
  • HTML 12.9%
  • Other 1.7%