̬̬̬̈̬̬̬̬̈̬̬̬̬̬̪쬪̬̬̬̪쬪 ~ end -- Change position of balls based on speed properties ball1.x = ball1.x + ball1s.x if ball1.x < 0 or ball1.x > 240 then ball1s.x = -ball1s.x end ball1.y = ball1.y + ball1s.y if ball1.y < 0 or ball1.y > 136 then ball1s.y = -ball1s.y end ball2.x = ball2.x + ball2s.x if ball2.x < 0 or ball2.x > 240 then ball2s.x = -ball2s.x end ball2.y = ball2.y + ball2s.y if ball2.y < 0 or ball2.y > 136 then ball2s.y = -ball2s.y end ball3.x = ball3.x + ball3s.x if ball3.x < 0 or ball3.x > 240 then ball3s.x = -ball3s.x end ball3.y = ball3.y + ball3s.y if ball3.y < 0 or ball3.y > 136 then ball3s.y = -ball3s.y end end A kp'`'!Ԑ' k@ 'Bzd'ices ЧrD<_tDtD<tDtD TIC-80 tiny computer version 1.2.3051-dev (8f7f36d) https://tic80.com (C) 2017-2026                   tD'0o'H' ϋ'k1pj' kpj' kppj' k'pj' k' $'']'P'`' '''' r'0001:00'0' Ï' c'0000:00/0000:00:15.1/i2c_designware.1/i2c-1/i2c-FRMW0001:00 l l n'k _~'acpi !'p' @'2c_hid_acpi MODALIAS=acpi:FRMW0001:PNP0C P'o,'Bz NAME="Video Bus" PHYS="LNXVIDEO/video/input0" PROP=0 EV=3 KEY=3e000b00000000 0 0 0 MODALIAS=input:b0019v0000p0006e0000-e0,1,kE0,E1,E3,F1,F2,F3,F4,F5,ramlsfw  n }' !C'T'@ o('`0)'I#"""""""2333333333333333""""""""""""""""""""""""""""""""23333333333333333333""""""""""""""""""""""""""""""33333333333333333333333#"""""""""""""""""""""""""33333333333333333333333333#""""""""""""""""""""""23333333333333333333333333333"""""""""""""""""""""333333333333333333333333333333""""""""""""""""""""23333333333333333333333333333333"""""""""""""""""""233333333333333333333333333333333""""""""""""""""""333333333333333333333333333333333#""""""""""""""""23333333333333333333333333333333333""""""""""""""""23333333333333333333333333333333333#"""""""""""""""333333333333333333333333333333333333""""""""""""""""333333333333333333333333333333333333#""""""""""""""23333333333UUU33333333333333333333333#""""""""""""""2333333333UUUUU33333333333333333333333""""""""""""""233333333UUUUUU53333333333333333333333#"""""""""""""33333333SUUUUUUU3333333333333333333333#"""""""""""""33333333UUUUUUUU3333333333333333333333#"""""""""""""3333333SUUUUUUUU533333333333UU333333333"""""""""""""3333333SUUUUUUUU53333333333UUUU53333333"""""""""""""3333333UUUUUUUUU5333333333SUUUUU3333333"""""""""""""3333333UUUUUUUUU5333333333UUUUUU5333333#""""""""""""3333333UUUUUUUUU5333333333UUUUUU5333333#"""""""""""""3333333UUUUUUUUU533333333SUUUUUU5333333#"""""""""""""3333333UUUUUUUUU333333333SUUUUUUU333333#"""""""""""""3333333SUUUUUUUU333333333SUUUUUUU333333#"""""""""""""3333333SUUUUUUU5333333333SUUUUUUU333333#"""""""""""""33333333UUUUUUU3333333333SUUUUUU5333333#"""""""""""""33333333SUUUUU333333333333UUUUUU5333333#""""""""""""233333333UUUU3333333333333UUUUUU5333333#""""""""""""23333333333333333333333333SUUUUU3333333"""""""""""""233333333333333333333333333UUUU53333333""""""""""""""333333333333333333333333333UU333333333""""""""""""""3333333333333333333333333333333333333#""""""""""""""2333333333333333333333333333333333333#"""""""""""""""333333333333333333333333333333333333""""""""""""""""333333333333333333333333333333333333""""""""""""""""23333333333333333333333333333333333#"""""""""""""""""3333333333333333333333333333333333""""""""""""""""""2333333333333333333333333333333333""""""""""""""""""33333333333333333333333333333333#""""""""""""""""""23333333333333333333333333333333""""""""""""""""""""233333333333333333333333333333""""""""""""""""""""""3333333333333333333333333333#"""""""""""""""""""""""33333333333333333333333333#"""""""""""""""""""""""""233333333333333333333333#"""""""""""""""""""""""""""233333333333333333333#"""""""""""""""""""""""""""""""""""""""""""233#"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" """"""""""""""""""""""""""""""""""" """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" """""""""""""""""""""""""""""""""""""""""""""""""|-- title: Metaballs -- author: Phoebe Harris -- desc: I made some metaballs -- script: lua -- version = 1.1 -- license: CC0 ball1 = {x=20, y=20, r=25} ball2 = {x=30, y=30, r=25} ball3 = {x=90, y=25, r=35} ball1s = {x=0.5, y=0.5} ball2s = {x=-0.5, y=-0.5} ball3s = {x=-2.0, y=0.0} function TIC() cls() for x=0, 239 do -- TODO: Iterate over ball table to find distances ball1xdist = math.abs(x - ball1.x) ball2xdist = math.abs(x - ball2.x) ball3xdist = math.abs(x - ball3.x) if ball1xdist <= 50 or ball2xdist <= 50 or ball3xdist <= 50 then for y=0, 135 do -- TODO: Iterate over ball table to find distances ball1ydist = math.abs(y - ball1.y) ball2ydist = math.abs(y - ball2.y) ball3ydist = math.abs(y - ball3.y) if ball1ydist <= 50 or ball2ydist <= 50 or ball3ydist <= 50 then -- TODO: Clear up this mess dist1x = x - ball1.x dist1y = y - ball1.y dist2x = x - ball2.x dist2y = y - ball2.y dist3x = x - ball3.x dist3y = y - ball3.y pixdist1 = (dist1x * dist1x) + (dist1y * dist1y) pixdist2 = (dist2x * dist2x) + (dist2y * dist2y) pixdist3 = (dist3x * dist3x) + (dist3y * dist3y) intensity1 = ball1.r/pixdist1 intensity2 = ball2.r/pixdist2 intensity3 = ball3.r/pixdist3 intensity = intensity1 + intensity2 + intensity3 -- TODO: More colours (with custom palette?) if intensity >= 0.7 then pix(x, y, 5) elseif intensity >= 0.1 then pix(x, y, 3) elseif intensity >= 0.025 then pix(x, y, 2) end end end end end ball1.x = ball1.x + ball1s.x if ball1.x < 0 or ball1.x > 240 then ball1s.x = -ball1s.x end ball1.y = ball1.y + ball1s.y if ball1.y < 0 or ball1.y > 136 then ball1s.y = -ball1s.y end ball2.x = ball2.x + ball2s.x if ball2.x < 0 or ball2.x > 240 then ball2s.x = -ball2s.x end ball2.y = ball2.y + ball2s.y if ball2.y < 0 or ball2.y > 136 then ball2s.y = -ball2s.y end ball3.x = ball3.x + ball3s.x if ball3.x < 0 or ball3.x > 240 then ball3s.x = -ball3s.x end ball3.y = ball3.y + ball3s.y if ball3.y < 0 or ball3.y > 136 then ball3s.y = -ball3s.y end end