Skip to content
Download

Switch rooms

if self.vida <= 0 then goTo("GameOver") end
if count("Enemy") == 0 then fadeTo("Fase2", 0.6) end
if pressed("reiniciar") then restart() end
if pressed("sair") then quit() end
  • The switch happens at the end of the frame; the rest of the step finishes normally.
  • The instances of the current room are destroyed, except persistent and global ones: Keep data between rooms.
  • fadeTo switches with a screen fade.
  • The start room is defined in Project › Project settings… › Start room.

Reference: Rooms and window.