mirror of
https://github.com/SleepingInsomniac/pixelfaucet
synced 2024-11-17 07:48:20 +01:00
24 lines
458 B
Crystal
24 lines
458 B
Crystal
require "../src/game"
|
|
require "../src/sprite"
|
|
|
|
module PF
|
|
class SpriteExample < Game
|
|
@bricks : Sprite
|
|
|
|
def initialize(*args, **kwargs)
|
|
super
|
|
@bricks = Sprite.new("./assets/pf-font.png")
|
|
end
|
|
|
|
def update(dt, event)
|
|
end
|
|
|
|
def draw
|
|
clear(255, 255, 255)
|
|
@bricks.draw(@screen, width // 2 - @bricks.width // 2, height // 2 - @bricks.height // 2)
|
|
end
|
|
end
|
|
end
|
|
|
|
game = PF::SpriteExample.new(200, 200, 2)
|
|
game.run!
|