Compare commits
3 Commits
d4a67acc9b
...
main
Author | SHA1 | Date | |
---|---|---|---|
bb14b03efd
|
|||
78fe254e96
|
|||
31fb5b83e9
|
@ -129,15 +129,8 @@ end
|
|||||||
-- (currently a placeholder)
|
-- (currently a placeholder)
|
||||||
|
|
||||||
function init_title()
|
function init_title()
|
||||||
|
--background gradient
|
||||||
pal({[0]=0x82,0x82,0x84,0x84,4,4,0x89,0x89,0x8e,0x8e,0x8f,0x8f,15,15,0x87,0x87},2)
|
pal({[0]=0x82,0x82,0x84,0x84,4,4,0x89,0x89,0x8e,0x8e,0x8f,0x8f,15,15,0x87,0x87},2)
|
||||||
local antbar = ants.new{
|
|
||||||
progress=-0.5,
|
|
||||||
bgcolor=8,
|
|
||||||
fgcolor=10,
|
|
||||||
trcolor=9,
|
|
||||||
speed=1/15,
|
|
||||||
w=128,h=2}
|
|
||||||
|
|
||||||
return view.of{
|
return view.of{
|
||||||
bg.new{c=15},
|
bg.new{c=15},
|
||||||
@ -148,18 +141,6 @@ function init_title()
|
|||||||
self.x=32+6*cos(time()/3.7)
|
self.x=32+6*cos(time()/3.7)
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
{update = function()
|
|
||||||
local p = antbar.progress + 0.003
|
|
||||||
if p > 1.5 then
|
|
||||||
p = -0.5
|
|
||||||
antbar.speed += 1/30
|
|
||||||
end
|
|
||||||
antbar.progress = p
|
|
||||||
end},
|
|
||||||
view.new{
|
|
||||||
views=antbar,
|
|
||||||
y=50,h=2,
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -279,6 +260,9 @@ end
|
|||||||
-->8
|
-->8
|
||||||
-- panel drawing
|
-- panel drawing
|
||||||
|
|
||||||
|
-- empty panel placeholder
|
||||||
|
nopanel = {}
|
||||||
|
|
||||||
-- panel in ordinary state
|
-- panel in ordinary state
|
||||||
panel = {
|
panel = {
|
||||||
-- plt: palette as table
|
-- plt: palette as table
|
||||||
@ -291,6 +275,7 @@ panel = {
|
|||||||
-- negative == mid-fall
|
-- negative == mid-fall
|
||||||
-- positive == bounce
|
-- positive == bounce
|
||||||
-- frames left
|
-- frames left
|
||||||
|
state="idle"
|
||||||
}
|
}
|
||||||
mknew(panel)
|
mknew(panel)
|
||||||
|
|
||||||
@ -310,6 +295,7 @@ prpblkp = {14,13,2,7}
|
|||||||
newblock = {
|
newblock = {
|
||||||
function()
|
function()
|
||||||
return panel.new{
|
return panel.new{
|
||||||
|
id=1,
|
||||||
plt=redblkp,
|
plt=redblkp,
|
||||||
sx=83,sy=1,
|
sx=83,sy=1,
|
||||||
ey=2, as=0,
|
ey=2, as=0,
|
||||||
@ -317,6 +303,7 @@ newblock = {
|
|||||||
end,
|
end,
|
||||||
function()
|
function()
|
||||||
return panel.new{
|
return panel.new{
|
||||||
|
id=2,
|
||||||
plt=ylwblkp,
|
plt=ylwblkp,
|
||||||
sx=83,sy=11,
|
sx=83,sy=11,
|
||||||
ey=2,as=0,
|
ey=2,as=0,
|
||||||
@ -324,6 +311,7 @@ newblock = {
|
|||||||
end,
|
end,
|
||||||
function()
|
function()
|
||||||
return panel.new{
|
return panel.new{
|
||||||
|
id=3,
|
||||||
plt=grnblkp,
|
plt=grnblkp,
|
||||||
sx=78,sy=11,
|
sx=78,sy=11,
|
||||||
ey=2,as=0,
|
ey=2,as=0,
|
||||||
@ -331,6 +319,7 @@ newblock = {
|
|||||||
end,
|
end,
|
||||||
function()
|
function()
|
||||||
return panel.new{
|
return panel.new{
|
||||||
|
id=4,
|
||||||
plt=blublkp,
|
plt=blublkp,
|
||||||
sx=83,sy=6,
|
sx=83,sy=6,
|
||||||
ey=2,as=0,
|
ey=2,as=0,
|
||||||
@ -338,6 +327,7 @@ newblock = {
|
|||||||
end,
|
end,
|
||||||
function()
|
function()
|
||||||
return panel.new{
|
return panel.new{
|
||||||
|
id=5,
|
||||||
plt=prpblkp,
|
plt=prpblkp,
|
||||||
sx=73,sy=11,
|
sx=73,sy=11,
|
||||||
ey=2,as=0,
|
ey=2,as=0,
|
||||||
@ -419,6 +409,42 @@ function ants:draw()
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-->8
|
||||||
|
-- gameplay logic
|
||||||
|
|
||||||
|
game={
|
||||||
|
incoming_frac = 0,
|
||||||
|
speed = 0,
|
||||||
|
gravity_lag = 30,
|
||||||
|
pop_lag = 20,
|
||||||
|
|
||||||
|
stop_frames = 0,
|
||||||
|
stop_max = 1,
|
||||||
|
life = 180,
|
||||||
|
life_max = 180,
|
||||||
|
}
|
||||||
|
|
||||||
|
mknew(game, function(ret)
|
||||||
|
local board = {}
|
||||||
|
for i=1,12 do
|
||||||
|
board[i] = {
|
||||||
|
nopanel, nopanel, nopanel, nopanel, nopanel, nopanel,
|
||||||
|
}
|
||||||
|
end
|
||||||
|
ret.board = board
|
||||||
|
ret.garbage_queue = {}
|
||||||
|
ret.garbage_source = source.new()
|
||||||
|
ret.floor_source = source.new()
|
||||||
|
end)
|
||||||
|
|
||||||
|
function game:update()
|
||||||
|
end
|
||||||
|
|
||||||
|
function game:draw()
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
__gfx__
|
__gfx__
|
||||||
0000000000111000011011000000000009999900066666000eeeee00077777000aaaaa0001111111000000000000000000000000000000000000000000000000
|
0000000000111000011011000000000009999900066666000eeeee00077777000aaaaa0001111111000000000000000000000000000000000000000000000000
|
||||||
00000000012221001221221000000000988888206bbbbb30eddddd207cccccd0a999994012222222300040400000000000000000000000000000000000000000
|
00000000012221001221221000000000988888206bbbbb30eddddd207cccccd0a999994012222222300040400000000000000000000000000000000000000000
|
||||||
|
Reference in New Issue
Block a user