Asteroids label

pull/11/head
Sascha 2023-10-13 17:43:49 +07:00
parent 37e0ad04c5
commit 817d81706f
6 changed files with 17 additions and 9 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

@ -2,16 +2,16 @@
importer="texture"
type="CompressedTexture2D"
uid="uid://6xxwqnfenpax"
path="res://.godot/imported/icon.svg-b7ee14c4fc7622c16acfaa49648fa144.ctex"
uid="uid://bjl6aqcfrfys6"
path="res://.godot/imported/GodotSplashScreen.png-79d6465208962f79bad2642e138cd06a.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://Images/icon.svg"
dest_files=["res://.godot/imported/icon.svg-b7ee14c4fc7622c16acfaa49648fa144.ctex"]
source_file="res://Images/GodotSplashScreen.png"
dest_files=["res://.godot/imported/GodotSplashScreen.png-79d6465208962f79bad2642e138cd06a.ctex"]
[params]
@ -32,6 +32,3 @@ process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1
svg/scale=1.0
editor/scale_with_editor_scale=false
editor/convert_colors_with_editor_theme=false

@ -1 +0,0 @@
<svg height="128" width="128" xmlns="http://www.w3.org/2000/svg"><rect x="2" y="2" width="124" height="124" rx="14" fill="#363d52" stroke="#212532" stroke-width="4"/><g transform="scale(.101) translate(122 122)"><g fill="#fff"><path d="M105 673v33q407 354 814 0v-33z"/><path fill="#478cbf" d="m105 673 152 14q12 1 15 14l4 67 132 10 8-61q2-11 15-15h162q13 4 15 15l8 61 132-10 4-67q3-13 15-14l152-14V427q30-39 56-81-35-59-83-108-43 20-82 47-40-37-88-64 7-51 8-102-59-28-123-42-26 43-46 89-49-7-98 0-20-46-46-89-64 14-123 42 1 51 8 102-48 27-88 64-39-27-82-47-48 49-83 108 26 42 56 81zm0 33v39c0 276 813 276 813 0v-39l-134 12-5 69q-2 10-14 13l-162 11q-12 0-16-11l-10-65H447l-10 65q-4 11-16 11l-162-11q-12-3-14-13l-5-69z"/><path d="M483 600c3 34 55 34 58 0v-86c-3-34-55-34-58 0z"/><circle cx="725" cy="526" r="90"/><circle cx="299" cy="526" r="90"/></g><g fill="#414042"><circle cx="307" cy="532" r="60"/><circle cx="717" cy="532" r="60"/></g></g></svg>

Before

Width:  |  Height:  |  Size: 950 B

@ -33,11 +33,19 @@ region_enabled = true
region_rect = Rect2(0, 0, 810, 1380)
script = ExtResource("3_imgbw")
[node name="Asteroids" type="Node3D" parent="."]
[node name="Asteroids" type="Node3D" parent="." node_paths=PackedStringArray("labelAsteroids")]
script = ExtResource("4_pf4xb")
asteroids = [ExtResource("5_do6ba"), ExtResource("6_tqoe7"), ExtResource("7_v6ul2")]
labelAsteroids = NodePath("../LabelAsteroids")
[node name="BackgroundMusic" type="AudioStreamPlayer" parent="."]
stream = ExtResource("8_4ms0p")
volume_db = -20.0
autoplay = true
[node name="LabelAsteroids" type="RichTextLabel" parent="."]
offset_left = 20.0
offset_top = 20.0
offset_right = 260.0
offset_bottom = 40.0
text = "Asteroids: 0"

@ -5,6 +5,8 @@ using Godot.Collections;
public partial class Asteroids : Node3D {
[Export] private Array<PackedScene> asteroids;
[Export] private float spawnRate = 1f;
[Export] private RichTextLabel labelAsteroids;
private float spawnTimer;
private int asteroidNumber;
public override void _Ready() => spawnTimer = spawnRate;
@ -18,6 +20,7 @@ public partial class Asteroids : Node3D {
asteroid.Name = $"Asteroid{asteroidNumber}";
AddChild(asteroid);
spawnTimer = spawnRate;
labelAsteroids.Text = $"Asteroids: {asteroidNumber}";
}
}
}

@ -14,6 +14,7 @@ config/name="Space Shooter"
config/version="0.1"
run/main_scene="res://Scenes/SpaceShooter.tscn"
config/features=PackedStringArray("4.2", "C#", "Forward Plus")
boot_splash/image="res://Images/GodotSplashScreen.png"
config/icon="res://Images/Space-Shooter.png"
[display]