local Window = require("window") local win local x,y, vx,vy = 0,0, 1,1 function _init() win = Window:new("Hey! lookit me! I'm a window!", 32,32, 320, 100) win.resizable = true win.onclose = function() sys.exit() end sys.stepinterval(1000/60) end function _step(t) win:step(t) view.active(win.mainvp) local w,h = view.size(win.mainvp) x=x+vx y=y+vy if x < 0 then vx = 1 end if y < 0 then vy = 1 end if x > w then vx = -1 end if y > h then vy = -1 end --gfx.cls() gfx.fgcolor(math.random(255)) gfx.bar(x-4,y-4, 8,8) end