can someone plz tell me how to raycast plz? I'm such a terrible programer & I want to at least know how to make a first-person-view game where you just walk around in a small cave...PLZ HELP. :(:(:( I'll follow you :)
It's kind of complex. Raycasting (in this context) is the art of finding defined blocks by shooting rays out and seeing if they hit anything. Thus, basic trigonometry, good knowledge of BASIC, and time to make maps is required. Do you have these three?
You may want to go look up ti85calc's spooky maze on smilebasicsource. If I remember the game has a raycasting library. But basically you would have a map array with block codes. you would also have an x, y position and rotation of the character, and a way to map that to your block array. Using trig send out virtual rays from angle - field of view to angle plus field of view. You find intersecting
for each ray find the closest intersecting solid block, and what pixel column it intersect's with. then draw the column of pixels for that block scaled bigger or smaller based on distance. For now just colo the ceiling and floor a solid color. All this gets slow very quickly. I am sure there are plenty of c code tutorials around the internet. May be old dos code, beware.