Let’s Make: Traffic Department 2192 – Part 31

Prototyping - Debriefing Design & Programming

The debriefing sequence is the final piece to closing our game flow loop. After the mission ends, we see the results of a mission and then the debriefing. Finally, we return to the main menu.

The game flow through a single mission

Objects

We're only adding one new object for the debriefing to display the results of the mission. We can fully reuse obj_briefing and it's child objects to create all the debriefing sequences.

Concept Object Notes
Mission Results obj_results This object shows the results screen which includes Vel's face, kill count, and a qualitative description of her progress.

 

Results Screen

This is what our results screen should look like

 

GML Code

We'll create the results object to mimic the screen above. Then we'll add new storyboards to the briefing object for the debrefing sequences. The room determines which storyboard type is loaded (rm_brief vs rm_debrief)

obj_results: Create 1

Register the keyboard and reference the game data object.

 

obj_results: Create 2

Set some variables used for display

 

obj_results: Create 3

Set the qualitative quotes in an array. We'll pull from the array later using an index derived from kill counts.

 

obj_results: Create 4

Sets a pair of arrays for each display line on the screen. One array defines the line color which alternates between light green and dark green. The other array holds the actual desired text. A third array for each line starts empty and we'll fill it in one character at a time like the original game. We display the third array. Note that in line 12, we've buried the calculation for the qualitative quote index. Every 15 kills iterates the quote.

 

obj_results: Destroy 1

Degregister the keyboard

 

obj_results: Destroy 2

Remove the stats from the mission we just completed

 

obj_results: Destroy 3

The results object creates the briefing object

 

obj_results: Step 1

Handle input in the same way we've always done. This time, any key will instantly complete the drawing or fade out if drawing has already finished.

 

obj_results: Step 2

Fading in and out. Fading out destroys the object when it's completely faded.

 

obj_results: Step 3

Add a character to the results screen each step, line by line, until completed.

 

obj_results: Draw 1

Render our completed text lines and Vel's face.

 

obj_briefing: Create 6

Storyboards for the mission 1 debriefing sequence

 

obj_briefing: Destroy 3

Updated obj_briefing destructor to go to the appropriate next room depending on the current room. This function will change for a third time by the end of this series.