Nah, that's not it.
The idea is that you have to check one angle for every column on your display. That means you don't rotate the objects once for each
frame you draw - you rotate 'em once for each
column you draw. For the first column, you might rotate the objects viewAngle-25 degrees. For the second column, viewAngle-24 degrees… and so on, until 51 angles have been checked (one for each of the 51 columns making up your ComputerCraft computer's display).
These angles don't
have to be one degree apart - if you make the step size larger or smaller, you'll get a different FOV. You'll probably want a much larger one in the end. But regardless, you
do need to check one unique angle for each displayed screen column!
Think about what your real eyes are doing right now - you can see stuff that's exactly in line with the direction they're pointing, but you can
also see stuff that's on lots of different angles relative to their facing. You don't need to turn your eyes to make out something ten degrees to your left, for example - that angle's already included within your field of view, you already capture it within the left-hand side of the image you perceive. Each image captures things along multiple angles because your eyes have multiple receptors, same as the screen has multiple pixels, and the angle between each cell in your retina and the real-world objects around you is different!
So after rotating a given map object (bearing in mind that it's important to subtract the camera's position from the map object's position before rotating, so that each is rotated relative to the camera!), if its floored X value is 0, then you can assume that a line projected along the current column's angle from the camera would've hit that object. Take the absolute value of the rotated Y (which gets you the distance), and if you haven't found a hit that's closer then you cache the colour and distance values (discarding those of any other hits found thus far). When all objects are checked you draw the column, knowing the colour of the wall that should be drawn there, and how far away that wall is.
--# Psuedocode
local curColumn = 1
for curAngle = minimumFOVangle, maximumFOVangle do --# Should be 51 iterations, one for each screen column.
local colour, distance
for object in map do
local X, Y = rotatePoint(object.x - camera.x, object.y - camera.y, math.rad(curAngle))
if math.floor(X) == 0 and math.abs(Y) < distance then
distance = math.abs(Y)
colour = object.colour
end
end
drawWallInColumn(colour, distance, curColumn)
curColumn = curColumn + 1
end
Again, this is a "naive" way of coding things - it's simple, but quite inefficient. Once you've wrapped your head around it though, you'll hopefully be in a better position to understand a better way (applying basic trig to extend lines from the camera throughout the map to cut down on the number of checks needed).