mortar + mini gun cannot hit weak points
This commit is contained in:
parent
f73f093ae2
commit
045faf2333
10 changed files with 77 additions and 1 deletions
17
player/projectile/mortar_projectile.gd
Normal file
17
player/projectile/mortar_projectile.gd
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
class_name MortarProjectile
|
||||
extends Node3D
|
||||
|
||||
var velocity: Vector3
|
||||
|
||||
const GRAVITY := 40.
|
||||
|
||||
func _process(delta: float) -> void:
|
||||
position += velocity * delta
|
||||
velocity += GRAVITY * Vector3.DOWN * delta
|
||||
|
||||
if position.y <= 0.:
|
||||
var explosion := preload("res://player/explosion/explosion.tscn").instantiate()
|
||||
explosion.position = position
|
||||
add_sibling(explosion)
|
||||
|
||||
queue_free()
|
||||
Loading…
Add table
Add a link
Reference in a new issue