Discuss Scratch

ZacksterZachary
New Scratcher
16 posts

Does someone know what's wrong with my raycasting code?

awesome-llama
Scratcher
1000+ posts

Does someone know what's wrong with my raycasting code?

It's working.



Though there are a few things to take note of:
  • You are in a wall when you start (the position 0,0)
  • Only half the screen is drawn with lines. This can be fixed by making “Webp3” start at x=-238. Just modify the number in the first go to block in it.
  • It's slow. Enabling “turbo mode” will allow you to see it render much faster. Hold shift and click the green flag to toggle it. To fix this, you'll have to change your code a bit to use custom blocks set to run without screen refresh and remove any blocks which add delay (such as broadcast and wait). The movement, sensing and drawing can be done from a single sprite which can make this a lot easier to do.

Last edited by awesome-llama (Jan. 16, 2022 16:01:10)

ZacksterZachary
New Scratcher
16 posts

Does someone know what's wrong with my raycasting code?

Thanks for helping me with my code!
ZacksterZachary
New Scratcher
16 posts

Does someone know what's wrong with my raycasting code?

But there is one problem. It didn't save. So it's back to what it was before.
ZacksterZachary
New Scratcher
16 posts

Does someone know what's wrong with my raycasting code?

I fixed it. Thanks for the help!

Powered by DjangoBB