0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
| function tutorials.sample(deltaTime)
addGameAnnouncement("[color:KONSOLE_BREEZE_NEON_GREEN]Welcome to the tutorial![/color]") -- TODO: should be showwindow method instead
addGameAnnouncement("Wait for 3 seconds...")
wait(3) -- Wait for 3 seconds
addGameAnnouncement("Now press the [color:KONSOLE_BREEZE_WARM_BROWN_ORANGE]'A'[/color] key.")
waitForKeyPress("KEY_A") -- Wait for the 'A' key press
debug("'A' key pressed!")
-- show a color coded message in a window and wait for a tutorial window closed event
-- If the window contained multiple buttons, there will be a table payload to indicate which button was pressed
showTutorialWindow("You have [color:KONSOLE_BREEZE_TEAL_GREEN]completed[/color] the tutorial!")
pauseGame() -- Pause the game before locking the controls
lockControls() -- Lock the controls except gui
waitForEvent("tutorial_window_closed") -- Wait for a specific in-game event
unlockControls() -- Unlock the controls
unpauseGame() -- Unpause the game
addGameAnnouncement("Screen fade test.")
fadeOutScreen(10) -- Fade out the screen in 1 second
wait(10)
fadeInScreen(1) -- Fade in the screen in 1 second
addGameAnnouncement("[color:KONSOLE_BREEZE_NEON_GREEN]Tutorial completed![/color]")
end
|