Skip to content

Commit dc2fd8e

Browse files
committed
Added Global Singleton (AutoLoad)
1 parent e007eff commit dc2fd8e

File tree

3 files changed

+24
-16
lines changed

3 files changed

+24
-16
lines changed
Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
[gd_scene load_steps=13 format=2]
22

3-
[ext_resource path="res://battle_system/units/Enemy.tscn" type="PackedScene" id=1]
4-
[ext_resource path="res://battle_system/units/Alice.tscn" type="PackedScene" id=2]
5-
[ext_resource path="res://battle_system/interfaces/commands/fight.svg" type="Texture" id=3]
3+
[ext_resource path="res://battle_system/units/Alice.tscn" type="PackedScene" id=1]
4+
[ext_resource path="res://battle_system/units/Enemy.tscn" type="PackedScene" id=2]
5+
[ext_resource path="res://battle_system/background.svg" type="Texture" id=3]
66
[ext_resource path="res://battle_system/interfaces/commands/flee.svg" type="Texture" id=4]
7-
[ext_resource path="res://battle_system/combat_system.gd" type="Script" id=5]
8-
[ext_resource path="res://theme/fonts/noto_sans_ui/NotoSansUI-Regular.ttf" type="DynamicFontData" id=6]
9-
[ext_resource path="res://battle_system/interfaces/commands/cmd_btn.gd" type="Script" id=7]
10-
[ext_resource path="res://battle_system/background.svg" type="Texture" id=8]
7+
[ext_resource path="res://battle_system/interfaces/commands/fight.svg" type="Texture" id=5]
8+
[ext_resource path="res://battle_system/interfaces/commands/cmd_btn.gd" type="Script" id=6]
9+
[ext_resource path="res://battle_system/combat_system.gd" type="Script" id=7]
10+
[ext_resource path="res://theme/fonts/noto_sans_ui/NotoSansUI-Regular.ttf" type="DynamicFontData" id=8]
1111

1212
[sub_resource type="StyleBoxEmpty" id=1]
1313

@@ -22,25 +22,25 @@ size = 72
2222
outline_size = 3
2323
outline_color = Color( 0.32549, 0.32549, 0.32549, 1 )
2424
extra_spacing_char = 2
25-
font_data = ExtResource( 6 )
25+
font_data = ExtResource( 8 )
2626

27-
[node name="Combat" type="Node"]
28-
script = ExtResource( 5 )
27+
[node name="BattleScene" type="Node"]
28+
script = ExtResource( 7 )
2929

3030
[node name="Background" type="Sprite" parent="."]
31-
texture = ExtResource( 8 )
31+
texture = ExtResource( 3 )
3232
centered = false
3333

3434
[node name="Units" type="Node2D" parent="."]
3535

3636
[node name="Allies" type="Node2D" parent="Units"]
3737

38-
[node name="Alice" parent="Units/Allies" instance=ExtResource( 2 )]
38+
[node name="Alice" parent="Units/Allies" instance=ExtResource( 1 )]
3939
position = Vector2( 725, 296 )
4040

4141
[node name="Enemies" type="Node2D" parent="Units"]
4242

43-
[node name="Enemy" parent="Units/Enemies" instance=ExtResource( 1 )]
43+
[node name="Enemy" parent="Units/Enemies" instance=ExtResource( 2 )]
4444
position = Vector2( 302, 302 )
4545
max_hp = 10
4646
speed = 5
@@ -82,7 +82,7 @@ margin_bottom = 92.0
8282
[node name="Button" type="Button" parent="Control/MarginContainer/Commands/Fight"]
8383
margin_right = 74.0
8484
margin_bottom = 92.0
85-
script = ExtResource( 7 )
85+
script = ExtResource( 6 )
8686

8787
[node name="MarginContainer" type="MarginContainer" parent="Control/MarginContainer/Commands/Fight"]
8888
margin_right = 74.0
@@ -107,7 +107,7 @@ __meta__ = {
107107
margin_right = 64.0
108108
margin_bottom = 64.0
109109
mouse_filter = 2
110-
texture = ExtResource( 3 )
110+
texture = ExtResource( 5 )
111111

112112
[node name="Label" type="Label" parent="Control/MarginContainer/Commands/Fight/MarginContainer/VBoxContainer"]
113113
margin_top = 68.0

battle_system/global.gd

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
extends Node
2+
3+
func _ready():
4+
pass

project.godot

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,13 @@ config_version=4
1111
[application]
1212

1313
config/name="JRPG Fragment - Turn-Based Combat"
14-
run/main_scene="res://battle_system/Combat.tscn"
14+
run/main_scene="res://battle_system/BattleScene.tscn"
1515
config/icon="res://icon.png"
1616

17+
[autoload]
18+
19+
GlobalBattleSystem="*res://battle_system/global.gd"
20+
1721
[rendering]
1822

1923
environment/default_environment="res://default_env.tres"

0 commit comments

Comments
 (0)