mirror of
https://github.com/SleepingInsomniac/pixelfaucet
synced 2025-01-06 05:24:17 +01:00
24 lines
429 B
Crystal
24 lines
429 B
Crystal
require "../src/game"
|
|
require "../src/sprite"
|
|
|
|
module PF
|
|
class SpriteExample < Game
|
|
@sprite : Sprite
|
|
|
|
def initialize(*args, **kwargs)
|
|
super
|
|
@sprite = Sprite.new("./assets/pf-font.png")
|
|
end
|
|
|
|
def update(dt, event)
|
|
end
|
|
|
|
def draw
|
|
clear(255, 255, 255)
|
|
@sprite.draw_to(screen, (viewport // 2) - @sprite.size // 2)
|
|
end
|
|
end
|
|
end
|
|
|
|
game = PF::SpriteExample.new(200, 200, 2)
|
|
game.run!
|