From 7cca37a881295fe1e11ce48d5c5e0ab102d86815 Mon Sep 17 00:00:00 2001 From: Henry Date: Fri, 3 Apr 2026 14:28:00 +0100 Subject: [PATCH 1/3] Adjusted sprite frames for better movement clarity --- graphics/ship.png | Bin 1734 -> 760 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/graphics/ship.png b/graphics/ship.png index effbe4e74589d94ba06ee2384df06fe866619613..a260f6c3433ad399116828f327fa5cd974bd6621 100644 GIT binary patch delta 747 zcmX@c`-63YWIZzj14G_k?_)#`kET&`54$) zr)H};%Q?6(q=vjvx1Zu^wJ6vAUaZv`4fk2TWxw(&)mnX`wgx3FDSz2&{&|J*xk(=> zL4Y;kh@s3f^G7Y*C)Gad{rX@3;Mv0ZyIi+aeP{1!>|YoqedvD2+fwO|hJV+aFkZf# zQ`0`ro9%`(55xI$)4P;af7F(F#j7-It+t=%2D9Thwjr~JigLC~+}o9vt36|A(BvAwb=Oh!>9?o10K z*U}{%H)M?zmMv6tG5yZrQhvE&?@6VGjAg5Am#j)#TTyx^?by2*quKE)hMP0)EZ^OJ zP*ykUy8WFL;jLyNW;;C;mS|n`F7dfBg>xOB4}Yh8{SOa;hfLe!tYnJw6!JBnAHG=^ z;!?lO`P9!h?Kd@QW!6=GKhowCe(POL{MB>QCOC2=Eid_CIlqsSL($w*b=Nva2Gd}N zL#yOmBaFNC+tB`p5t&+y}N#ECJ zaVuVm6?-QXU6A6i=Z~LL{&~&EDuUOq?e8um|x)@kxA87mADCkRi>`2QXPy^kwCN zIGecPk}^SsCT+GMC6XHH66q$ez!*AcwZoUQhxQy#@4clh#eZMYr1$*!ec$&x-}%nz zEs!8|1*Jsk`+9)#tvBy_*x8Wiz?t9zLIDQ}1sr51xUg0qVaPI+e0R@bZbC)2?Y@+9 zAfbSR@VvBbJ%2^w#i6zmwGnrVJsB|*O03S!hdMW(8KHftK#6zCwIyYa|UZgi7V^1mS z4P_~bRBtFF8GA}WO9KyeZaxaCO>y~G6^I&8QoE%7+J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KyK6DDJ?R=2# zi)sVFY_0|L-wWy=0Q~u;B+6$Bnn_Z~8eh--LHJC{$={0?(~mF{T)@9CW&{Ap&dDQr z>MfvsGzfm~YM7g7BRU^f_e8Z#4mUyC27uXI3$k8O Xd@iAh*QQ;600000NkvXXu0mjf4#+xu From 8196e664cd19a3f2886d2b47c61702ae81763f45 Mon Sep 17 00:00:00 2001 From: Henry Date: Fri, 3 Apr 2026 14:29:39 +0100 Subject: [PATCH 2/3] Added 2 new hitboxes for muzzle damage and powerup grab radius; reduced player damage hitbox substantially --- scenes/player.tscn | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/scenes/player.tscn b/scenes/player.tscn index 177e4e7..7233823 100644 --- a/scenes/player.tscn +++ b/scenes/player.tscn @@ -76,8 +76,14 @@ animations = [{ "speed": 15.0 }] +[sub_resource type="RectangleShape2D" id="RectangleShape2D_qlg0r"] +size = Vector2(24, 10) + +[sub_resource type="RectangleShape2D" id="RectangleShape2D_tuyoq"] +size = Vector2(24, 30) + [sub_resource type="RectangleShape2D" id="RectangleShape2D_dqkch"] -size = Vector2(10, 11) +size = Vector2(6, 5.75) [node name="Player" type="Area2D" unique_id=652131079] script = ExtResource("1_g2els") @@ -103,9 +109,22 @@ sprite_frames = SubResource("SpriteFrames_3v2ag") animation = &"stock" autoplay = "stock" -[node name="CollisionShape2D" type="CollisionShape2D" parent="." unique_id=485826453] -position = Vector2(0, -3.5) +[node name="MuzzleBox" type="CollisionShape2D" parent="." unique_id=1042837273] +unique_name_in_owner = true +position = Vector2(0, -17) +shape = SubResource("RectangleShape2D_qlg0r") +disabled = true +debug_color = Color(1, 0.5058824, 0.21960784, 0.41960785) + +[node name="HelpBox" type="CollisionShape2D" parent="." unique_id=938667427] +position = Vector2(0, 3) +shape = SubResource("RectangleShape2D_tuyoq") +debug_color = Color(0, 1, 0, 0.41960785) + +[node name="HitBox" type="CollisionShape2D" parent="." unique_id=485826453] +position = Vector2(0, 2) shape = SubResource("RectangleShape2D_dqkch") +debug_color = Color(0.9843137, 0, 0, 0.80784315) [node name="WeaponCooldown" type="Timer" parent="." unique_id=269678170] From 6431259f7f8b1498208a9ed66371b2a0ea8b811b Mon Sep 17 00:00:00 2001 From: Henry Date: Fri, 3 Apr 2026 14:31:03 +0100 Subject: [PATCH 3/3] Modified ship thruster spacing when player banks left and right; added logic to enable/disable muzzle damage hitbox upon firing. --- scripts/player.gd | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/scripts/player.gd b/scripts/player.gd index 669b58e..9d12920 100644 --- a/scripts/player.gd +++ b/scripts/player.gd @@ -22,6 +22,7 @@ var weapon_timer: float = 0.0 var weapon_spacing: float = 0.1 @onready var screensize = get_viewport_rect().size +@onready var muzzle_damage = %MuzzleBox func _process(delta): var input = Input.get_vector("left", "right", "up","down") @@ -31,24 +32,32 @@ func _process(delta): # Sprite feedback based one player input if input.x > 0: + %Ship/Thrusters.position.x = $Ship.position.x+1 %Ship.frame = 2 %Ship/Thrusters.flip_h = true %Ship/Thrusters.animation = "banked" elif input.x < 0: + %Ship/Thrusters.position.x = $Ship.position.x-1 %Ship.frame = 1 %Ship/Thrusters.flip_h = false %Ship/Thrusters.animation = "banked" else: %Ship.frame = 0 + %Ship/Thrusters.position.x = $Ship.position.x %Ship/Thrusters.flip_h = false %Ship/Thrusters.animation = "fwd" + # Get previous positon for equidistant bullet calculation previous_position = position + + # Move the ship based on input within the screen bounds position += input * speed * delta position = position.clamp(Vector2(12,12), screensize - Vector2(12,12)) + # Enable muzzle damage hitbox upon firing if Input.is_action_pressed("shoot"): is_shooting = true + muzzle_damage.set("disabled", false) else: is_shooting = false @@ -58,12 +67,14 @@ func _process(delta): %MuzzleFlash.show() %Ship/MuzzleFlash.animation = "stock" + # Adjust bullet spacing before firing if travel > weapon_spacing: shoot() travel -= weapon_spacing if is_shooting == false: %MuzzleFlash.hide() + muzzle_damage.set("disabled", true) func shield_set(_value: int): return @@ -80,9 +91,13 @@ func shoot(): var bullet = weapon_current.instantiate() get_tree().root.add_child(bullet) bullet.position = position + Vector2(0,-23) + + # Get weapon speed and spacing for equidistant calculations weapon_rate = bullet.shot_data.rate weapon_spacing = bullet.shot_data.spacing bullet_speed = abs(bullet.shot_data.speed) - prints(bullet.shot_data.shot_name, "weapon fired") #Print which weapon is firing + + # Print which weapon is firing + prints(bullet.shot_data.shot_name, "weapon fired")