-- Written by Forge/AuthorCompile.singe. Edit by hand or in the editor; either is fine. return { types = { camera = { behaviours = { { kind = "camera", lag = 0.2, lookY = 0.6, mode = "follow", target = "hero", x = 0, y = 3, z = 7 } }, look = { kind = "none" }, vars = {} }, floor = { behaviours = { { kind = "solid" } }, look = { b = 90, d = 12, g = 110, h = 0.4, kind = "mesh", r = 90, shape = "box", w = 30 }, vars = {} }, hero = { behaviours = { { down = "DOWN", kind = "keys", left = "LEFT", right = "RIGHT", up = "UP" }, { height = 0.9, jump = 6.5, kind = "character", radius = 0.3, speed = 4 }, { idle = "Survey", kind = "animator", walk = "Walk" } }, look = { d = 0.6, file = "Forge/kit/fox.glb", h = 0.9, kind = "model", scale = 0.008, w = 0.6 }, vars = {} }, ledge = { behaviours = { { kind = "solid" } }, look = { b = 70, d = 4, g = 90, h = 0.4, kind = "mesh", r = 110, shape = "box", w = 4 }, vars = {} }, prize = { behaviours = { { kind = "trigger" } }, look = { b = 60, g = 200, kind = "mesh", r = 255, shape = "sphere", w = 0.6 }, vars = {} }, readout = { look = { b = 245, g = 235, kind = "text", r = 235, text = "score 0" } } }, layers = { { fov = 55, kind = "scene3d" }, { kind = "overlay" } }, rooms = { { entities = { { id = "readout", type = "readout", x = 12, y = 12 }, { id = "floor", type = "floor", x = 0.0, y = -0.2, z = 0.0 }, { id = "ledge", type = "ledge", x = 6.0, y = 1.2, z = 0.0 }, { id = "prize", type = "prize", x = 6.0, y = 2.0, z = 0.0 }, { id = "hero", type = "hero", x = -4.0, y = 0.5, z = 0.0 }, { id = "camera", type = "camera", x = -4.0, y = 3.0, z = 7.0 } }, name = "start", tracks = {} } }, rules = { { act = { { "setText", entity = "readout", text = "\"score \" .. score" } }, note = "The readout, every frame", on = "frame" }, { act = { { "setState", entity = "self", state = "walk" } }, each = "hero", note = "Walking is a state the animator plays", on = "frame", when = { { "test", expr = "self.dx != 0 or self.dy != 0" } } }, { act = { { "setState", entity = "self", state = "idle" } }, each = "hero", note = "Standing still", on = "frame", when = { { "test", expr = "self.dx == 0 and self.dy == 0" } } }, { act = { { "jump", entity = "hero" } }, note = "Jump, with ground underfoot", on = "frame", when = { { "keyPressed", key = "SPACE" }, { "onGround", entity = "hero" } } }, { a = "prize", act = { { "destroy", entity = "self" }, { "addScore", amount = 100 }, { "playSound", file = "Forge/kit/coin.wav" } }, b = "hero", note = "The prize is taken", on = "enter", when = {} }, { act = { { "moveTo", entity = "hero", x = -4, y = 0.5, z = 0 } }, note = "Fallen off the world", on = "frame", when = { { "test", expr = "hero.y < -5" } } } }, title = "Field", vars = { score = 0 } }