diff --git a/Game Scenes/Game.tscn b/Game Scenes/Game.tscn index 586fff5..91742e3 100644 --- a/Game Scenes/Game.tscn +++ b/Game Scenes/Game.tscn @@ -1,9 +1,10 @@ -[gd_scene load_steps=5 format=2] +[gd_scene load_steps=6 format=2] [ext_resource path="res://Objects/Rocket.tscn" type="PackedScene" id=1] [ext_resource path="res://Scripts/Rocket.gd" type="Script" id=2] [ext_resource path="res://Images and Anims/In Game/background.png" type="Texture" id=3] [ext_resource path="res://Scripts/AsteroidSpawn.gd" type="Script" id=4] +[ext_resource path="res://Scripts/Score.gd" type="Script" id=5] [node name="Game" type="Node2D"] script = ExtResource( 4 ) @@ -18,6 +19,16 @@ offset = Vector2( 0, -220 ) current = true smoothing_enabled = true +[node name="Label" type="Label" parent="Rocket"] +margin_left = 13.0 +margin_top = 9.0 +margin_right = 44.0 +margin_bottom = 27.0 +script = ExtResource( 5 ) +__meta__ = { +"_edit_use_anchors_": false +} + [node name="ParallaxBackground" type="ParallaxBackground" parent="."] [node name="ParallaxLayer" type="ParallaxLayer" parent="ParallaxBackground"] diff --git a/Scripts/Score.gd b/Scripts/Score.gd new file mode 100644 index 0000000..24b8e39 --- /dev/null +++ b/Scripts/Score.gd @@ -0,0 +1,5 @@ +extends Label + +func _process(delta): + var score = str(int(-get_parent().position.y/10)) + text = score