1
Fork 0
mirror of https://github.com/Steffo99/hella-farm.git synced 2024-11-22 08:04:23 +00:00

Add a warning if MainGame.get_ancestor fails

This commit is contained in:
Steffo 2024-04-14 04:22:37 +02:00
parent 78ff2a09e3
commit 053e4831fe
Signed by: steffo
GPG key ID: 5ADA3868646C3FC0
2 changed files with 8 additions and 3 deletions

View file

@ -9,6 +9,7 @@ static func get_ancestor(start: Node) -> MainGame:
if current is MainGame:
return current
current = current.get_parent()
Log.w(self, "MainGame ancestor not found.")
return null

View file

@ -1,8 +1,9 @@
[gd_scene load_steps=6 format=3 uid="uid://cxj5aud02f40j"]
[gd_scene load_steps=7 format=3 uid="uid://cxj5aud02f40j"]
[ext_resource type="Script" path="res://scenes/game/menu_game.gd" id="1_y3554"]
[ext_resource type="Script" path="res://scenes/game/main_game.gd" id="1_wiglu"]
[ext_resource type="PackedScene" uid="uid://dm068vaseh45n" path="res://scenes/game/game_camera.tscn" id="2_db5xs"]
[ext_resource type="PackedScene" uid="uid://brvbtvt4em32" path="res://behaviours/counter.tscn" id="3_p6jw3"]
[ext_resource type="PackedScene" uid="uid://uoxwjpmgg27a" path="res://entities/gold.tscn" id="4_eu7q4"]
[sub_resource type="TileSet" id="TileSet_g2dkm"]
@ -10,7 +11,7 @@
size = Vector2(1280, 720)
[node name="MainGame" type="Node2D"]
script = ExtResource("1_y3554")
script = ExtResource("1_wiglu")
[node name="TileMap" type="TileMap" parent="."]
tile_set = SubResource("TileSet_g2dkm")
@ -25,3 +26,6 @@ debug_color = Color(1, 1, 1, 0)
[node name="GameCamera" parent="." instance=ExtResource("2_db5xs")]
[node name="GoldCounter" parent="." instance=ExtResource("3_p6jw3")]
[node name="Gold" parent="." instance=ExtResource("4_eu7q4")]
position = Vector2(94, 70)