Started a Godot Project to remake Tailgunner.
This commit is contained in:
commit
9621323983
67 changed files with 976 additions and 0 deletions
18
scripts/projectile.gd
Normal file
18
scripts/projectile.gd
Normal file
|
@ -0,0 +1,18 @@
|
|||
class_name Projectile
|
||||
extends CharacterBody2D
|
||||
|
||||
# constants
|
||||
@export var speed = 10
|
||||
@export var damage = 5
|
||||
@export var friendly = false
|
||||
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
func _ready() -> void:
|
||||
pass # Replace with function body.
|
||||
|
||||
|
||||
func _physics_process(delta: float) -> void:
|
||||
var target = move_and_collide(velocity * delta).get_collider()
|
||||
if target is Flyer && friendly != target.friendly:
|
||||
target.deal_damage(damage)
|
||||
queue_free()
|
Loading…
Add table
Add a link
Reference in a new issue