Cabin Crew Express · Lesson 48 of 50 · Publishing · About 33 min
Ari's team has made a complete offline game. The team wants a clear choice that families can understand before installing it.

Download the projects from the course page. In Godot’s Project Manager, choose Import, select project.godot, and use Run Project (F5). Start from checkpoints/47 when the lesson builds on prior work, or copy the checkpoints/48 folder to try this lesson on its own. Read the file names in the steps before editing.


Build it step by step
Language and tools in this lesson int, %, floori(), mock data, asset register, licences.
-
Compare two offers
Describe a free whole game and a single paid download in one sentence each. Both classroom options provide every flight, with no ads or add-on payments. Decide what your learner project needs.
Why it works A plain offer tells players what they get and helps the team keep its plans realistic.
-
Try the pricing examples
Import checkpoint 48, select main.gd and press F5. Compare the free route and the paid practice case. Both are invented examples using pence.
Why it works Using whole pence avoids confusing £2.99 with the number 2.99 stored in a float.
-
Follow the calculation
Find estimate(). Revenue in the lab is price times the imagined number of downloads. It then models one made-up reduction. Find the division by 100.0 and trace it using a calculator.
var gross := price_pence * downloadsWhy it works The example rate is a classroom planning assumption. Real proceeds depend on store terms, fees, taxes, refunds and the real sales.
-
Keep proof for artwork and audio
Create an asset register with file name, creator, source and rights for your use. Recheck game art, icons, fonts and sound in the copy you plan to offer.
Why it works Being able to download or display a file does not automatically grant rights to include it in a game.
-
Check each store's pricing route
With an adult publisher, read Apple's current pricing and agreement details and Google Play pricing rules. Google Play explains why an app once offered free cannot be switched to paid under the same listing. Use a planning sheet to decide before first publication.
Why it works The choice affects plans. The publisher makes any real account, agreement or money decisions.
-
Draft the store description
State how many playable flights your build includes, the offline play you have verified and whether players pay to download it. Compare the draft with the tested game and project budget.
Why it works A description is a promise to players. Use tested information about the version you ship.
Watch the values change
-
Choose free Price is 0 pence.
What you see. Gross receipts are £0.00 in the exercise. -
Choose sample paid Five downloads at £2.99.
What you see. Total is £14.95 before the pretend deduction. -
Inspect net estimate The pretend deduction is 20 percent, rounded down to whole pence.
What you see. Practice retained amount is £11.96.
Predict before you run Does the exercise's 20 percent model tell you the real platform fees?
Reveal the answer
No. It is a practice deduction. Check current terms and exact circumstances with the publisher.
Complete checkpoint
The free example shows £0.00, and the paid sample shows £14.95 gross and £11.96 retained with the made-up deduction.
main.gd
extends Control
const Lab = preload("res://release_lab.gd")
const TITLE = "Decide whether to charge for the game"
var ui: VBoxContainer
func _ready() -> void:
ui = VBoxContainer.new()
ui.set_script(Lab)
add_child(ui)
ui.start(TITLE)
build()
func build() -> void:
ui.say("Compare two fictional offers. No payment happens. The deduction is a made-up classroom rate.")
ui.option("Plan a free download", estimate.bind(0, 5, 0))
ui.option("Plan a paid download", estimate.bind(299, 5, 20))
func estimate(price_pence: int, downloads: int, training_cut_percent: int) -> void:
var gross := price_pence * downloads
var training_cut := floori(float(gross * training_cut_percent) / 100.0)
var retained := gross - training_cut
ui.say("Sample receipts: %s. Pretend deduction: %s. Sample retained: %s." % [
money(gross), money(training_cut), money(retained)
])
func money(pence: int) -> String:
return "£%.2f" % (pence / 100.0)
release_lab.gd
extends VBoxContainer
var output: Label
func start(title_text: String) -> void:
set_anchors_and_offsets_preset(Control.PRESET_FULL_RECT)
offset_left = 32.0
offset_top = 28.0
offset_right = -32.0
offset_bottom = -28.0
add_theme_constant_override("separation", 12)
var background := ColorRect.new()
background.color = Color("#14283d")
background.mouse_filter = Control.MOUSE_FILTER_IGNORE
get_parent().add_child(background)
background.set_anchors_and_offsets_preset(Control.PRESET_FULL_RECT)
get_parent().move_child(background, 0)
var title := Label.new()
title.text = title_text
title.add_theme_font_size_override("font_size", 32)
title.add_theme_color_override("font_color", Color("#ffd293"))
add_child(title)
output = Label.new()
output.custom_minimum_size.y = 151.0
output.autowrap_mode = TextServer.AUTOWRAP_WORD_SMART
output.add_theme_font_size_override("font_size", 19)
add_child(output)
func say(message: String) -> void:
output.text = message
func option(label: String, command: Callable) -> void:
var button := Button.new()
button.text = label
button.custom_minimum_size.y = 46.0
button.add_theme_font_size_override("font_size", 19)
button.pressed.connect(command)
add_child(button)
GDScript line by line
Follow the line numbers, including the indent at the start of each line. Find the code the game will run first, then look for the function that reacts when you tap or change something.
Read main.gd line by line
-
extends ControlStarts with Godot's Control type. This script gets the abilities of that type and adds the game's own rules. -
const Lab = preload("res://release_lab.gd")Creates a constant named Lab. The expression prepares a resource at a fixed project path when the script is loaded. -
const TITLE = "Decide whether to charge for the game"Creates a constant named TITLE. The expression uses the text inside the quotes. -
var ui: VBoxContainerDeclares ui for later use. A colon followed by a type says which kind of value belongs here. -
func _ready() -> void:Godot calls this once after the scene and its children are ready. Use it to set up the room and connect controls. -
ui = VBoxContainer.new()Stores the new value in ui. The expression creates a new VBoxContainer object. -
ui.set_script(Lab)Calls ui.set_script with the values in its parentheses. -
add_child(ui)Adds the new node to the scene tree so that Godot can run and draw it. -
ui.start(TITLE)Calls ui.start with the values in its parentheses. -
build()Calls build with the values in its parentheses. -
func build() -> void:Defines build, a reusable set of instructions. Parameters between the parentheses receive inputs. A return type after the arrow tells you which kind of result to expect. -
ui.say("Compare two fictional offers. No payment happens. The deduction is a made-up classroom rate.")Calls ui.say with the values in its parentheses. -
ui.option("Plan a free download", estimate.bind(0, 5, 0))Calls ui.option with the values in its parentheses. -
ui.option("Plan a paid download", estimate.bind(299, 5, 20))Calls ui.option with the values in its parentheses. -
func estimate(price_pence: int, downloads: int, training_cut_percent: int) -> void:Defines estimate, a reusable set of instructions. Parameters between the parentheses receive inputs. A return type after the arrow tells you which kind of result to expect. -
var gross := price_pence * downloadsCreates a variable named gross. The expression calculates a new value from the expressions on either side of the operator. Godot infers the type from the first value. -
var training_cut := floori(float(gross * training_cut_percent) / 100.0)Creates a variable named training_cut. The expression calls floori with the values in its parentheses. Godot infers the type from the first value. -
var retained := gross - training_cutCreates a variable named retained. The expression calculates a new value from the expressions on either side of the operator. Godot infers the type from the first value. -
ui.say("Sample receipts: %s. Pretend deduction: %s. Sample retained: %s." % [Calls ui.say with the values in its parentheses. -
money(gross), money(training_cut), money(retained)Calls money with the values in its parentheses. -
])Continues the same instruction on a new line. This is one of the arguments, data entries or expressions started above. -
func money(pence: int) -> String:Defines money, a reusable set of instructions. Parameters between the parentheses receive inputs. A return type after the arrow tells you which kind of result to expect. -
return "£%.2f" % (pence / 100.0)Finishes the function and hands its result back to the caller. The expression uses the text inside the quotes.
Read release_lab.gd line by line
-
extends VBoxContainerStarts with Godot's VBoxContainer type. This script gets the abilities of that type and adds the game's own rules. -
var output: LabelDeclares output for later use. A colon followed by a type says which kind of value belongs here. -
func start(title_text: String) -> void:Defines start, a reusable set of instructions. Parameters between the parentheses receive inputs. A return type after the arrow tells you which kind of result to expect. -
set_anchors_and_offsets_preset(Control.PRESET_FULL_RECT)Positions this Control relative to the bounds of its parent. -
offset_left = 32.0Stores the new value in offset_left. The expression reads 32.0. -
offset_top = 28.0Stores the new value in offset_top. The expression reads 28.0. -
offset_right = -32.0Stores the new value in offset_right. The expression reads -32.0. -
offset_bottom = -28.0Stores the new value in offset_bottom. The expression reads -28.0. -
add_theme_constant_override("separation", 12)Calls add_theme_constant_override with the values in its parentheses. -
var background := ColorRect.new()Creates a variable named background. The expression creates a new ColorRect object. Godot infers the type from the first value. -
background.color = Color("#14283d")Stores the new value in background.color. The expression builds a colour from these values. -
background.mouse_filter = Control.MOUSE_FILTER_IGNOREUpdates background.mouse_filter, which controls how this control participates in pointer and touch input. The expression reads Control.MOUSE_FILTER_IGNORE. -
get_parent().add_child(background)Calls get_parent with the values in its parentheses. -
background.set_anchors_and_offsets_preset(Control.PRESET_FULL_RECT)Positions this Control relative to the bounds of its parent. -
get_parent().move_child(background, 0)Calls get_parent with the values in its parentheses. -
var title := Label.new()Creates a variable named title. The expression creates a new Label object. Godot infers the type from the first value. -
title.text = title_textUpdates title.text, which controls the words a player sees. The expression reads title_text. -
title.add_theme_font_size_override("font_size", 32)Calls title.add_theme_font_size_override with the values in its parentheses. -
title.add_theme_color_override("font_color", Color("#ffd293"))Calls title.add_theme_color_override with the values in its parentheses. -
add_child(title)Adds the new node to the scene tree so that Godot can run and draw it. -
output = Label.new()Stores the new value in output. The expression creates a new Label object. -
output.custom_minimum_size.y = 151.0Stores the new value in output.custom_minimum_size.y. The expression reads 151.0. -
output.autowrap_mode = TextServer.AUTOWRAP_WORD_SMARTStores the new value in output.autowrap_mode. The expression reads TextServer.AUTOWRAP_WORD_SMART. -
output.add_theme_font_size_override("font_size", 19)Calls output.add_theme_font_size_override with the values in its parentheses. -
add_child(output)Adds the new node to the scene tree so that Godot can run and draw it. -
func say(message: String) -> void:Defines say, a reusable set of instructions. Parameters between the parentheses receive inputs. A return type after the arrow tells you which kind of result to expect. -
output.text = messageUpdates output.text, which controls the words a player sees. The expression reads message. -
func option(label: String, command: Callable) -> void:Defines option, a reusable set of instructions. Parameters between the parentheses receive inputs. A return type after the arrow tells you which kind of result to expect. -
var button := Button.new()Creates a variable named button. The expression creates a new Button object. Godot infers the type from the first value. -
button.text = labelUpdates button.text, which controls the words a player sees. The expression reads label. -
button.custom_minimum_size.y = 46.0Stores the new value in button.custom_minimum_size.y. The expression reads 46.0. -
button.add_theme_font_size_override("font_size", 19)Calls button.add_theme_font_size_override with the values in its parentheses. -
button.pressed.connect(command)Links a signal to the function that should run when the event happens. -
add_child(button)Adds the new node to the scene tree so that Godot can run and draw it.
Find and fix a bug
If £2.99 produces very small displayed receipts, confirm your price is 299 pence and that you convert to pounds for display once.
Try a change
Ages 10–12. Compare five imaginary downloads at £0 and £2.99. Ages 13–16. Add a pretend art cost and a break-even calculation using hypothetical proceeds.