Nothing is showing up when i try it for some reason and i want to know why.
code:
var player = [0, 0, 1, 90]
var raycast = [0, 0]
do {
raycast[1] = raycast[1] + (Math.sin(player[3]) * 2)
raycast[2] = raycast[2] + (Math.cos(player[3]) * 2)
ctx.fillRect(Math.floor(raycast[1]), Math.floor(raycast[2]), 50, 50)
} while (blocks[Math.floor(raycast[1]*raycast[2])] == 0);
i tried flooring the values, as shown on the code.
i expected to work, but it resulted in nothing.
can someone please tell me if something is wrong, i don’t have more information about it sorry.