So I am trying to make a ray casting game using ICE. The only problem is I can’t figure out how to display textures on to the walls. If you did not know ray casting is a technique to make a 2D map into a 3D world (for more information look at the wikipedia article). Long story short, I need to make each splice of a the wall textured. So far I have the 16 by 16 image saved to a sprite on my calculator and I need a way to take each splice of the image and display it onto the wall.
Question: How do I split up the sprite into multiple pieces/splices to display to my screen? Remember these splices have to be display at different hight and are one pixel wide.
What I have considered:
I have considered splitting the one 16x16 sprite into 16 different sprites that are 1 pixel wide and are 16 pixels high. This would not work because to texture the walls I would need to input the x value of the block slice location and get out the corresponding x value texture. The variables for the pointers to the sprites can’t be used to find the x position for the wall texture.
Sorry if this sound a bit confusing. I am kinda new to this.
Question: How do I split up the sprite into multiple pieces/splices to display to my screen? Remember these splices have to be display at different hight and are one pixel wide.
What I have considered:
I have considered splitting the one 16x16 sprite into 16 different sprites that are 1 pixel wide and are 16 pixels high. This would not work because to texture the walls I would need to input the x value of the block slice location and get out the corresponding x value texture. The variables for the pointers to the sprites can’t be used to find the x position for the wall texture.
Sorry if this sound a bit confusing. I am kinda new to this.