fuzzyworld

godot-shooter / commit

Slowed things down, removed the debug label from the HUD, changed the background to a nice blue.

748f09d4bbc5ed11419694ceaf3e9fc440405bf6 · Pavel Safronov · 2023-11-02 10:25:31 -0700 · parents 279c7477cf49

Slowed things down, removed the debug label from the HUD, changed the background to a nice blue.
 Enemy.gd       |  2 +-
 HUD.gd         |  2 --
 HUD.tscn       | 16 +++-------------
 Player.gd      |  2 +-
 StarField.tscn | 28 +++++++++++-----------------
 World.gd       |  1 -
 World.tscn     | 13 ++++++++-----
 project.godot  |  2 +-
 8 files changed, 25 insertions(+), 41 deletions(-)

diff --git a/Enemy.gd b/Enemy.gd
index 8626ba4..17be7ba 100644
--- a/Enemy.gd
+++ b/Enemy.gd
@@ -5,7 +5,7 @@ onready var ray_cast_2d: RayCast2D = $RayCast2D
 const Utils = preload("res://Utils.gd")
 const Explosion = preload("res://Explosion.tscn")
 
-export var move_speed = 100
+export var move_speed = 25
 export var health = -1
 export var max_health = 10
 signal enemy_killed
diff --git a/HUD.gd b/HUD.gd
index 6522f9b..02cee1f 100644
--- a/HUD.gd
+++ b/HUD.gd
@@ -1,11 +1,9 @@
 extends Control
 
 export var score = 0
-export var debug_text = ""
 
 func _ready() -> void:
 	$AnimationPlayer.play("instructions fade")
 
 func _process(_delta: float) -> void:
 	$VBoxContainer/HBoxContainer/Score.text = "%s" % score
-	$VBoxContainer/HBoxContainer2/DebugText.text = debug_text
diff --git a/HUD.tscn b/HUD.tscn
index e9f9be6..c95ba79 100644
--- a/HUD.tscn
+++ b/HUD.tscn
@@ -57,19 +57,9 @@ script = ExtResource( 2 )
 margin_right = 40.0
 margin_bottom = 40.0
 
-[node name="HBoxContainer2" type="HBoxContainer" parent="VBoxContainer"]
-margin_right = 617.0
-margin_bottom = 74.0
-
-[node name="DebugText" type="Label" parent="VBoxContainer/HBoxContainer2"]
-margin_right = 190.0
-margin_bottom = 74.0
-text = "DEBUG"
-
 [node name="HBoxContainer" type="HBoxContainer" parent="VBoxContainer"]
-margin_top = 78.0
 margin_right = 617.0
-margin_bottom = 152.0
+margin_bottom = 74.0
 
 [node name="ScoreText" type="Label" parent="VBoxContainer/HBoxContainer"]
 margin_right = 192.0
@@ -84,9 +74,9 @@ text = "100"
 uppercase = true
 
 [node name="CenterContainer" type="CenterContainer" parent="VBoxContainer"]
-margin_top = 156.0
+margin_top = 78.0
 margin_right = 617.0
-margin_bottom = 230.0
+margin_bottom = 152.0
 theme = ExtResource( 1 )
 
 [node name="Label" type="Label" parent="VBoxContainer/CenterContainer"]
diff --git a/Player.gd b/Player.gd
index 9d5924f..a36d6c6 100644
--- a/Player.gd
+++ b/Player.gd
@@ -1,7 +1,7 @@
 extends KinematicBody2D
 class_name Player
 
-export var move_speed = 200
+export var move_speed = 35
 export var health = 10
 export var max_health = 10
 export var shot_period_seconds = .1
diff --git a/StarField.tscn b/StarField.tscn
index 506b4cd..bcdd2f0 100644
--- a/StarField.tscn
+++ b/StarField.tscn
@@ -2,15 +2,10 @@
 
 [ext_resource path="res://assets/kenney_simple-space/PNG/Default/star_small.png" type="Texture" id=1]
 
-[sub_resource type="Gradient" id=6]
-colors = PoolColorArray( 1, 0, 0, 1, 0.078125, 0, 1, 1 )
-
-[sub_resource type="GradientTexture2D" id=7]
-gradient = SubResource( 6 )
-width = 1024
-height = 600
-use_hdr = true
-fill_from = Vector2( 0.00416667, 0.00625 )
+[sub_resource type="Gradient" id=5]
+
+[sub_resource type="GradientTexture2D" id=6]
+gradient = SubResource( 5 )
 fill_to = Vector2( 1, 1 )
 
 [sub_resource type="Curve" id=1]
