glerminal/lua-examples/basic/main.lua
Shylie 939fea0fa7
Some checks failed
Make PNG / build-app (push) Failing after 6s
Initial lua API
2024-05-29 18:53:47 -04:00

29 lines
551 B
Lua

local time = 0
function glerminal.init()
if not glerminal.sprites('sprites.png') then
print('failed to load sprites')
end
for i = 1, 40 do
for j = 1, 25 do
glerminal.set(i, j, 1, 2)
end
end
glerminal.tint(1, 0xA0FFFFFF)
glerminal.flush()
end
function glerminal.main(dt)
time = time + dt / 2
for i = 1, 40 do
for j = 1, 25 do
glerminal.offset(i, j, 1, math.cos(time * i / math.pi), math.sin(time * j / math.pi))
end
end
glerminal.flush()
end