From 829b383a2a0306cfc8ab38d5327be736501b14b9 Mon Sep 17 00:00:00 2001 From: Michael Campbell Date: Thu, 19 Mar 2026 01:59:17 -0400 Subject: [PATCH] decal for mortar --- player/player.gd | 5 +++++ player/player.tscn | 21 +++++++++++++++++++++ 2 files changed, 26 insertions(+) diff --git a/player/player.gd b/player/player.gd index 2679b93..8e7e249 100644 --- a/player/player.gd +++ b/player/player.gd @@ -13,6 +13,8 @@ const MOVE_SPEED := 7.5 const DASH_SPEED := 35. const DASH_COST := .5 +const MORTAR_IDX := 2 + static var instance: Player @export var shake_noise: FastNoiseLite @@ -143,6 +145,9 @@ func _process(delta: float) -> void: gun_index = 1 if Input.is_action_just_pressed("mortar"): gun_index = 2 + + %MortarDecal.visible = gun_index == MORTAR_IDX + %MortarDecal.global_position = %Reticle.global_position func damage(damager: Node3D) -> void: if health <= 0: return diff --git a/player/player.tscn b/player/player.tscn index 84c91ba..d7e6419 100644 --- a/player/player.tscn +++ b/player/player.tscn @@ -33,6 +33,17 @@ bg_color = Color(0.23, 0.23, 0.23, 0.34901962) [sub_resource type="StyleBoxFlat" id="StyleBoxFlat_hg6s5"] bg_color = Color(0.30492008, 0.84, 0.18480001, 1) +[sub_resource type="Gradient" id="Gradient_hg6s5"] +offsets = PackedFloat32Array(0.4537445, 0.53744495, 0.5947136, 0.6387665) +colors = PackedColorArray(1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0) + +[sub_resource type="GradientTexture2D" id="GradientTexture2D_8t03j"] +gradient = SubResource("Gradient_hg6s5") +width = 256 +height = 256 +fill = 1 +fill_from = Vector2(0.5, 0.5) + [node name="Player" type="CharacterBody3D" unique_id=1904432250 node_paths=PackedStringArray("guns")] collision_layer = 2 collision_mask = 13 @@ -140,6 +151,7 @@ fire_rate = 160.0 [node name="OnPlayerHUDSprite" type="Sprite3D" parent="." unique_id=1611457281] transform = Transform3D(2.5426614, 0, 0, 0, 1.4438343, 2.0929568, 0, -2.0929568, 1.4438343, 0, 3.1055684, 0.17435753) +layers = 2 texture = SubResource("ViewportTexture_g6k8r") [node name="OnPlayerHUD" type="SubViewport" parent="." unique_id=477940783] @@ -249,3 +261,12 @@ max_value = 1.0 value = 1.0 show_percentage = false script = ExtResource("9_hg6s5") + +[node name="MortarDecal" type="Decal" parent="." unique_id=1050350909] +unique_name_in_owner = true +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 24.471222, 0) +visible = false +size = Vector3(6.55249, 50.942444, 6.388672) +texture_albedo = SubResource("GradientTexture2D_8t03j") +modulate = Color(0.89, 0.40049997, 0.40049997, 1) +cull_mask = 1