Crame

Crame is a code-first game engine (inspired by others like Löve2D or Monogame) that allows you to write Crystal code to make your own game.

Installation

  1. Get the source code and run shards build --release --no-debug --production in it.

  2. Make sure the executable (in bin/) is present in your PATH. Alternatively, you can grab it where you want to execute it.

  3. Run crame new <my-game>, replacing <my-game> with the name of your game.

Usage

In your game project, you should get the file src/main.cr with the following content:

require "crame"

class MyGame::Game1 < Crame::Game
  def initialize
    super "Crame", Crame::Vector2.new(800, 600)
  end

  def update(dt : Time::Span)
  end

  def physics_update(dt : Time::Span)
  end

  def draw
  end
end

begin
  MyGame::Game1.new.run
ensure
  GC.collect
end

None of the callbacks are required here, you can even decide to remove them if you want. The only things you shouldn't remove are the initialize content and the top-level code. (they are required to make your game work properly).

Once you've programmed what you want, you can execute crystal src/main.cr, and admire the beauty of what you made.

Development

TODO Write development instructions here

Known issues

None at the moment :)

Contributing

  1. Fork it (https://codeberg.org/crame-engine/crame/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