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
-
Get the source code and run
shards build --release --no-debug --productionin it. -
Make sure the executable (in bin/) is present in your PATH. Alternatively, you can grab it where you want to execute it.
-
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
- Fork it (https://codeberg.org/crame-engine/crame/fork)
- Create your feature branch (
git checkout -b my-new-feature) - Commit your changes (
git commit -am 'Add some feature') - Push to the branch (
git push origin my-new-feature) - Create a new Pull Request
Contributors
- FlutterTal - creator and maintainer