A game framework for libSDL2 on crystal, inspired by ippa/chingu.
Will be here soon.
Add this to your application's shard.yml
:
dependencies:
cringu:
github: cringu/cringu
require "cringu"
require "../cringu"
WWIDTH = 800_f64
WHEIGHT = 600_f64
LAYERS_ENABLED = true
class Square < GameObject
property size = 80_f64
def update
f = rand(0.1..0.9)
Graphics.draw_block(@pos.x * f, @pos.y * f, @size * f, BasicColor.sample);
end
end
5.times do
s = Square.new
s.pos.x = (WWIDTH / 2 - s.size / 2) * rand(0.1..0.9)
s.pos.y = (WHEIGHT / 2 - s.size / 2) * rand(0.1..0.9)
s.manage
end
NGine.setup WWIDTH, WHEIGHT
NGine.start
TODO: Write development instructions here
- Fork it ( https://github.com/cringu/cringu/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
- [jamiepirie] Jamie - creator, maintainer