Skip to content

Latest commit

 

History

History
32 lines (23 loc) · 1.62 KB

README.md

File metadata and controls

32 lines (23 loc) · 1.62 KB

pixel

Pixel is a set of utilities on top of SFML for efficiently making video games. But not a lot of video games, cause it's pretty sparse right now. The code base is designed to be modular and easily hackable. Look at main.cpp for a detailed explanation on using it.

Here's a demo of main.cpp running. There's a white noise background on top of which a sprite has been loaded and controlled with the keyboard, with sounds. The sprite was made by converting a png to the .sprite format. You can use the sprite file generator (https://github.com/actuday6418/sprite_maker) to make a sprite like this one. make sure the dimensions you use have the same aspect ratio as the PNG.

demo

Building

chmod a+x give_me_exec.sh
mkdir build
cd build
cmake ..
cmake --build .

Incremental builds

./give_me_exec.sh This script builds the app and performs code formatting.

Using the framework

The backest backend basically takes a vector of numbers representing the value of saturation for each pixel, and renders it. You may use this lower level interface by extending the pixelMap class. The application class wraps around pixelMap, provides functionality for sprites, keyboard events and Audio. Look at main.cpp for an example that uses this layer of abstraction.

The sprite format

Check out sprite.md. Sprite files defines metatadata and color values for a sprite a user would like to use in an app.

Dependencies

  1. SFML apt install libsfml-dev
  2. GNU indent (For code formatting) apt install indent