Video Game Design and Coding · PLECK lesson
PLECK lesson 140 · suggested week 28, day 5
Restore a version and bisect a regression manually
Objective. Use local checkpoints to locate when a defect appeared.
Godot Engine Standard desktop editor 4.7.2-stable, GDScript (Godot 4), Compatibility renderer. Headless Godot 4.7.2.stable.official.ed1daf0bf passed 106 assertions on the supplied scaffolds, including malformed JSON saves. Audio used the Dummy driver and a synthetic WAV, not a speaker. The visual editor, browser export, and signed-in submission were not tested. The desk still does not run a student's own upload.
About 55 minutes. The due date is chosen by a parent.
Pure functions, boundary cases, error reading and focused repair
Suggested pace: Recall and predict 5 min; Read instruction and scaffold 12 min; Build or design the assigned artifact 25 min; Run acceptance tests 8 min; Explain and checkpoint 5 min.
Materials: Godot Standard 4.7.2 desktop editor (GDScript, Compatibility renderer), Local course folder and prior checkpoint, No paid assets or public account required.
Comes after VGC-L139.
Version backups can be simple dated ZIP snapshots with short change notes. Create three small versions of a lab, deliberately break the third, then restore earlier versions into separate folders. Compare which version first fails the same reproduction. This is a manual form of narrowing the change interval. Never overwrite the only good copy. The course does not require a public repository, online account or command-line version-control tool. A backup must be restore-tested to be credible.
Worked example
A capacity function tested at below-minimum, middle and above-maximum inputs is easier to trust than one demonstrated only at a normal value. Scaffold C-TESTS — A tiny pure-function test harness Setup: Attach to Node TestLab. If using command line, create a separate SceneTree harness rather than running this Node script with --script. Run current TestLab scene in editor; assert reports a failed condition in Debugger. No external test framework or package is needed. ```gdscript extends Node func bounded_score(old_score: int, change: int) -> int: return clampi(old_score + change, 0, 999) func _ready() -> void: assert(bounded_score(10, 2) == 12) assert(bounded_score(0, -3) == 0) assert(bounded_score(998, 9) == 999) print("3 score checks passed") ```
A tiny pure-function test harness
GDScript (Godot 4, not Scratch, Python, JavaScript or C#). Scaffold C-TESTS. Copy starts from this text. The desk does not run it.
Scene and node setup
Attach to Node TestLab. If using command line, create a separate SceneTree harness rather than running this Node script with --script. Run current TestLab scene in editor; assert reports a failed condition in Debugger. No external test framework or package is needed.
extends Node
func bounded_score(old_score: int, change: int) -> int:
return clampi(old_score + change, 0, 999)
func _ready() -> void:
assert(bounded_score(10, 2) == 12)
assert(bounded_score(0, -3) == 0)
assert(bounded_score(998, 9) == 999)
print("3 score checks passed")
Checks to run in the editor
- All three assertions pass.
- Intentionally change expected 12 to 13 and observe a failure, then restore.
Native Godot 4.7.2.stable.official.ed1daf0bf headless compile and representative node-tree/runtime tests passed; see native-qa-results.json. Visual UI, audible output, exports and website submission still need separate checks.
Restore a version and bisect a regression manually — evidence task
- 1. Create three labeled lab snapshots with one change each.
- 2. Identify the first failing snapshot and the responsible change.
Deliverable. Version log, three checkpoint names and regression diagnosis.
Acceptance checks
- VGC-L140-T1. The same reproduction passes in one version and fails in the next.
- VGC-L140-T2. A restored known-good artifact remains available.
Understanding question. Why is a change note useful even with a backup filename?
Include a downloadable project ZIP with project.godot, .tscn, .gd and original asset files when code changes. A private, teacher-accessible download link to that ZIP is equivalent. Screenshots or a playthrough do not replace editable source.
If this is still shaky. Use C-TESTS and one ordinary plus two boundary cases. Keep a known-good snapshot before injecting faults. Start with the first assigned task and re-run its acceptance test before adding the remaining feature.
Optional extra. Add a property that should hold for many inputs and test a small finite range. Document one changed parameter, your prediction, and the observed effect; optional, not required for completion.
- Your first 2D game
Free public tutorial; no account; external asset download is optional, not used by this course.
· Opening this link does not submit the lesson.
Name ____________________ Date ____________________