implemented y-wing main cannon and effects.
This commit is contained in:
@@ -43,8 +43,9 @@ func _physics_process(delta):
|
||||
global_position.y += speed * delta
|
||||
|
||||
#main cannon firing
|
||||
if mainray.is_colliding and mainray.get_collider is player:
|
||||
if mainray.is_colliding and mainray.get_collider() is player:
|
||||
if main_cannon == true:
|
||||
print("target")
|
||||
fire_main_cannon()
|
||||
main_cannon = false
|
||||
mainCannonFire.start()
|
||||
|
||||
16
Scripts/y_wing_main_cannon_laser.gd
Normal file
16
Scripts/y_wing_main_cannon_laser.gd
Normal file
@@ -0,0 +1,16 @@
|
||||
extends Area2D
|
||||
|
||||
var speed = 2500
|
||||
|
||||
|
||||
func _physics_process(delta):
|
||||
global_position.y += speed * delta
|
||||
if global_position.y >= 980:
|
||||
queue_free()
|
||||
|
||||
|
||||
|
||||
func _on_area_entered(area):
|
||||
if area is player:
|
||||
area.take_damage(1)
|
||||
queue_free()
|
||||
Reference in New Issue
Block a user