04-29-2024, 12:34 AM
(This post was last modified: 04-29-2024, 12:39 AM by 1micha.elok.)
(04-28-2024, 12:05 PM)Marcus Wrote: ...
I see that you currently use SetFloorTexture and SetCeilingTexture. They change the texture for all floor/ceiling tiles. You can use SetFloorTextureAt(tile_x, tile_z, img) and SetCeilingTextureAt(tile_x, tile_z, img) to change the floor/ceiling for individual tiles.
You can also use SetNorthWall(tile_x, tile_z, img), SetSouthWall(tile_x, tile_z, img), SetWestWall(tile_x, tile_z, img) and SetEastWall(tile_x, tile_z, img) to set textures for the individual wall sides of a tile.
...
Different Room Theme
click image to zoom in
Now, it is possible to have different room theme in wolf3d too ! Thanx, Marcus !
maze.txt
Code:
[[1,1,1,1,1,1,1],
[1,0,0,0,0,0,1],
[1,0,1,1,0,1,1],
[1,0,1,2,3,2,2],
[1,0,1,2,3,3,2],
[1,9,1,2,3,3,2],
[1,1,1,2,2,2,2]]
include wolf3d.n7
Code:
' tileset
tile = []
tile.wall = loadimage("data/wall.png")
tile.floor1 = loadimage("data/floor.png")
tile.ceiling1 = loadimage("data/ceiling.png")
tile.wall3 = loadimage("data/wall3.png")
tile.floor3 = loadimage("data/floor3.png")
tile.ceiling3 = loadimage("data/ceiling3.png")
'maze from json file
map = JSON_FromFile("data/maze.txt")
'set tileset
w3d.SetFloorTexture(tile.floor1)
w3d.SetCeilingTexture(tile.ceiling1)
for z = 0 to 7-1
for x = 0 to 7-1
select map[z][x]
case 1
w3d.SetWall(x, z, tile.wall)
case 2
w3d.SetWall(x, z, tile.wall3)
case 3
w3d.SetFloorTextureAt(x,z,tile.floor3)
w3d.SetCeilingTextureAt(x,z,tile.ceiling3)
case 9
player.x = x + 0.5
player.z = z + 0.5
endsel
next
next