local function init(self, std)
self.x = self.width/2
self.y = self.height/2
self.size = 80
self.hspeed = self.width/5000
self.vspeed = self.height/4000
end
local function loop(self, std)
self.x = self.x + (self.hspeed * std.delta)
self.y = self.y + (self.vspeed * std.delta)
if self.x <= 1 or self.x >= self.width - self.size then
self.hspeed = -1 * self.hspeed
end
if self.y <= 1 or self.y >= self.height - self.size then
self.vspeed = -1 * self.vspeed
end
end
local
function draw(
self, std)
std.draw.clear(std.color.black)
std.image.draw('icon80x80.png', self.x, self.y)
end
local
function exit(
self, std)
end
local P = {
meta={
author='RodrigoDornelles',
description='a logo bouncing between the corners',
version='1.0.0'
},
assets={
'assets/icon80x80.png:icon80x80.png'
},
init=init,
loop=loop,
}
}
return P;
local function title(window_name)
local function draw(src, pos_x, pos_y)
local function callbacks(handler)