@@ -22,21 +17,20 @@ _data = [ Vector2( 0, 0 ), 0.0, 0.0, 0, 0, Vector2( 0.256659, 1 ), 0.0, 0.0, 0,
 
 [node name="Polygon2D" type="Polygon2D" parent="."]
 visible = false
-position = Vector2( 512, 300 )
 antialiased = true
-texture = SubResource( 7 )
+texture = SubResource( 6 )
 invert_enable = true
-invert_border = 10.0
-polygon = PoolVector2Array( -512, -300, 512, -300, 512, 300, -512, 300 )
+invert_border = 5.0
+polygon = PoolVector2Array( 0, 0, 2048, 0, 2048, 1200, 0, 1200 )
 
 [node name="StarField" type="CPUParticles2D" parent="."]
-position = Vector2( 512, 300 )
-amount = 100
+position = Vector2( 2048, 1200 )
+amount = 200
 lifetime = 10.0
-preprocess = 70.74
+preprocess = 191.72
 texture = ExtResource( 1 )
 emission_shape = 2
-emission_rect_extents = Vector2( 512, 300 )
+emission_rect_extents = Vector2( 2048, 1200 )
 gravity = Vector2( 0, 0 )
 angular_velocity = 50.0
 angular_velocity_random = 1.0
diff --git a/World.gd b/World.gd
index 76b5b25..2d09317 100644
--- a/World.gd
+++ b/World.gd
@@ -48,7 +48,6 @@ func _process(_delta: float) -> void:
 		$Player.velocity = Vector2.ZERO
 
 func set_destination(pos: Vector2) -> void:
-	$CanvasLayer/HUD.debug_text = "%.1f,%.1f" % [pos.x, pos.y]
 	destination = pos
 	is_destination_set = true
 	$Destination.position = pos
diff --git a/World.tscn b/World.tscn
index 4a2ef80..fb4b161 100644
--- a/World.tscn
+++ b/World.tscn
@@ -11,28 +11,31 @@ radius = 29.0172
 
 [node name="World" type="Node2D"]
 script = ExtResource( 4 )
-enemy_count = 10
+enemy_count = 3
 
 [node name="CanvasLayer2" type="CanvasLayer" parent="."]
+visible = false
 
 [node name="ParallaxBackground" type="ParallaxBackground" parent="CanvasLayer2"]
+visible = false
+scroll_ignore_camera_zoom = true
 
 [node name="Foreground" type="ParallaxLayer" parent="CanvasLayer2/ParallaxBackground"]
-motion_offset = Vector2( -512, -300 )
-motion_mirroring = Vector2( 1024, 600 )
+motion_mirroring = Vector2( 2048, 1200 )
 
 [node name="StarField" parent="CanvasLayer2/ParallaxBackground/Foreground" instance=ExtResource( 5 )]
 
 [node name="Background" type="ParallaxLayer" parent="CanvasLayer2/ParallaxBackground"]
+visible = false
 modulate = Color( 1, 1, 1, 0.501961 )
 motion_scale = Vector2( 0.8, 0.8 )
-motion_offset = Vector2( -512, -300 )
-motion_mirroring = Vector2( 1024, 600 )
+motion_mirroring = Vector2( 2048, 1200 )
 __meta__ = {
 "_edit_group_": true
 }
 
 [node name="StarField2" parent="CanvasLayer2/ParallaxBackground/Background" instance=ExtResource( 5 )]
+visible = false
 
 [node name="Environment" type="Node2D" parent="."]
 
diff --git a/project.godot b/project.godot
index 55ff5e5..8d6f1d0 100644
--- a/project.godot
+++ b/project.godot
@@ -65,5 +65,5 @@ common/enable_pause_aware_picking=true
 [rendering]
 
 vram_compression/import_etc=true
-environment/default_clear_color=Color( 0, 0, 0, 1 )
+environment/default_clear_color=Color( 0.431373, 0.572549, 1, 1 )
 environment/default_environment="res://default_env.tres"