GameMode Class

From Heroes of Hammerwatch wiki
Jump to: navigation, search

Gamemode classes are defined using the [GameMode] metadata:

[GameMode]
class TestLevel : Campaign

The only possible parameter for this is default, which, if specified, causes the gamemode to load as the default gamemode if a level does not set a gamemode. In Heroes of Hammerwatch, this is always MainMenu.

Objects are constructed using this constructor:

ClassName(Scene@ scene)

Methods called from the engine

The engine calls the following functions, if they exist:

  • void Start(uint8, SValue@, StartMode)
  • void LobbyCreated(bool loadingSave)
  • void LobbyInviteAccepted(uint64 id)
  • void LobbyEntered()
  • void LobbyFailedJoin(bool host)
  • void GetPlayerSave(uint8)
  • void AddPlayer(uint8)
  • void RemovePlayer(uint8, bool)
  • void UpdateFrame(int, GameInput&, MenuInput&)
  • void UpdatePausedFrame(int, GameInput&, MenuInput&)
  • void PreRenderFrame(int)
  • void RenderFrame(int, SpriteBatch&)
  • void RenderFrameLoading(int, SpriteBatch&)
  • void ResizeWindow(int, int, float)
  • SValue@ Save()
  • void OnBindingInput(ControllerType, int)
  • void SystemMessage(string, SValue@)
  • void ChatMessage(uint8, string)
  • void LobbyDataUpdate()
  • void LobbyMemberDataUpdate(uint8)
  • void LobbyList(array<uint64>@)
  • void SetMenuState(MenuState)
  • bool MenuBack()
  • void ShowMessage(MenuMessage)
  • vec2 GetCameraPos(int)
  • vec4 GetVignette(int)
  • void Paused(bool)
  • void Generate(SValue@)
  • void OnExitGame()