pico8-0hh1/bg.lua
2022-07-07 23:06:28 +02:00

43 lines
736 B
Lua

function draw_animated_bg(startx)
if (amplitude <= 0) return
startx = startx or 0
fillp(0b0101101001011010)
local color = 4
-- vertical lines
local t = t()+10
for i=startx-1,127,11 do
local a=sin(i*t/512)*amplitude+64
local b=cos(i*t/256)*amplitude+64
line(
i,
a,
i,
b ,
color)
end
-- horizontal lines
for i=startx-1,127,11 do
local a=sin(i*t/512)*amplitude+64
local b=cos(i*t/256)*amplitude+64
line(
a,
i,
b ,
i,
color)
end
end
local players = {
{name="alice", hp=5},
{name="anemone", hp=10},
}
local current_player = players[2]
for player in all(players) do
printh("Hello, my name is "..player.name.."and my hp is"..player.hp)
end
printh("The active player is "..current_player.name)