Skip to content
Download

Play and errors

The Play button (shortcut F5), in the top right corner, does three things in a row:

  1. Saves everything that is open.
  2. Compiles your C++ code. A box shows the progress: configurar → compilar → jogar (configure → compile → play).
  3. Opens the game in a separate window.
The game window running, with the scoreboard and the ship.

While the game is running, the button becomes Stop: click it (or press F5 again) to close the game. Closing the game window also works.

The Saída (Output) panel, at the bottom, shows what is going on:

  • == compilando (compiling) and the compiler’s messages;
  • == iniciando o jogo (starting the game) when the game opens;
  • == interrompido (stopped) when you press Stop;
  • messages from your game and notices from the editor, such as reloaded files.

Limpar (clear) erases the messages, and Rolar (scroll) keeps the Saída always at the end.

If the compiler finds a problem, the game doesn’t open and the Saída shows the error:

Output with the error C2143: ';' ausente antes de 'if' in Player.cpp, line 23, and the message o build falhou.
  • The error line tells the file, the line and the column, Player.cpp(23,5), and then the problem: ';' ausente antes de 'if' (missing ‘;’ before ‘if’). The compiler writes these messages in the language of your Visual Studio Build Tools.
  • Click the error: your code editor opens on the file, at the right line.
  • The last line confirms: o build falhou (código 1); o jogo não foi iniciado (the build failed; the game was not started).

Fix it, save and press Play again. To understand the most common messages, see Reading compiler errors.

At the foot of the editor, SDK ok and CMake ok show that Play has what it needs to compile. If either of them shows a problem, see Common problems.

In Projeto › Preferências… (Project › Preferences), the Editor de código (code editor) field chooses the program. Empty, Brasa uses VS Code (code), if it is installed, or the program associated with .cpp files.

The game runs in a tab next to the Editor, the Jogo (Game) panel. Click the game so it gets the keyboard. At the top of the panel, Neste painel (in this panel) or Numa janela (in a window) chooses where the next Play runs.