Posted: 15th Mar 2007 14:51
Hi,
I'm working on a maze game whereby the maze is made up of a grid of 64x64 squares, and each grid can be a wall, door, or empty.
I've followed the approach of one of the DBPro tutorials which involved creating a cube at each point of the grid where there is a wall - but clearly, the number of cubes on screen at one time can be large and so the program crawls along.
To solve this, I've created a function to analyse the map and create a box of the required size to replace cubes on successive grid points, i.e. if a wall runs from 1,3 to 10,3, then instead of creating a cube at 1,3, then another at 2,3, and so on until 10,3, I create a box at 1,3 with length 10 and width 1 (and height 1).
However, when I try to apply a texture to the box, the texture is stretched on one side, but OK on the other; and if I scale the texture, then this sorts out the problem on one side, but then creates a problem on the other.
So is there a way to control textures better for the inbuilt primitive objects? Or is there another way to achieve this flexibility of being able to create walls dynamically in the code, and to be able to texture the sides separately?
Any help appreciated - I can post screenshots/code if this would help.