calculating tiles bright tile-based diversion ("raytracing")
i'm minute small tile-based game, i'd support light sources. nonetheless algorithm-fu too weak, hence i help.
the conditions this: there tile-based map (held 2d array), containing unparalleled light source several equipment station around. i wish calculate tiles bright adult light source, shadow.
a visible assist feeling like, approximately. l light source, xs equipment patience light, 0s bright tiles, -s tiles shadow.
0 0 0 0 0 0 - - 0
0 0 0 0 0 0 - 0 0
0 0 0 0 0 x 0 0 0
0 0 0 0 0 0 0 0 0
0 0 0 0 l 0 0 0 0
0 0 0 0 0 0 0 0 0
0 0 0 x x x x 0 0
0 0 0 - - - - - 0
0 0 - - - - - - -
a fractional component even better, course, where tile half-shadow due being partially obscured. algorithm wouldn't have ideal - only apparently wrong graceful fast.
(of course, there churned light sources, nonetheless that's only loop.)
any takers?
Comments
Post a Comment