I think it could be called that. Hmm, now that I think about it, its just a raycasting example. Eh, whatever, boredom prevails again.
sync on
backdrop on
color backdrop 0
hide mouse
type vector2d
x as float
y as float
endtype
type lightSource
source as vector2d
angle as float
range as float
radius as float
endtype
spotlight as lightSource
spotlight.source.x = 320 :
spotlight.source.y = 240 :
spotlight.angle = 45 : `0=360
spotlight.range = 200 : `0-infinity
spotlight.radius = 50 : `basically its half the number of rays you want
radius# = 10
REPEAT
ink rgb(255,120,100),0
circle mousex(), mousey(), radius#
ink rgb(255,255,130),0
r2 = 0 - spotlight.radius
for t = r2 to spotlight.radius
x# = sin(spotlight.angle+t)
y# = cos(spotlight.angle+t)
xx# = spotlight.source.x + x#*spotlight.range
yy# = spotlight.source.y + y#*spotlight.range
mx# = mousex()
my# = mousey()
vx# = mx# - spotlight.source.x
vy# = my# - spotlight.source.y
d# = vx#*x# + vy#*y#
if d# > 0-radius# and d# < spotlight.range+radius#
R = P0 + A*d
rx# = spotlight.source.x + x#*d#
ry# = spotlight.source.y + y#*d#
b# = sqrt((mx# - rx#)^2 + (my# - ry#)^2)
if b# < radius#
w# = radius# - b#
rx# = spotlight.source.x + x#*(d#-w#)
ry# = spotlight.source.y + y#*(d#-w#)
else
rx# = spotlight.source.x + x#*spotlight.range
ry# = spotlight.source.y + y#*spotlight.range
endif
else
rx# = spotlight.source.x + x#*spotlight.range
ry# = spotlight.source.y + y#*spotlight.range
endif
line spotlight.source.x, spotlight.source.y, rx#, ry#
next t
`spotlight.angle = wrapvalue(spotlight.angle+0.1)
sync
UNTIL spacekey()
PETA - People for the Eating of Tasty Animals