Encounters
Each battle is an encounter. Each different group of monsters, each different boss, each different single monster, they're all encounters. Undertale used this system, Deltarune used it, and we will as well.
Encounter Basics
To start creating an encounter, you'll need to create a new file in the encounters
folder. Let's make an encounter with a single monster, being the Dummy enemy we made.
local Dummy, super = Class(Encounter)
function Dummy:init()
super.init(self)
-- Text displayed at the bottom of the screen at the start of the encounter
self.text = "* The tutorial begins...?"
-- Battle music ("battle" is rude buster)
self.music = "battle"
-- Enables the purple grid battle background
self.background = true
-- Add the dummy enemy to the encounter
self:addEnemy("dummy")
--- Uncomment this line to add another!
--self:addEnemy("dummy")
end
return Dummy
Aaaaaaaaand we're done.
Advanced Encounters
Okay, okay, some encounters are more advanced than that. For example, if you want to hide the world even if there's no background, you can set self.hide_world
to true. Battles can also skip the YOU WON! text with self.no_end_message = true
.
Encounters also have a massive list of callbacks, which you can read about here.