Game Development
Testing in Play mode
Learn to enter Play mode and test the scene.
Play mode
The Play button on the Toolbar starts the game and switches the scene into Play mode. In Play mode the scene runs like a real game; you can still select objects and watch their values. When the test is over, press the same button again to return to Edit mode.
Edit modu -> nesneleri duzenlersin
Play modu -> sahneyi test edersin
When the Play button turns blue, you know the game is running.
Reset
Changes you make in Play mode are not permanent. When you exit Play, the scene returns to the state it had before you pressed Play; this is called a reset. Because of this, you should always make lasting changes in Edit mode.
Play -> kupun konumunu degistir
Cikis -> konum eski haline doner
For example, if you move the cube during Play, it will be back at its old place when you exit.
Exercise Print the scene test
Define an array named testler holding "Kamera", "Isik", and "Kup". With a loop, print a line for every test in the form Test: Kamera - gecti (the name changes per line). Add a final line Sahne testi tamamlandi. Expected output:
Test: Kamera - gecti
Test: Isik - gecti
Test: Kup - gecti
Sahne testi tamamlandi
Show example solution
using System;
class Test {
static void Main() {
string[] testler = { "Kamera", "Isik", "Kup" };
foreach (string test in testler) {
Console.WriteLine("Test: " + test + " - gecti");
}
Console.WriteLine("Sahne testi tamamlandi");
}
}
Test yourself
-
What happens when you press the Play button?
- The scene is saved permanently
- All objects are removed from the scene
- A new project is created
- The scene switches to Play mode and the game runs
Show answer
The scene switches to Play mode and the game runs — The Play button starts the game; the scene enters Play mode and the objects start behaving like in a game.
-
The result of exiting Play
string cikisSonucu = "____";
Show answer
string cikisSonucu = "konum eski haline doner";
-
Play mode terms
- Play düğmesi
- Starts and stops the game
- Play modu
- The state where the scene is tested
- Edit modu
- The state where objects are edited
- Reset
- Reverts the changes made during Play
Next lesson: Summary - First scene