decal for mortar
This commit is contained in:
parent
ae7d507a4c
commit
829b383a2a
2 changed files with 26 additions and 0 deletions
|
|
@ -13,6 +13,8 @@ const MOVE_SPEED := 7.5
|
||||||
const DASH_SPEED := 35.
|
const DASH_SPEED := 35.
|
||||||
const DASH_COST := .5
|
const DASH_COST := .5
|
||||||
|
|
||||||
|
const MORTAR_IDX := 2
|
||||||
|
|
||||||
static var instance: Player
|
static var instance: Player
|
||||||
|
|
||||||
@export var shake_noise: FastNoiseLite
|
@export var shake_noise: FastNoiseLite
|
||||||
|
|
@ -143,6 +145,9 @@ func _process(delta: float) -> void:
|
||||||
gun_index = 1
|
gun_index = 1
|
||||||
if Input.is_action_just_pressed("mortar"):
|
if Input.is_action_just_pressed("mortar"):
|
||||||
gun_index = 2
|
gun_index = 2
|
||||||
|
|
||||||
|
%MortarDecal.visible = gun_index == MORTAR_IDX
|
||||||
|
%MortarDecal.global_position = %Reticle.global_position
|
||||||
|
|
||||||
func damage(damager: Node3D) -> void:
|
func damage(damager: Node3D) -> void:
|
||||||
if health <= 0: return
|
if health <= 0: return
|
||||||
|
|
|
||||||
|
|
@ -33,6 +33,17 @@ bg_color = Color(0.23, 0.23, 0.23, 0.34901962)
|
||||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_hg6s5"]
|
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_hg6s5"]
|
||||||
bg_color = Color(0.30492008, 0.84, 0.18480001, 1)
|
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")]
|
[node name="Player" type="CharacterBody3D" unique_id=1904432250 node_paths=PackedStringArray("guns")]
|
||||||
collision_layer = 2
|
collision_layer = 2
|
||||||
collision_mask = 13
|
collision_mask = 13
|
||||||
|
|
@ -140,6 +151,7 @@ fire_rate = 160.0
|
||||||
|
|
||||||
[node name="OnPlayerHUDSprite" type="Sprite3D" parent="." unique_id=1611457281]
|
[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)
|
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")
|
texture = SubResource("ViewportTexture_g6k8r")
|
||||||
|
|
||||||
[node name="OnPlayerHUD" type="SubViewport" parent="." unique_id=477940783]
|
[node name="OnPlayerHUD" type="SubViewport" parent="." unique_id=477940783]
|
||||||
|
|
@ -249,3 +261,12 @@ max_value = 1.0
|
||||||
value = 1.0
|
value = 1.0
|
||||||
show_percentage = false
|
show_percentage = false
|
||||||
script = ExtResource("9_hg6s5")
|
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
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue