Extensive work done on basically everything. Attacks prototyped, animations prototyped, pawnbody split out, all traps but pitfall implemented, UI hooked up more.
This commit is contained in:
23
scripts/projectile.gd
Normal file
23
scripts/projectile.gd
Normal file
@@ -0,0 +1,23 @@
|
||||
class_name Projectile extends RigidBody3D
|
||||
|
||||
var direction : Vector3
|
||||
var speed : float
|
||||
var damage
|
||||
var time_remaining : float
|
||||
func _ready() -> void:
|
||||
linear_velocity = speed * direction
|
||||
time_remaining = 2
|
||||
|
||||
func _physics_process(delta: float) -> void:
|
||||
time_remaining -= delta
|
||||
if time_remaining <= 0:
|
||||
queue_free()
|
||||
|
||||
func _on_body_entered(body: Node) -> void:
|
||||
queue_free()
|
||||
|
||||
|
||||
|
||||
func _on_hit_area_entered(body: Node3D) -> void:
|
||||
if body is Player:
|
||||
body.hurt(damage)
|
||||
Reference in New Issue
Block a user