mirror of
https://github.com/SleepingInsomniac/pixelfaucet
synced 2024-12-30 22:23:23 +01:00
25 lines
445 B
Crystal
25 lines
445 B
Crystal
require "../src/game"
|
|
|
|
module PF
|
|
class Static < Game
|
|
@buffer_size : Int32
|
|
@buffer : Pointer(UInt32)
|
|
|
|
def initialize(*args, **kwargs)
|
|
super
|
|
@buffer_size = width * height
|
|
@buffer = screen.pixel_pointer(0, 0)
|
|
end
|
|
|
|
def update(dt, event)
|
|
end
|
|
|
|
def draw
|
|
0.upto(@buffer_size) do |n|
|
|
(@buffer + n).value = PF::Pixel.random.to_u32
|
|
end
|
|
end
|
|
end
|
|
end
|
|
|
|
PF::Static.new(400, 300, 3).run!
|