Skip to content

A wrapper around RayLib used for a making particle simulation game.

Notifications You must be signed in to change notification settings

SametHope/HopeEngine

Repository files navigation

HopeEngine (or more like Particle System 'Game')

HopeEngine is a super basic 'game engine' that is technically just a basic wrapper around RayLib, specifically CsLo bindings of it. It doesn't even have any proper games. It only has the Particle Game which I think is still pretty neat.
But this is fine as this project, unlike its name may imply, doesn't intend to be a game engine of any sorts. It is just me trying out, (re)inventing and implementing sorts of things without any game engine involved from scratch as a learning practice and for fun.

Particle Game

This is a 'game' that basically simulates a lot of particles simply with their velocities, using mouse input to dedice whether attract or repel and using mouse position to scale the force of the action for each particle.
There are 256 000 particles being simulated. Update and draw logic are decoupled so drawing can be turned off, or the amount that is draws can be modified. You can reset the positions and velocities of the particles. You can sort-of rescale and reset the particles according to that.

All the features of the game are really written on it as green texts on top left anyway. Here are some cool pictures from the 'game'. 2024-01-12 23_40_36-The 'ParticleGame' 1 1 5 2024-01-12 23_39_44-The 'ParticleGame' 1 1 5 2024-01-12 23_37_01-The 'ParticleGame' 1 1 5 2024-01-12 23_36_42-The 'ParticleGame' 1 1 5 2024-01-12 23_36_10-The 'ParticleGame' 1 1 5 2024-01-12 23_35_24-The 'ParticleGame' 1 1 5

After-Thoughs

I could probably spend more time on figure out a better way to render the particles which is what most performance-heavy this is currently. Probably having the particles drawn on a texture and then drawing that texture could have been better.

For even better performance, using seperate threads for render and update logic would be great, however RayLib uses a OpenGL context which can not be written from another thread than it was created from as far as I know. There probably are some workarunds for this but I don't feel like tackling this problem.

I also could make a proper GUI where we could select colors, repelsion and attraction powers and make the particle count actually change rather than just not drawing them and acting as if they are gone.

Making another basic project within the project using the 'engine' (or looper as I call it often) would be pretty fun too, but after working on this project I learned to love game engines more for many reasons lol.

About

A wrapper around RayLib used for a making particle simulation game.

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages