number keys for weapons; charger enemy is invulnerable
This commit is contained in:
parent
1d1d201520
commit
ae7d507a4c
5 changed files with 27 additions and 9 deletions
|
|
@ -23,6 +23,7 @@ func _start_charge() -> void:
|
|||
enemy.velocity = global_position.direction_to(Player.instance.global_position)
|
||||
enemy.velocity *= CHARGE_SPEED
|
||||
enemy.set_rotation_to_velocity()
|
||||
enemy.invulnerable = true
|
||||
|
||||
func _end_charge() -> void:
|
||||
charge_clock = 0.
|
||||
|
|
@ -30,6 +31,7 @@ func _end_charge() -> void:
|
|||
|
||||
enemy.default_movement = true
|
||||
enemy.set_collision_mask_value(4, true)
|
||||
enemy.invulnerable = false
|
||||
|
||||
%KnockUpArea.monitoring = false
|
||||
%Meshes.position = Vector3.ZERO
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ const FRAME_IDXS := 10
|
|||
@export var max_speed := 8.
|
||||
@export var health := 10.
|
||||
@export var knockback_mul := 1.
|
||||
@export var invulnerable := false
|
||||
|
||||
var frame_idx := 0
|
||||
var frame_count := 0
|
||||
|
|
@ -57,6 +58,7 @@ func _process(delta: float) -> void:
|
|||
|
||||
|
||||
func hit(proj: Node3D, damage: float) -> bool:
|
||||
if invulnerable: return true
|
||||
health -= damage
|
||||
if health <= 0:
|
||||
queue_free()
|
||||
|
|
|
|||
|
|
@ -137,8 +137,12 @@ func _process(delta: float) -> void:
|
|||
|
||||
damage_clock -= delta
|
||||
|
||||
if Input.is_action_just_pressed("swap_weapons"):
|
||||
gun_index += 1
|
||||
if Input.is_action_just_pressed("sharpshooter"):
|
||||
gun_index = 0
|
||||
if Input.is_action_just_pressed("minigun"):
|
||||
gun_index = 1
|
||||
if Input.is_action_just_pressed("mortar"):
|
||||
gun_index = 2
|
||||
|
||||
func damage(damager: Node3D) -> void:
|
||||
if health <= 0: return
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ collision_layer = 2
|
|||
collision_mask = 13
|
||||
script = ExtResource("1_4flbx")
|
||||
shake_noise = SubResource("FastNoiseLite_onrkg")
|
||||
guns = [NodePath("Guns/BasicGun"), NodePath("Guns/MiniGun"), NodePath("Guns/Mortar")]
|
||||
guns = [NodePath("Guns/Sharpshooter"), NodePath("Guns/MiniGun"), NodePath("Guns/Mortar")]
|
||||
|
||||
[node name="MeshInstance3D" type="MeshInstance3D" parent="." unique_id=204505475]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.5, 0)
|
||||
|
|
@ -124,7 +124,7 @@ horizontal_alignment = 2
|
|||
|
||||
[node name="Guns" type="Node3D" parent="." unique_id=2018109083]
|
||||
|
||||
[node name="BasicGun" type="Node3D" parent="Guns" unique_id=1677055720]
|
||||
[node name="Sharpshooter" type="Node3D" parent="Guns" unique_id=1677055720]
|
||||
unique_name_in_owner = true
|
||||
script = ExtResource("3_g1dw6")
|
||||
|
||||
|
|
|
|||
|
|
@ -66,16 +66,26 @@ dash={
|
|||
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194325,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
|
||||
]
|
||||
}
|
||||
swap_weapons={
|
||||
"deadzone": 0.2,
|
||||
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":32,"key_label":0,"unicode":32,"location":0,"echo":false,"script":null)
|
||||
]
|
||||
}
|
||||
debug_menu={
|
||||
"deadzone": 0.2,
|
||||
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":96,"key_label":0,"unicode":96,"location":0,"echo":false,"script":null)
|
||||
]
|
||||
}
|
||||
sharpshooter={
|
||||
"deadzone": 0.2,
|
||||
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":49,"key_label":0,"unicode":49,"location":0,"echo":false,"script":null)
|
||||
]
|
||||
}
|
||||
minigun={
|
||||
"deadzone": 0.2,
|
||||
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":50,"key_label":0,"unicode":50,"location":0,"echo":false,"script":null)
|
||||
]
|
||||
}
|
||||
mortar={
|
||||
"deadzone": 0.2,
|
||||
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":51,"key_label":0,"unicode":51,"location":0,"echo":false,"script":null)
|
||||
]
|
||||
}
|
||||
|
||||
[layer_names]
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue