darksteeldanger
The first post I made in this topic has a link that explains it somewhat.
Basically what I did is make a top view game. Then I made a sprite for each vertical line across the screen. Then the player on the top view shoots a spread of bullets, one for each vertical line. When a bullet hits a wall then the corresponding vertical slice is made visible and it's height is set to 100*1/distance(bullet, player).
For the 2nd example I used the math here to find more precise wall intersections.
http://paulbourke.net/geometry/lineline2d/
For the texture I first split it into a frame per vertical slice. Then when the bullet(or ray) hits a wall I calc what texture slice to use by where on the line is hit.
New version with more fixes:
* multiple textures
* commented
* changed walls from lines to polygons.
https://www.dropbox.com/s/czgsjbqz6lubf ... .capx?dl=1
/examples11/raycast3.capx