-
Notifications
You must be signed in to change notification settings - Fork 2
Custom States
Eren edited this page Apr 13, 2025
·
2 revisions
States are menus. The main menu, song select menu, gameplay itself, etc., are each a state.
Create a states folder inside your mod folder and then create a .lua file in it. Paste the following code inside the .lua file:
local st = Gamestate:new(name) -- replace 'name' with the name of the state, usually the file's name.
st:setInit(function(self) -- initialization function, called when the state is loaded
end)
st:setUpdate(function(self,dt) -- update function, called every frame
end)
st:setBgDraw(function(self) -- background draw function, called every frame
end)
st:setFgDraw(function(self) -- foreground draw function, called every frame
end)
return stWhen you launch the game, your custom state will be added to the game. To activate it you do:
cs = bs.load('Name of the state')
cs:init()Click to join the Beatblock Modding Discord Server
For users:
For Mod Developers: