Provisório
This commit is contained in:
@@ -8,9 +8,6 @@ var Executed = false
|
||||
@onready var animator = get_node("gobot_new/AnimationPlayer")
|
||||
@onready var hud_container: HBoxContainer = $hud/Hud_container
|
||||
|
||||
|
||||
|
||||
|
||||
@export var view : Node3D
|
||||
@export var health := 3
|
||||
@export var foot_damage:= 1
|
||||
@@ -95,8 +92,7 @@ func knockback(impact_point: Vector3, force: Vector3) -> void:
|
||||
velocity = force.limit_length(9.0)
|
||||
|
||||
func _on_hurtbox_body_entered(body):
|
||||
#if health == 0:
|
||||
#is_dead = true
|
||||
|
||||
|
||||
var body_collision = (body.global_position - global_position)
|
||||
var force = -body_collision
|
||||
@@ -123,3 +119,8 @@ func verify_life():
|
||||
if health == 0:
|
||||
is_dead = true
|
||||
|
||||
|
||||
|
||||
func _on_foot_body_entered(body: Node3D) -> void: #foot
|
||||
|
||||
print(body.name)
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
extends RigidBody3D
|
||||
|
||||
const SPREAD_PIECES := 4
|
||||
const SPREAD_POWER := 350
|
||||
@onready var pieces_index := [0,1,2,3]
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
func _ready() -> void:
|
||||
pieces_index.shuffle()
|
||||
|
||||
for pieces in range(SPREAD_PIECES):
|
||||
var piece_index : int = pieces_index[pieces]
|
||||
var piece : RigidBody3D = get_child(piece_index)
|
||||
piece.show()
|
||||
piece.freeze = false
|
||||
piece.sleeping = false
|
||||
piece.set_colision_mask_value(2, true)
|
||||
|
||||
var rand_direction = (Vector3.ONE * 0.25) - Vector3(randf(),randf(), randf())
|
||||
piece.apply_force(rand_direction * SPREAD_POWER, rand_direction)
|
||||
|
||||
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
||||
func _process(delta: float) -> void:
|
||||
freeze = true
|
||||
@@ -0,0 +1 @@
|
||||
uid://27ghe6jcu08q
|
||||
@@ -0,0 +1,12 @@
|
||||
extends RigidBody3D
|
||||
|
||||
const BROKEN = preload("uid://busw6rdgoot4h")
|
||||
@onready var collision_shape_3d: CollisionShape3D = $CollisionShape3D
|
||||
func destroy_crate():
|
||||
var broken_instance:= BROKEN.instantiate()
|
||||
add_sibling(broken_instance)
|
||||
broken_instance.global_position = global_position
|
||||
visible = false
|
||||
collision_shape_3d.set_deferred("disabled", true)
|
||||
await get_tree().create_timer(1.5).timeout
|
||||
queue_free()
|
||||
@@ -0,0 +1 @@
|
||||
uid://c2phx32c8yv3x
|
||||
Reference in New Issue
Block a user