latest prompts by @gera
This commit is contained in:
+6
-8
@@ -21,6 +21,7 @@ var has_iron_shield: bool = false
|
||||
var shield_tier: int = 0
|
||||
var is_shielding: bool = false
|
||||
var kick_timer: float = 0.0
|
||||
var interact_timer: float = 0.0
|
||||
var invincible_timer: float = 0.0
|
||||
var is_alive: bool = true
|
||||
var last_move_dir: Vector3 = Vector3.FORWARD
|
||||
@@ -93,11 +94,6 @@ func _make_kick_arc_mesh() -> ArrayMesh:
|
||||
mesh.add_surface_from_arrays(Mesh.PRIMITIVE_TRIANGLES, arrays)
|
||||
return mesh
|
||||
|
||||
func _input(event: InputEvent) -> void:
|
||||
if event is InputEventKey and event.pressed and not event.echo:
|
||||
if event.keycode == KEY_E:
|
||||
_try_interact()
|
||||
|
||||
func _physics_process(delta: float) -> void:
|
||||
if not is_alive:
|
||||
return
|
||||
@@ -105,6 +101,9 @@ func _physics_process(delta: float) -> void:
|
||||
_handle_movement(delta)
|
||||
_handle_kick(delta)
|
||||
_handle_iframes(delta)
|
||||
interact_timer = max(0.0, interact_timer - delta)
|
||||
if interact_timer <= 0.0:
|
||||
_try_interact()
|
||||
if Input.is_mouse_button_pressed(MOUSE_BUTTON_LEFT) and kick_timer <= 0.0:
|
||||
_do_kick()
|
||||
|
||||
@@ -273,15 +272,14 @@ func take_damage(amount: int, attacker_toughness: int = 0) -> void:
|
||||
emit_signal("health_changed", health, max_health)
|
||||
SFX.damage(get_parent())
|
||||
_squish_effect()
|
||||
if health <= 0:
|
||||
_die()
|
||||
|
||||
func heal(amount: int) -> void:
|
||||
if not is_alive:
|
||||
return
|
||||
health = min(health + amount, max_health)
|
||||
emit_signal("health_changed", health, max_health)
|
||||
var tw := create_tween()
|
||||
tw.tween_property(player_mat, "albedo_color", Color(0.1, 1.0, 0.35), 0.08)
|
||||
tw.tween_property(player_mat, "albedo_color", BASE_COLOR, 0.3)
|
||||
|
||||
func _die() -> void:
|
||||
is_alive = false
|
||||
|
||||
Reference in New Issue
Block a user