2 Commits

Author SHA1 Message Date
95d4b6eb37 what the hell was I thinking when I wrote this 2025-05-31 22:06:48 -07:00
96312e3adf fix offset bugs 2025-05-31 22:05:47 -07:00

View File

@ -191,7 +191,8 @@ end
function ones(n) function ones(n)
local ret = 0 local ret = 0
while n != 0 do while n != 0 do
ret += 1 if (n&0x0.0001) ret += 1
n >>= 1
end end
return ret return ret
end end
@ -1591,7 +1592,7 @@ function flotilla:update()
-- distribute across box: -- distribute across box:
-- x = [4, 100) -- x = [4, 100)
-- y = [4, 80) -- y = [4, 60)
local x_interval,x_offset = 0,52 local x_interval,x_offset = 0,52
if min_col < max_col then if min_col < max_col then
@ -1601,8 +1602,8 @@ function flotilla:update()
local y_interval,y_offset=0,40 local y_interval,y_offset=0,40
if live_rows > 1 then if live_rows > 1 then
y_interval=76/(live_rows-1) y_interval=56/(live_rows-1)
x_offset=4-y_interval y_offset=4-y_interval
end end
-- now assign target locations -- now assign target locations
@ -1615,8 +1616,8 @@ function flotilla:update()
real_row += 1 real_row += 1
row_alive = true row_alive = true
end end
ship.want_x = ship.col * x_interval - x_offset ship.want_x = ship.col * x_interval + x_offset
ship.want_y = real_row * y_interval - y_offset ship.want_y = real_row * y_interval + y_offset
end -- ship updated end -- ship updated
end -- row updated end -- row updated
end -- table updated end -- table updated