tangled
alpha
login
or
join now
cass.cityboundforest.com
/
pathdelver
0
fork
atom
A dungeon delver roguelike using Pathfinder 2nd edition rules
0
fork
atom
overview
issues
pulls
pipelines
Setting up start screen
cass.cityboundforest.com
6 months ago
79de379d
46fe0a22
+68
-12
5 changed files
expand all
collapse all
unified
split
data.go
graphics
main.tscn
project.godot
start.tscn
main.go
+21
-5
data.go
···
3
3
import (
4
4
"fmt"
5
5
6
6
-
"graphics.gd/classdb/Node"
6
6
+
"graphics.gd/classdb/Control"
7
7
+
"graphics.gd/classdb/Label"
8
8
+
"graphics.gd/classdb/Button"
9
9
+
"graphics.gd/classdb/SceneTree"
7
10
)
8
11
9
9
-
type Dungeoner struct {
10
10
-
Node.Extension[Dungeoner]
12
12
+
type DungeonerStart struct {
13
13
+
Control.Extension[DungeonerStart]
14
14
+
15
15
+
Title Label.Instance
16
16
+
NewGame Button.Instance
17
17
+
Quit Button.Instance
11
18
}
12
19
13
13
-
func (p *Dungeoner) Ready() {
14
14
-
fmt.Println("Hello world from Go!")
20
20
+
func (ds *DungeonerStart) Ready() {
21
21
+
ds.NewGame.AsBaseButton().OnPressed(ds.OnNewGamePressed)
22
22
+
ds.Quit.AsBaseButton().OnPressed(ds.OnQuitPressed)
23
23
+
}
24
24
+
25
25
+
func (ds *DungeonerStart) OnNewGamePressed() {
26
26
+
fmt.Println("new game")
27
27
+
}
28
28
+
29
29
+
func (ds *DungeonerStart) OnQuitPressed() {
30
30
+
SceneTree.Get(ds.AsNode()).Quit()
15
31
}
-5
graphics/main.tscn
···
1
1
-
[gd_scene format=3 uid="uid://bmhmiv43fqo4c"]
2
2
-
3
3
-
[node name="Node" type="Node"]
4
4
-
5
5
-
[node name="Dungeoner" type="Dungeoner" parent="."]
+1
-1
graphics/project.godot
···
11
11
[application]
12
12
13
13
config/name="dungeoner"
14
14
-
run/main_scene="res://main.tscn"
14
14
+
run/main_scene="res://start.tscn"
15
15
run/main_loop_type="GoMainLoop"
16
16
config/features=PackedStringArray("4.4")
17
17
+45
graphics/start.tscn
···
1
1
+
[gd_scene format=3 uid="uid://bmhmiv43fqo4c"]
2
2
+
3
3
+
[node name="Node" type="Node"]
4
4
+
5
5
+
[node name="DungeonerStart" type="DungeonerStart" parent="."]
6
6
+
anchors_preset = 15
7
7
+
anchor_right = 1.0
8
8
+
anchor_bottom = 1.0
9
9
+
grow_horizontal = 2
10
10
+
grow_vertical = 2
11
11
+
size_flags_horizontal = 3
12
12
+
size_flags_vertical = 3
13
13
+
14
14
+
[node name="Title" type="Label" parent="DungeonerStart"]
15
15
+
layout_mode = 1
16
16
+
anchors_preset = -1
17
17
+
anchor_top = 0.366
18
18
+
anchor_right = 1.0
19
19
+
anchor_bottom = 0.401
20
20
+
offset_bottom = -236.848
21
21
+
grow_horizontal = 2
22
22
+
text = "Dungeoner"
23
23
+
horizontal_alignment = 1
24
24
+
25
25
+
[node name="NewGame" type="Button" parent="DungeonerStart"]
26
26
+
layout_mode = 1
27
27
+
anchors_preset = -1
28
28
+
anchor_left = 0.232
29
29
+
anchor_top = 0.426
30
30
+
anchor_right = 0.768
31
31
+
anchor_bottom = 0.474
32
32
+
grow_horizontal = 2
33
33
+
text = "New Game
34
34
+
"
35
35
+
36
36
+
[node name="Quit" type="Button" parent="DungeonerStart"]
37
37
+
layout_mode = 1
38
38
+
anchors_preset = -1
39
39
+
anchor_left = 0.232
40
40
+
anchor_top = 0.499
41
41
+
anchor_right = 0.768
42
42
+
anchor_bottom = 0.547
43
43
+
offset_bottom = -0.104004
44
44
+
grow_horizontal = 2
45
45
+
text = "Quit"
+1
-1
main.go
···
6
6
)
7
7
8
8
func main() {
9
9
-
classdb.Register[Dungeoner]()
9
9
+
classdb.Register[DungeonerStart]()
10
10
startup.Scene()
11
11
}