This Project runs way faster using TurboWarp https://turbowarp.org/1125337538?fps=250&hqpen&stuck&limitless B = Bake Heatmap [this will take a long time] (Can be modified, see inside) [currently at highest quality may lower it to improve performance] This project is still in early development. I spent 6hrs of my day making this lol. This project is a very optimized raycasting algorithm that bakes the map data into simple to run raycasting data.
Pros Very efficient(High fps) runs on any map that was made within scratch (May not work on images since scratch bases the [if touching<>] on pixels) Heatmap[what renders at the beginning] only has to be rendered once per map Cons Map cannot contain moving parts or be modified [you must load another heatmap to modify the raycasting] heatmap takes a long time to generate at higher qualities and especially in open areas of the map [this is due to the heatmap being generated by very basic raycasting] Raycasting may bleed through thin parts of the map. Rays/Sample may get replaced with Steps Per Pixel SPP. This should even out the speed for generating the heatmap and more importantly it balances the quality of the render making the heatmap sample more when close up and sample less far way making the quality of the heatmap more accurate the closer you are to colliding with the map. should help with rays bleeding through map Heatmap quality is in work. I will be greatly improving the quality of the heatmap and raycast as 480x360 is a low resolution and is insufficient now a day. I'm guess this change will slow down the rendering of the heatmap but speed up and improve the quality of the raycast :)