Hello,
Today, i've wanted to make something cool, like a platformer. But, with a twist. You see, instead of using a game development tool like RayLib or Unity, i will use plain FrameBuffer and C to create a platformer game. This way, you will learn how to create a game from scratch.
NOTE: This game is Linux only as it uses <linux/fb.h>
to control framebuffer. Porting this to other platforms like Windows might cause bugs or stupid stuff that is not intended.
This is a very basic example of how to create a platformer game. You can expand it to make it more complex.
First, let's install some required packages:
-
Install GCC:
For Ubuntu/Debian:
sudo apt-get install gcc
For Arch Linux/Manjaro:
sudo pacman -S gcc
For Fedora:
sudo dnf install gcc
-
Build the game:
make
This will create an executable named pfs
.
1st, compile the game:
make
2nd, enter TTY mode by pressing Ctrl+Alt+F1 or F2, then login with your user and password.
CD into the game directory, where you cloned the repo. Then, run the game:
./pfs
Now you can play the game!
Use A and D to move left and right, and space bar to jump.