07-17-2024, 11:26 AM
not one of Steve's titles, rather a mod
Code: (Select All)
randomize timer
screen _newimage(640, 480, 32)
n = 100000
dim x(n)
dim y(n)
dim vx(n)
dim vy(n)
dim nn(n)
for i=0 to n
x(i) = rnd*100
y(i) = rnd*480
vx(i) = rnd*4 - 2
if rnd>0.5 then
vy(i) = 0.2
else
vy(i) = -0.2
end if
nn(i) = 0
next
y01 = 215 + 35
y02 = 220 + 35 + 30
y11 = 260 - 35 - 30
y12 = 265 - 35
x0 = 600
do
cls
line (0,0)-(100,480),_rgb(255,255,255),b
line (100,y01)-(100,y02),_rgb(0,0,0)
line (100,y11)-(100,y12),_rgb(0,0,0)
'line (x0 - 10, 0)-(x0 + 10, 480),_rgba(0,0,0,255),bf
for i=0 to n
circle (x(i), y(i)), 1, _rgba(255,0,0,10)
if x(i) < 0 then vx(i) = -vx(i)
if (x(i) > 100) then
if (y(i)>y01) and (y(i)<y02) or (y(i)>y11) and (y(i)<y12) then
nn(i) = 1
else
if nn(i) = 0 then
vx(i) = -vx(i)
end if
end if
end if
if nn(i) = 1 and x(i) > x0 then
vx(i) = 0
vy(i) = 0
end if
if ((y(i) < 0) or (y(i) > 480)) and nn(i)=0 then vy(i) = -vy(i)
x(i) = x(i) + vx(i)
y(i) = y(i) + vy(i)
next
_display
_limit 100
loop until _keyhit = 27
![[Image: 8iACaoa.png]](https://i.imgur.com/8iACaoa.png)