Story & Presentation
Cutscene System
Simple dialogue and scene transitions:
# CutscenePlayer.gd
var current_scene = 0
var scenes = [
{"text": "Commander: The Zeta fleet is attacking our colonies!", "duration": 3},
{"text": "We need you to pilot the new X-Wing prototype.", "duration": 3},
{"text": "Good luck out there, pilot!", "duration": 2, "action": "start_game"}
]
func play_scene():
if current_scene >= scenes.size():
return
var scene = scenes[current_scene]
$Label.text = scene.text
$AnimationPlayer.play("show_text")
yield(get_tree().create_timer(scene.duration), "timeout")
if scene.has("action"):
call(scene.action)
current_scene += 1
play_scene()
func start_game():
get_tree().change_scene("res://Game.tscn")
Mission Briefing Screen
Display level information:
# MissionBriefing.gd
func show_mission(level_data):
$Title.text = level_data.title
$Description.text = level_data.description
$Objectives.text = ""
for objective in level_data.objectives:
$Objectives.text += "• " + objective + "\n"
$AnimationPlayer.play("enter")
yield(get_tree().create_timer(5.0), "timeout")
$AnimationPlayer.play("exit")
yield($AnimationPlayer, "animation_finished")
emit_signal("briefing_complete")
# Example level data
var level1 = {
"title": "MISSION 1: BREAKTHROUGH",
"description": "Penetrate the enemy defense line and destroy the carrier.",
"objectives": [
"Destroy all radar installations",
"Defeat the carrier boss",
"Survive for 5 minutes"
]
}
Ending Sequence
Show player results and story conclusion:
# EndingHandler.gd
func show_ending(score, rank, secrets_found):
$Score.text = "SCORE: %08d" % score
$Rank.text = "RANK: " + rank
if secrets_found >= 5:
$EndingText.text = ending_data.true_ending
else:
$EndingText.text = ending_data.normal_ending
$AnimationPlayer.play("scroll_text")
yield($AnimationPlayer, "animation_finished")
$ContinuePrompt.show()
var ending_data = {
"normal_ending": "You defeated the Zeta fleet...\nbut their homeworld remains...",
"true_ending": "With the Zeta homeworld destroyed...\npeace returns to the galaxy..."
}
Modernizing Classic Storytelling
Techniques to enhance classic shooter narratives:
- Environmental Storytelling: Show damage to ships, fleeing civilian craft
- Radio Chatter: Random mission updates during gameplay
- Unlockable Lore: Collect data logs that expand the universe
- Branching Paths: Different levels based on mission choices
Exercise:
Create a simple "codex" system where players can view collected story fragments. Store which entries have been unlocked in a dictionary and save/load it using Godot's ResourceSaver.