/apps/demos/crawl: facing textures
This commit is contained in:
parent
b6347996f9
commit
a020b92824
BIN
apps/demos/crawl/data/assets/castledoors.png
(Stored with Git LFS)
Normal file
BIN
apps/demos/crawl/data/assets/castledoors.png
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
apps/demos/crawl/data/assets/lever.png
(Stored with Git LFS)
Normal file
BIN
apps/demos/crawl/data/assets/lever.png
(Stored with Git LFS)
Normal file
Binary file not shown.
@ -24,9 +24,13 @@
|
|||||||
X door
|
X door
|
||||||
open_on_signal : sg_torch0
|
open_on_signal : sg_torch0
|
||||||
tile_texture : /assets/mossy_rock.png
|
tile_texture : /assets/mossy_rock.png
|
||||||
|
face : horizon
|
||||||
|
face_texture : /assets/castledoors.png
|
||||||
/ lever
|
/ lever
|
||||||
on_interact_emit : sg_torch0
|
on_interact_emit : sg_torch0
|
||||||
tile_texture : /assets/mossy_rock.png
|
tile_texture : /assets/mossy_rock.png
|
||||||
|
face : observer
|
||||||
|
face_texture : /assets/lever.png
|
||||||
|
|
||||||
@meta
|
@meta
|
||||||
-- Arbitrary sections could be defined with value pairs.
|
-- Arbitrary sections could be defined with value pairs.
|
||||||
|
@ -54,6 +54,33 @@ function render_dungeon(dungeon)
|
|||||||
texture_region = { w = 128, h = 128 },
|
texture_region = { w = 128, h = 128 },
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if dungeon.grid[y][x].face_texture ~= nil then
|
||||||
|
if dungeon.grid[y][x].face == "horizon" then
|
||||||
|
draw_quad {
|
||||||
|
texture = dungeon.grid[y][x].face_texture,
|
||||||
|
v3 = { x = y * 2, y = 2, z = x * 2 + 1 },
|
||||||
|
v2 = { x = y * 2, y = 0, z = x * 2 + 1 },
|
||||||
|
v1 = { x = y * 2 + 2, y = 0, z = x * 2 + 1 },
|
||||||
|
v0 = { x = y * 2 + 2, y = 2, z = x * 2 + 1 },
|
||||||
|
texture_region = { w = 64, h = 96 },
|
||||||
|
}
|
||||||
|
draw_quad {
|
||||||
|
texture = dungeon.grid[y][x].face_texture,
|
||||||
|
v3 = { x = y * 2 + 2, y = 2, z = x * 2 + 1 },
|
||||||
|
v2 = { x = y * 2 + 2, y = 0, z = x * 2 + 1 },
|
||||||
|
v1 = { x = y * 2, y = 0, z = x * 2 + 1 },
|
||||||
|
v0 = { x = y * 2, y = 2, z = x * 2 + 1 },
|
||||||
|
texture_region = { w = 64, h = 96 },
|
||||||
|
}
|
||||||
|
elseif dungeon.grid[y][x].face == "observer" then
|
||||||
|
draw_billboard {
|
||||||
|
texture = dungeon.grid[y][x].face_texture,
|
||||||
|
position = { x = y * 2 + 1, y = 1, z = x * 2 + 1 },
|
||||||
|
size = { x = 1, y = 1 },
|
||||||
|
}
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user