singe/testScripts/author/adventure3d.game
2026-09-14 22:32:53 -05:00

53 lines
3 KiB
Text

-- Genre two of milestone 3: the same adventure in a modelled room from a fixed camera -- Grim
-- Fandango's shape. The rules, the dialogue, the verbs, and the parser are the 2D game's own,
-- taken from its description; only the types and the rooms are new. That the rules do not
-- change between a painting and a scene is the point.
local base = dofile("testScripts/author/adventure2d.game")
return {
title = "Author test: adventure in 3D",
size = { w = 720, h = 480 },
layers = { { kind = "scene3d", ambient = { r = 80, g = 80, b = 100 }, fov = 50 }, { kind = "overlay" }, base.layers[2] },
vars = { score = 0, allowed = false },
verbs = base.verbs,
dialogues = base.dialogues,
rules = base.rules,
types = {
floor = { look = { kind = "mesh", shape = "box", w = 16, h = 0.4, d = 12, r = 80, g = 70, b = 60 }, behaviours = { { kind = "solid" } } },
hero = { look = { kind = "model", file = "testScripts/Models/Fox.glb", scale = 0.008, w = 0.6, h = 0.8, d = 0.6 },
behaviours = { { kind = "walker", speed = 2.5, radius = 0.3 }, { kind = "animator", idle = "Survey", walk = "Walk" } } },
door = { look = { kind = "mesh", shape = "box", w = 1.2, h = 2.4, d = 0.2, r = 90, g = 60, b = 40 },
behaviours = { { kind = "hotspot", name = "door", walkX = 5, walkY = 0, walkZ = -3 } } },
key = { look = { kind = "mesh", shape = "sphere", w = 0.3, r = 255, g = 220, b = 60 },
behaviours = { { kind = "hotspot", name = "key", walkX = -3, walkY = 0, walkZ = 1 } } },
guard = { look = { kind = "mesh", shape = "cylinder", w = 0.7, h = 1.8, r = 80, g = 120, b = 200 },
behaviours = { { kind = "hotspot", name = "guard", walkX = 3.2, walkY = 0, walkZ = -1.5 } } },
camera = { look = { kind = "none" }, behaviours = { { kind = "camera", mode = "fixed", lookX = 0, lookY = 0.5, lookZ = -1 } } },
marker = { look = { kind = "none" } },
readout = { look = { kind = "text", text = "", r = 235, g = 235, b = 245 } }
},
rooms = {
{ name = "hall",
navFrom = { "floor" },
entities = {
{ type = "floor", id = "floor", x = 0, y = -0.2, z = -1 },
{ type = "camera", id = "camera", x = 0, y = 6, z = 8 },
{ type = "door", id = "door", x = 5, y = 1.2, z = -4.2 },
{ type = "guard", id = "guard", x = 4, y = 0.9, z = -3 },
{ type = "key", id = "key", x = -3, y = 0.15, z = 0 },
{ type = "hero", id = "hero", x = -4, y = 0, z = 3 },
{ type = "readout", id = "readout", x = 12, y = 12, z = 0 }
} },
{ name = "yard",
navFrom = { "floor" },
entities = {
{ type = "floor", id = "floor", x = 0, y = -0.2, z = -1 },
{ type = "camera", id = "camera", x = 0, y = 6, z = 8 },
{ type = "door", id = "door", x = -5, y = 1.2, z = -4.2 },
{ type = "marker", id = "arrival", x = -4, y = 0, z = -2 },
{ type = "readout", id = "readout", x = 12, y = 12, z = 0 }
} }
}
}