Go to Project => Project Settings
Set window size to 288 x 512 (mobile dimensions)
Set Stretch mode to viewport
Add a new Action called flap
Assign the left mouse button
Or the Space Bar to the action
Set default texture to Nearest
Create a new script in the scripts folder
Add 3 signals for our global events for:
Register it as an Autoload:
Go to Project > Project Settings.
Click the Globals (or Autoload) tab.
Path: Select your signal_bus.gd file.
What is an Autoload / Singleton / Global?
An Autoload is a script or node that Godot loads automatically when the game starts, and—crucially—it never dies.
It is a globally accessible node that persists for the entire duration of the game. We use it for two main things:
Data Persistence: Saving information (like High Scores) that shouldn't disappear when the level restarts.
Global Communication: Allowing distant objects (like a Pipe and the UI) to talk without being directly connected."
Since this script is global
It can also handle the score and high score
Add a function to add a point
emit the score updates signal
Add a function to reset the score
Add a function to check the high score
If current score is bigger than high score
current score is the high score
Save the score to the file
Open it or set the score to 0