̬̬̬̈̬̬̬̬̈̬̬̬̬̬̪쬪̬̬̬̪쬪 >?  !!!!!!!!!!!!!!!)!!!!!!!!!!!!!(!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!(!!!!!!!!!!!!!!!!!"""""""""""/"""""""""""""""""""""("""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""/""""""/""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""/"""""""""""""""""""""""("""""""""""""""""""""""""""""""""""""""/"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""/"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""/"""""""""/"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""/"""""""""////""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""/"""/"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""//"//""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""/"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""/""""""""""""""/"""""""""""""""""""""""""""""""""""""""""""""""""""")""""""""""""""""//////""""/""/"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""("""""""/"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""///////"""""/"/"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""/""""""/""/"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""222??22222222?2??222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222##/###########//############################################################################################2?2222222222222????222222222222222222222222222222222222222222222222222222222222622222222222222222222222222222#//#############///########################################################cccccc###########################3333333333333???3?33333333333333333333333333333333333333333333333333333366666666633333333333333333333333333?333333333333?33333333333333333333333333333333333333333333333333333333333cccccccccc333333333333333333333333333333333333333?33333333333333333333333333333333333333333333333333333333336666vwww666663333333333333333333333333333333333333333333333333?3333333333?333333333333333333333333333333333333ccccwwwwwwgccc333333333333333333333333333333333333?3333??3333333333333333333?3333?333333333333333333333333333333333666wwwwwwww7666333333333333333333333333333333333333333?3333333333??33333333333333333333333333333333333333333333333cccswwwwwwwwwccc3333333333333333333333CCCCCCCCCCCCOOCCCCCOCCCCCCCCCCCCOCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCswwwwwwwwwwwCCCCCCCCCCCCCCCCCCCCCCCC444444444444444444444444444444444444444444444444444444444444444444444444444ddwwwwwwwwwwwwgd4444444444444444444444CCCCCCCCCCCOCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCwwwwwwwwwwwwGCCCCCCCCCCCCCCCCCCCCCCC44444444444444444?4444444444444444444444444444444444444444444444444444444444ddtwwwwwwwwwwwwwdd444444444444444444444DDDDDDDDDDDDDDDDDDDODDDDDDDDDDDODDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDFFwwwwwwwwwwwwwwGFFDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDOODDDDDDODDODDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDddwwwwwwwwwwwwwwgdDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDODDDDDDDDDDDDDODDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDFvwwwwwwwwwwwwwwwFFDDDDDDDDDDDDDDDDDDDDDDDDDDDDDODDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDddtwwwwwwwwwwwwwwwddDDDDDDDDDDDDDDDDDDDDDDDDDDDDDODDDDDDDODDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDFvwwwwwwwwwwwwwwwFFDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDODDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDddwwwwwwwwwwwwwwwwgdDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDODDDDODDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDFwwwwwwwwwwwwwwwwGFDDDDDDDDDDDDDDDDDDDDDDDDDDDDODDDDDDDDDDDODDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDddwwwwwwwwwwwwwwwwgdDDDDDDDDDDDDDDDDDDDDjgfgwwgwgwwggfgffvfwvwwvwvwwvfvfffgwwgwgwwgwwggfjfvvwvvwvwwvgvfffjfffgwgwwgwwgwfgffvfvvwvwwvwwvfvfjjgwggwgwwgwfgff̬̪̪lfvvwvwwvwwvgvff̪̬̪̪fffgwgwwgwfgfff̻̬̼vfvvfwvgvvfvf̪ffgvggfggfgf̪fffvfvvfvfff̪̪ffgfggfgff̬̪̪fffvffff̬̬̪̪jfffffj̬̪̫̫kfk̬˼˼̈̌ȈȈȌ̈Ȍ؎ގތ̌Ȉ̌̈̈̌Ȉ̌Ȉ̈Ȍ̈̌̌̌̌Ȍ̈ވ̌̎؎Ȉ̌Ȍ̈ގގ̌ݍȌ̈̍ݍ݈̌̈̈؈ݍ̌Ȉ̌܍݈݈̈ȌȌ̌؍݈ȈȌ̌̌ݍݍȈȈݍݍ̈̌ݍ݈Ȍ̈̌ݍݍt#-- title: Sundown -- author: OsloOMA -- desc: A soundless, serene beach demoscene. -- script: lua -- Math shortcuts local sin = math.sin local cos = math.cos local floor = math.floor local min = math.min local max = math.max local random = math.random local abs = math.abs -- Time variable local t=0 -- Tables for scene elements local clouds = {} local palm = {} local birds = {} -- Table for birds -- Foam y-position for interpolation local foam_y=110 -- Custom color palette for "after golden hour" function set_palette() local p={ {20,15,40}, -- 0: Deep Twilight Blue {45,30,65}, -- 1: Dark Purple {80,40,80}, -- 2: Muted Magenta {140,60,90}, -- 3: Deep Pink {200,80,90}, -- 4: Soft Red/Orange {240,120,80}, -- 5: Muted Orange {255,180,100},-- 6: Bright Horizon Glow {255,230,180},-- 7: Sun Core {225,225,240},-- 8: Foam/Cloud Highlight {160,170,180},-- 9: Cloud Base {30,40,70}, -- 10: Dark Water {45,60,100}, -- 11: Mid Water {70,90,140}, -- 12: Light Water {190,170,130},-- 13: Dark Sand (Wet) {210,190,150},-- 14: Light Sand (Dry) {25,20,15} -- 15: Silhouette Color } for i=0,15 do local c=p[i+1] poke(0x3fc0+i*3,c[1]);poke(0x3fc0+i*3+1,c[2]);poke(0x3fc0+i*3+2,c[3]) end end -- Initialize clouds function init_clouds() for i=1,8 do table.insert(clouds, { x = random(0, 240), y = 15 + random(20), size = random(15, 25), speed = 0.04 + random()* 0.03 }) end end -- Initialize the palm tree function init_palm() -- The new palm tree is drawn procedurally and doesn't need these values. end -- Initialize birds function init_birds() for i=1,2 do table.insert(birds, { x = random(240), y = 40 + random(25), speed = 0.4 + random() * 0.4, phase = random() * 5 }) end end -- Draws a sky gradient with dithered transitions. function draw_sky() local dither = function(y_start, y_end, c1, c2) for y=y_start, y_end do for x=0,239 do pix(x, y, (x+y)%2==0 and c1 or c2) end end end rect(0, 0, 240, 18, 0); rect(0,22,240,16,1) rect(0, 42, 240, 16, 2); rect(0, 62, 240, 6, 3) rect(0, 72, 240, 8, 4) dither(18, 21, 0, 1); dither (38, 41, 1, 2) dither(58, 61, 2, 3); dither(68, 71, 3, 4) end -- Draws the sun with dithered edges. function draw_sun() local sun_x, sun_y = 180, 80 local outer_r, inner_r = 20, 16 -- Dither the outer glow for y = sun_y - outer_r, sun_y + outer_r do for x = sun_x - outer_r, sun_x + outer_r do local dist = math.sqrt((x - sun_x)^2 + (y - sun_y)^2) if dist <= outer_r and dist > inner_r then if (x + floor(y)) % 2 == 0 then local sky_y = floor(y) if sky_y >= 0 and sky_y < 136 then -- only draw if it's on a sky pixel if peek(y*240+x) < 5 then pix(x, y, 6) end end end end end end -- Draw solid inner core circ(sun_x, sun_y, inner_r, 7) end -- Update and draw clouds with vertical bobbing. function update_and_draw_clouds() for i, c in ipairs(clouds) do c.x = (c.x + c.speed) % 250 local bob = sin(t*0.01+i)*2 local y_pos=c.y+bob circ(c.x, y_pos, c.size, 9) circ(c.x+c.size*0.6, y_pos+4, c.size*0.8, 8) circ(c.x-c.size*0.5, y_pos+2, c.size*0.7, 9) end end -- UPDATED: Ocean with vertically swaying distant waves. function draw_ocean_and_beach() -- Draw base colors first rect(0, 80, 240, 38, 10) -- Deep water base rect(0, 118, 240, 18, 14) -- Dry sand base -- Water and Reflection pixel-by-pixel clip(0, 80, 240, 136-80) local tide_speed, wave_speed = 0.005, 0.005 local tide_level = 115+(sin(t*tide_speed)*10)+(sin(t*0.05)*1.5)+(cos(t*0.115)*1.0) foam_y = foam_y + (tide_level - foam_y) * 0.04 for y=80, 135 do for x=0, 239 do local wave_height = sin(y/5+x/20+t*wave_speed)*2 + cos(x/15-t*wave_speed*1.5)*3 local current_y = y + wave_height if current_y < tide_level then -- Ocean water -- Dithered water gradient for smooth color transitions local col = 10 if y > 94 and y < 98 then -- Dither zone 1 (color 10 to 11) col = (x+y)%2==0 and 10 or 11 elseif y >= 98 and y < 106 then col = 11 elseif y >= 106 and y < 110 then -- Dither zone 2 (color 11 to 12) col = (x+y)%2==0 and 11 or 12 elseif y >= 110 then col = 12 end -- NEW: Distant waves with vertical sway -- This effect is applied on top of the dithered water colors if y > 86 and y < 98 then -- Furthest, slowest wave layer local wave1_crest = 89 + cos(x/50 - t*0.0025) * 2 if y > wave1_crest and y < wave1_crest + 0.8 then col = 11 -- Crest color end -- Closer, faster wave layer local wave2_crest = 86 + sin(y/35 + t*0.02) + cos(x/16 + t*0.002) * 2 if y > wave2_crest and y < wave2_crest + 1.2 then col = 12 -- Brighter crest color end -- Closer, faster wave layer local wave2_crest = 93 + cos(y/50 + t*0.04) + sin(x/16 + t*0.003) * 2 if y > wave2_crest and y < wave2_crest + 1.2 then col = 12 -- Brighter crest color end end -- Sun reflection (existing logic) local distorted_x = x+sin(y*0.3+t*0.05)*6 local sun_dist = (distorted_x-180)^2+(y-80)^2 if sun_dist < 450+wave_height*25 then local reflection_strength = 1-(sun_dist/(450+wave_height*25)) reflection_strength = reflection_strength*(0.8+0.2*sin(x*2+t*0.25)) if reflection_strength>0.7 then col=7 elseif reflection_strength>0.5 then col=(x+y)%2==0 and 7 or 6 elseif reflection_strength>0.3 then col=6 end end pix(x,y,col) elseif y < 118 then -- Wet sand area pix(x,y,13) elseif y >= 118 and y < 122 then -- Dither transition for sand pix(x,y, (x+y)%2==0 and 13 or 14) elseif current_y < foam_y + 3 and y > 90 then pix(x,y,13) end -- Foam drawing if current_y > foam_y - 2.5 and current_y < foam_y and random(10) > 6 then pix(x,y,8) end end end clip() end -- Draw a silhouetted, swaying palm tree function draw_palm_tree() local trunk_x = 45 local trunk_base_y = 136 local sway = sin(t * 0.02+random()*0.02) * 4 -- Draw Trunk local x1, y1 = trunk_x + sway*0.2, trunk_base_y for i = 1, 13 do local p = i / 13 local bend = sin(p * 3.14159) * 7.0 -- curve local x2 = trunk_x + bend +sway * (p^2) local y2 = trunk_base_y - i * 5.5 -- Draw a thick line line(x1, y1, x2, y2, 15) line(x1 + 1, y1, x2 + 1, y2, 15) x1, y1 = x2, y2 end -- Draw Fronds local top_x, top_y = x1, y1 for i = 0, 6 do local angle = i * 0.8 + 6 + sin(t*0.02 + i) * 0.15 local frond_len = 35 + sin(i*2)*5 local x_end = top_x + cos(angle) * frond_len local y_end = top_y - sin(angle) * frond_len * 0.8 local cx1, cy1 = top_x, top_y for j = 1, 20 do local p = j/20 local px = cx1 + (x_end-cx1)*p local py = cy1 + (y_end-cy1)*p local droop = sin(p * 3.14159) * 8 circ(px, py - droop, 1, 15) end end end -- Update and draw flying birds. function update_and_draw_birds() for i, b in ipairs(birds) do b.x = b.x - b.speed if b.x < -10 then b.x = 250 b.y = 40 + random(25) end local wing_y = sin(t * 0.1 + b.phase) * 2.5 -- Bird shape using two lines for wings line(b.x, b.y, b.x - 5, b.y - wing_y, 15) line(b.x, b.y, b.x + 5, b.y - wing_y, 15) end end function TIC() if t==0 then set_palette() init_clouds() init_palm() init_birds() end cls(0) draw_sky() draw_sun() update_and_draw_clouds() draw_ocean_and_beach() -- Draw foreground elements last update_and_draw_birds() draw_palm_tree() t=t+1 end