Switch rooms
if self.vida <= 0 then goTo("GameOver") endif count("Enemy") == 0 then fadeTo("Fase2", 0.6) endif pressed("reiniciar") then restart() endif pressed("sair") then quit() endif (vida <= 0) goTo("GameOver");if (count<Enemy>() == 0) fadeTo("Fase2", 0.6f);if (pressed("reiniciar")) restart();if (pressed("sair")) quit();- 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.
fadeToswitches with a screen fade.- The start room is defined in Project › Project settings… › Start room.
Reference: Rooms and window.
