forked from Puppet/berry-dash-godot-remake
Added the game scene
There are no berries yet and the bird floats if the screen size isnt 1920 by 1080 but I am still making good progress
This commit is contained in:
1 parent
9dc4bdfdb1
commit
3b0f47492d
11 files changed
+136
-2
No files matched your search
@@ -0,0 +1,23 @@
|
||||
using Godot;
|
||||
|
||||
public partial class SceneSwitcher : Button {
|
||||
[Export]
|
||||
public string ScenePath = ""; // Set this in the Inspector
|
||||
|
||||
public override void _Ready() {
|
||||
Pressed += OnButtonPressed;
|
||||
}
|
||||
|
||||
private void OnButtonPressed() {
|
||||
if (string.IsNullOrEmpty(ScenePath)) {
|
||||
GD.PrintErr("Scene path not set!");
|
||||
return;
|
||||
}
|
||||
|
||||
var error = GetTree().ChangeSceneToFile(ScenePath);
|
||||
|
||||
if (error != Error.Ok) {
|
||||
GD.PrintErr("Failed to change scene: " + error);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user