pixelfaucet/examples/particles.cr

28 lines
416 B
Crystal
Raw Permalink Normal View History

2022-01-04 02:55:39 +01:00
require "../src/game"
require "../src/emitter"
module PF
class Example < Game
@emitter : Emitter
def initialize(*args, **kwargs)
super
@emitter = Emitter.new
@emitter.position = viewport / 2
2022-01-04 02:55:39 +01:00
end
def update(dt)
2022-01-04 02:55:39 +01:00
@emitter.update(dt)
end
def draw
clear(0, 0, 0)
@emitter.draw(self)
end
end
end
example = PF::Example.new(200, 200, 2)
example.run!