Find a file
2022-02-28 00:02:04 -05:00
assets Add precursor to texture information to tri 2022-02-27 12:49:48 -05:00
examples Add precursor to texture information to tri 2022-02-27 12:49:48 -05:00
scripts Only create link if it doesn't exist 2022-02-04 00:05:57 -05:00
spec Add precursor to texture information to tri 2022-02-27 12:49:48 -05:00
src Use out instead of uninitialized/pointer 2022-02-28 00:02:04 -05:00
.editorconfig Initial commit 🎮 2021-11-25 20:57:57 -05:00
.gitignore Add script to build all examples 2022-02-02 00:31:38 -05:00
LICENSE Initial commit 🎮 2021-11-25 20:57:57 -05:00
README.md Fix Typo 2022-02-27 12:53:20 -05:00
shard.yml Add precursor to texture information to tri 2022-02-27 12:49:48 -05:00

PixelFaucet Game

GitHub release

PixelFaucet is a "Game Engine" written in the Crystal programming language and uses SDL2 under the hood to create a window, renderer, and draw pixels. See the examples.

The examples can be built by running the ./scripts/build_examples.rb script. This will place the binaries in the examples/build folder.

Setup

PixelFaucet requires the crystal compiler which can be installed via homebrew

  • Install crystal
brew install crystal
  • Install sdl2
brew install sdl2
  • Create a new project:
crystal init app my_game
  • Add the dependency to your shard.yml:
dependencies:
  pixelfaucet:
    github: sleepinginsomniac/pixelfaucet
  • Run the shards command:
shards install

Usage

require "pixelfaucet/game"

class Example < PF::Game
  def update(dt)
  end

  def draw
    clear
    0.upto(width) do |x|
      0.upto(height) do |y|
        draw_point(x, y, PF::Pixel.random)
      end
    end
  end
end

e = Example.new(100, 60, 5)
e.run!

Documentation

Run crystal docs to generate documentation. The documentation can then be found under the docs folder.

Contributing

  1. Fork it (https://github.com/sleepinginsomniac/pixelfaucet/fork)
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

Contributors