-- title: water
-- author: pixelbath
-- desc: reference for water effect
-- create a mapping for darkening palette colors
-- note: this is for the default sweetie16 palette
drk={[0]=0,0,1,2,3,6,7,15,0,8,9,10,13,14,15,0}
function drawStars(count, seed)
math.randomseed(seed)
for i=1, count do
x=math.random(0,239)
y=math.random(0,68)
r=math.random(0,1)
pix(x, y, 12)
end
end
function doWater(posY)
t=time()/200
for x=0,239 do
for y=posY,135 do
-- introduce some wobble
ox=x+2*math.sin(t+y)
oy=posY-(y-posY)-1
oc=pix(ox,oy)
-- darken reflected pixel
pix(x,y,drk[oc])
end
end
end
function TIC()
cls(15)
drawStars(25, 0)
map(0,0,30,17,0,0,0)
doWater(68)
end
--
-- 066:0000000000000000000000000000000000000007000000070000000700000007
-- 067:0000000000000000000000000000000070000000770000007700000077000000
-- 081:0000000000000000007700000077000000770000077770000777700007777000
-- 082:0000007700000077000000770000077700000777000077770000777700007777
-- 083:7770000077700000777000007770000077770000777700007777700777777007
-- 084:0770000007700000777000007770000077700000777000007777000077770007
-- 085:0000000000000000000000000000000077000000777000007777000077770000
-- 096:0000000000000000000000000000000d00000ddd000ddddd00dddddddddddddd
-- 097:77777700777777dd777777dd7777777d7777777d7777777d7777777d7777777d
-- 098:0dd77777ddd77777dd777777dd777777dd777777dd777777dd777777dd777777
-- 099:77777dd777777dd777777dd777777dd777777ddd77777ddd77777ddd77777ddd
-- 100:7777000777770077777700777777dd777777dd77dddddd77dddddd77dddddd77
-- 101:77777000777770007777700077777000777770007777700077777d0077777ddd
-- 105:00000000000000000000000000000000000000000000000000000000000000dd
-- 106:0000000000000000000000000000000d0000dddd00dddddddddddddddddddddd
-- 107:000000000000000000000000dddddddddddddddddddddddddddddddddddddddd
-- 108:000000000000000000000000dd000000ddddd000ddddddd0dddddddddddddddd
-- 112:dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd
-- 113:dd777ddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd
-- 114:dd777777ddd77777ddddd777dddddddddddddddddddddddddddddddddddddddd
-- 115:77777ddd7777dddd7ddddddddddddddddddddddddddddddddddddddddddddddd
-- 116:dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd
-- 117:777ddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd
-- 118:ddd00000dddddddddddddddddddddddddddddddddddddddddddddddddddddddd
-- 119:00000000d0000000dddddddddddddddddddddddddddddddddddddddddddddddd
-- 120:0000000000000000dddddddddddddddddddddddddddddddddddddddddddddddd
-- 121:000ddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd
-- 122:dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd
-- 123:dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd
-- 124:dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd
-- 125:d0000000dd000000dddd0000dddddd00dddddddddddddddddddddddddddddddd
-- 126:00000000000000000000000000000000dd000000ddddd000dddddddddddddddd
-- 127:000000000000000000000000000000000000000000000000d0000000dddd0000
--
--
--
-- 000:1a1c2c5d275db13e53ef7d57ffcd75a7f07038b76425717929366f3b5dc941a6f673eff7f4f4f494b0c2566c86333c57
--