A smarter and more precise (but probably not faster) method of raycasting than the standard step-by-step method. Works with thin geometry, but sometimes skips solid walls. Idk why :| Spacebar to change demo level. This method is not limited to shadow casting, it's built for general raycasting needs. How it works: Initiate: -Set costume to a line that's at least 600 pixels long, with one end located in the center of the canvas. For each raycast: If the initial line is touching a hitbox, repeat ~12 times (otherwise, stop the script): { Check if line is touching a hitbox. -If it is, set the costume to a line that's half as long as the first costume. -If it's not, move forward the length of the line. } Then: Set costume to a small dot. -If touching a hitbox, move backwards until out of it. -If not touching anything, move forward until touching a hitbox.