forked from team-sg/hero-mark-2
added machinegun turret
This commit is contained in:
parent
a85b68a317
commit
5f6968a7e9
11 changed files with 567 additions and 2 deletions
18
objects/environment/turret/turret_bullet.gd
Normal file
18
objects/environment/turret/turret_bullet.gd
Normal file
|
@ -0,0 +1,18 @@
|
|||
extends Node2D
|
||||
|
||||
export var speed = 100.0
|
||||
|
||||
var direction = Vector2.DOWN
|
||||
|
||||
func _physics_process(delta):
|
||||
position += direction * speed * delta
|
||||
|
||||
|
||||
func _on_Hitbox_area_entered(area):
|
||||
if area.is_in_group("player"):
|
||||
area.get_parent().die()
|
||||
|
||||
|
||||
func _on_Hitbox_body_entered(body):
|
||||
if body is TileMap or body is StaticBody2D:
|
||||
queue_free()
|
Loading…
Add table
Add a link
Reference in a new issue