mirror of
https://git.shylie.info/shylie/glerminal.git
synced 2025-10-20 20:40:19 +00:00
Initial lua API
This commit is contained in:
29
lua-examples/basic/main.lua
Normal file
29
lua-examples/basic/main.lua
Normal file
@@ -0,0 +1,29 @@
|
||||
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
|
3
lua-examples/basic/sprites.png
Normal file
3
lua-examples/basic/sprites.png
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:6dee3efcdfa72e54a602f69643907bb8e8a3328d2b40c2116dce22ff179d8892
|
||||
size 182
|
Reference in New Issue
Block a user