Discuss Scratch

maowMaowQN
Scratcher
22 posts

Help needed with raycasting layers

So I was following a @griffpatch tutorial when it suddenly stopped working and the coin sprite is stamping on top of the walls
https://scratch.mit.edu/projects/1331305817/
ThreeLived
Scratcher
100+ posts

Help needed with raycasting layers

Setting distance to a random value (like 0 or any string) reveals that there are 2 sprites being rendered as entities, even though i believe you only have one. Looking now, you added it to the list twice! That means it automatically pretty much overrides anything else in the Z buffer. Also, check the way your calculating distance. Its probably incorrect in some way, it doesnt seem to be working right.

I dont know if it was in the tutorial, but your way of actually insertion sorting looks really weird. usually only 1 repeat until loop is required to my belief

(Here is what i had updated)
maowMaowQN
Scratcher
22 posts

Help needed with raycasting layers

ThreeLived wrote:

Setting distance to a random value (like 0 or any string) reveals that there are 2 sprites being rendered as entities, even though i believe you only have one. Looking now, you added it to the list twice! That means it automatically pretty much overrides anything else in the Z buffer. Also, check the way your calculating distance. Its probably incorrect in some way, it doesnt seem to be working right.

I dont know if it was in the tutorial, but your way of actually insertion sorting looks really weird. usually only 1 repeat until loop is required to my belief

(Here is what i had updated)
Ok thank you!!

Powered by DjangoBB