I have never before gotten a raycaster to work, but I may have finally gotten a version to work in BASIC. It is incredibly slow, but if the code is correct, then this means I will be able to use it as a basis for converting it to other languages (like Axe, Assembly, Grammer). I know raycasters have been made many times, but I am glad to finally have made one myself
How I did it: Basically, I read through
a tutorial, tried to convert the C code to BASIC, failed (most likely a typo) then I tried it again a few days later and I made it properly (I think). I modified some of the code to optimise it for speed, I made some inputs as constants, and I made the viewing direction based on an angle measure instead of a vector. So essentially, there are three inputs-- the player (x,y) coordinate in the map and the angle at which they are turned. Also, the map data is stored in the last 31 columns of pixels on the graph screen.
I am pretty sure that there is still something wrong with the code, but I will try to work that out. As an example of what seems to be going wrong, if the viewing angle is 270 degrees (down) it seems that the rays only sweep from 270 degrees to about 315 instead of 225 to 315.