working on items and inventory

This commit is contained in:
2023-02-08 22:55:54 -05:00
parent 836a0e4a93
commit 03402abb6c
24 changed files with 617 additions and 117 deletions

View File

@@ -0,0 +1,25 @@
extends RigidBody2D
@export var hit_power:int = 10
@export var nail_velocity:int = 200
@export var spawn_offset:int = 25
@export var cleanup_time:float = 2.0
@onready var collision_shape = get_node("CollisionShape2D")
@onready var facing_vector = Vector2(0, 0)
@onready var controlling_player:CharacterBody2D
@onready var hit_player:CharacterBody2D = null
func _on_body_entered(body):
if body.is_in_group("moveable"):
collision_shape.set_deferred("disabled", true)
body.apply_central_impulse(facing_vector)
elif body.is_in_group("player"):
body.player_hit.is_player_hit = true
#body.player_hit.hit_velocity = last_velocity.normalized() * push_strength
body.health_changed_func(-1)
hit_player = body