chroma_solstice/npc.lua

23 lines
717 B
Lua
Raw Normal View History

2026-08-08 00:09:44 -04:00
require "entity"
require "dialogable"
2015-03-14 05:36:02 -04:00
2026-08-08 00:09:44 -04:00
-- A dialogable placed in the world. Signs, npcs and artifacts will each be a
-- small Entity subclass that includes Dialogable and names its own book; Sign is
-- the first. It just picks art + a story — the talking lives in the mixin.
Sign = class("Sign", Entity)
Sign:include(Dialogable)
function Sign:initialize(x, y)
self.book = startSignBook
2015-03-14 05:36:02 -04:00
Entity.initialize(self, {
2026-08-08 00:09:44 -04:00
x = x, y = y,
color = "red", -- representative only; sprites are per-channel
2015-03-16 08:47:08 -04:00
collision = "unmoveable",
2026-08-08 00:09:44 -04:00
sprites = {
red = loadSprite("art/npc/start_sign_r.png"),
green = loadSprite("art/npc/start_sign_g.png"),
blue = loadSprite("art/npc/start_sign_b.png"),
},
2015-03-14 05:36:02 -04:00
})
2026-08-08 00:09:44 -04:00
end