HATPC remake
 
 
 
Go to file
En Yi 21dafd1b6d Add kinematic mode to movement
Changelog:
- Kinematic mode ignores accelerations, that's all
- Update moveable to use kinematic mode and set accel & velocity to zero
  when entering gridmove mode
2023-06-16 16:28:19 +08:00
res Update gitignore 2023-05-28 14:58:10 +08:00
scenes Add kinematic mode to movement 2023-06-16 16:28:19 +08:00
tests Add test for AABB collision functions 2023-06-16 15:18:03 +08:00
.gitignore Update gitignore 2023-05-28 14:58:10 +08:00
CMakeLists.txt Integrate CMocka to do unit testing 2023-06-16 11:51:22 +08:00
Conventions.txt Attempt to apply code style consitency 2023-04-15 22:52:38 +08:00
README.md Add README 2023-05-28 15:18:03 +08:00
assets_test.c Add horizontal flip to sprites 2023-05-23 21:33:05 +08:00
build.sh Add convenience scripts 2023-03-11 22:50:17 +08:00
entManager_test.c Refactor Entity Tag out of EC 2023-05-29 21:41:17 +08:00
lsan_supp.txt Add convenience scripts 2023-03-11 22:50:17 +08:00
main.c Combine Component, Entity + Manager headers 2023-05-23 20:37:55 +08:00
menu_test.c Slightly rework scene rendering 2023-05-07 16:25:03 +08:00
run.sh Add convenience scripts 2023-03-11 22:50:17 +08:00
run_tests.sh Add test for AABB collision functions 2023-06-16 15:18:03 +08:00
scene_test.c Implement player sprite info loading from file 2023-05-22 20:33:48 +08:00

README.md

Some Game Engine

An attempt to create a game with the ECS architecture in C. This is mostly a learning experience about what goes into a game engine.

The goal of the project is to make a game similar to Hannah and The Pirate Caves from Neopets. I thought that's a nice game to aim for, plus I have fond memories of it. It is not a full-on remake!

DISCLAIMER: There is no obligations tied to this project. For all I know, the project can just get abandoned at anytime. I WILL take my time with this project.

Implementation Notes

As mentioned, this is mostly a learning experience, so certain things are implemented for the sake of learning. However, there are certain things that I didn't bother with because dealing with them will open up another can of worms. Either that or I find it too large of a feature to implement on my own without hating my existance. For these, I will use libraries.

As this point of time (28/5/2023), these are the things I won't bother for now:

  • Game rendering: I remember dealing with OpenGL for a little bit and it being a not-so-pleasant experience. This is also a large topic on its own too.
  • Camera System: This is an interesting one. I would really like to implement this. However, this is sort of tied to game rendering, so no.
  • Windows and raw input handling: Not keen on this.
  • GUI: I'm not about to roll my own GUI library for this.
  • Data structures: Will only do it for specific reasons. Otherwise, use a library.

Libraries used:

  • raylib [link] + raygui [link]: MVP of this project. Basically the backbone of the game. I've use it for some past projects and it's always a pleasant experience. Can recommend!
  • sc [link]: For data structures. The library targets server backend usage, so it might not be the most suitable usage, and is likely to be replaced. However, it has been a good experience using this library, so no complaints from me.

Progress

The engine features:

  • An Entity-Component framework with an Entity Manager + memory pool that is specific for this project
  • AABB collision system + Grid-based Broad phase collision detection
  • Scene management and transition
  • Assets management and sprite transition

Game progress:

  • Simple main menu + sandbox scenes
  • Player movement
  • Tiles: Solid tiles, water, One-way platforms and ladders
  • Crates

Build Instruction

  1. Build and install raylib.
  2. Clone this repository.
  3. mkdir build && cd build && cmake ..
  4. Run: ./HATPC_remake

Depending on you raylib installation, you may need to specify its directory. Use the RAYLIB_DIR variable to indicate raylib's installation path when running the CMake:

cmake -DCMAKE_BUILD_TYPE=Release -DRAYLIB_DIR=/usr/local/lib ..

There are also other binaries generated for testing purposes. Feel free to try them out.

Note on assets

This repository will not contain the assets used in the game, such as fonts, art, and sfx. However, the program should still run without those. Assets are placed in the res/ directory.