I'm very new to the Raycasting algorithim, and was reading a webpage on how it works with CPP code to accompany. I followed what the page described and converted it into Python/Pygame and then ran it, but my result was very different. I have a feeling it has something to do with
try:
deltaDistX = sqrt(1 + (rayDirY * rayDirY) / (rayDirX * rayDirX));
deltaDistY = sqrt(1 + (rayDirX * rayDirX) / (rayDirY * rayDirY));
except ZeroDivisionError:
pass
Here is the code I wrote: http://pastebin.com/nLW6ELvv
And here is the webpage on Raycasting: http://lodev.org/cgtutor/raycasting.html
Help is appreciated <3