it works
This commit is contained in:
6
globals/GameManager.tscn
Normal file
6
globals/GameManager.tscn
Normal file
@@ -0,0 +1,6 @@
|
||||
[gd_scene load_steps=2 format=3 uid="uid://dw81sskevybfe"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://bevcjiuvoyb6u" path="res://globals/game_manager.gd" id="1_f5sja"]
|
||||
|
||||
[node name="GameManager" type="Node"]
|
||||
script = ExtResource("1_f5sja")
|
||||
6
globals/GameManager.tscn2479597169.tmp
Normal file
6
globals/GameManager.tscn2479597169.tmp
Normal file
@@ -0,0 +1,6 @@
|
||||
[gd_scene load_steps=2 format=3 uid="uid://dw81sskevybfe"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://bevcjiuvoyb6u" path="res://globals/game_manager.gd" id="1_f5sja"]
|
||||
|
||||
[node name="GameManager" type="Node"]
|
||||
script = ExtResource("1_f5sja")
|
||||
14
globals/game_manager.gd
Normal file
14
globals/game_manager.gd
Normal file
@@ -0,0 +1,14 @@
|
||||
extends Node
|
||||
|
||||
var score: int = 0
|
||||
var sl = null
|
||||
|
||||
func set_label(label:Label):
|
||||
score = 0
|
||||
sl = label
|
||||
|
||||
func add_point():
|
||||
score+=1
|
||||
sl.text ="You got " + str(score) + " coins"
|
||||
print(score)
|
||||
|
||||
1
globals/game_manager.gd.uid
Normal file
1
globals/game_manager.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://bevcjiuvoyb6u
|
||||
Reference in New Issue
Block a user