mirror of
https://github.com/SleepingInsomniac/pixelfaucet
synced 2024-11-16 07:47:36 +01:00
24 lines
422 B
Crystal
24 lines
422 B
Crystal
require "../src/game"
|
|
require "../src/sprite"
|
|
|
|
module PF
|
|
class SpriteExample < Game
|
|
@sprite : Sprite
|
|
|
|
def initialize(*args, **kwargs)
|
|
super
|
|
@sprite = Sprite.new("./assets/walking.png")
|
|
end
|
|
|
|
def update(dt)
|
|
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!
|