for x=mid(0,camera_x\8,level.width),mid(0,(camera_x+128)\8,level.width) do
for x=mid(0,camera_x\8,level.width),mid(0,(camera_x+128)\8,level.width) do
for y=mid(0,camera_y\8,level.height),mid(0,(camera_y+128)\8,level.height) do
for y=mid(0,camera_y\8,level.height),mid(0,(camera_y+128)\8,level.height) do
local tile=tile_at(x,y)
local tile=tile_at(x,y)
if level.pal and fget(tile,7) then level.pal() end
if level.pal and fget(tile,7) then level.pal() end
if tile~=0 and fget(tile,0) then spr(tile,x*8,y*8) end
if tile~=0 and fget(tile,0) then spr(tile,x*8,y*8) end
pal() palt()
pal() palt()
end
end
end
end
-- score
-- score
if show_score>175 then
if show_score>175 then
local off=level_index==14 and 40 or 0
local off=level_index==14 and 40 or 0
local b=level_index==14 and 10 or 7
local b=level_index==14 and 10 or 7
rectfill(34,5+off,98,47+off,1)
rectfill(34,5+off,98,47+off,1)
rectfill(32,3+off,96,45+off,0)
rectfill(32,3+off,96,45+off,0)
rect(32,3+off,96,45+off,b)
rect(32,3+off,96,45+off,b)
local gb=level_index==8 and berry_count==8 and 115 or level_index==14 and 115 or 21
local gb=level_index==8 and berry_count==8 and 115 or level_index==14 and 115 or 21
local gt=minutes<1 and 116 or minutes==1 and seconds<30 and 116 or berry_count==8 and minutes<2 and 116 or level_index==14 and minutes<10 and 116 or 87
local gt=minutes<1 and 116 or minutes==1 and seconds<30 and 116 or berry_count==8 and minutes<2 and 116 or level_index==14 and minutes<10 and 116 or 87
local gd=death_count<=0 and 117 or 71
local gd=death_count<=0 and 117 or 71
spr(gb,44,9+off)
spr(gb,44,9+off)
?"x "..berry_count..(level_index==8 and "/8" or ""),56,11+off,7
?"x "..berry_count..(level_index==8 and "/8" or ""),56,11+off,7
spr(gt,44,21+off)
spr(gt,44,21+off)
draw_time(56,21+off)
draw_time(56,21+off)
spr(gd,44,33+off)
spr(gd,44,33+off)
?"x "..death_count,56,34+off,7
?"x "..death_count,56,34+off,7
end
end
for o in all(objects) do
for o in all(objects) do
if o.base==player and o.draw_back then o:draw() end
if o.base==player and o.draw_back then o:draw() end
end
end
-- draw objects
-- draw objects
local p
local p
for o in all(objects) do
for o in all(objects) do
if o.base==player then p=o else o:draw() end
if o.base==player then p=o else o:draw() end
end
end
if p and not p.draw_back then p:draw() end
if p and not p.draw_back then p:draw() end
-- draw snow
-- draw snow
draw_snow()
draw_snow()
-- draw fg clouds
-- draw fg clouds
if level.fogmode then
if level.fogmode then
if level.fogmode==1 then fillp(0b0101101001011010.1) end
if level.fogmode==1 then fillp(0b0101101001011010.1) end