Started fps system

This commit is contained in:
Rendo 2025-11-24 04:44:42 +05:00
commit cc26793ab6
32 changed files with 2756 additions and 11 deletions

View file

@ -1,5 +1,19 @@
extends CharacterBody3D
const MAX_HP = 100
@export var hp: int = 100:
set(value):
if value < 0:
hp = 0
else:
hp = value
if hp == 0:
die()
get:
return hp
@export var animation_player: AnimationPlayer
@export var stand_up_area: Area3D
@ -71,7 +85,6 @@ func _input(event: InputEvent) -> void:
crouched = true
elif event.is_action_released("plr_crouch") and TOGGLE_CROUCH == false:
crouched = false
if event.is_action_pressed("plr_drop"):
var grenade = preload("res://scenes/smoke.tscn").instantiate()
get_tree().current_scene.add_child(grenade)
grenade.global_position = global_position + Vector3.UP * 0.5
func die() -> void:
queue_free()