Y wing turret and laser update
This commit is contained in:
@@ -25,8 +25,8 @@ var main_cannon = true
|
||||
|
||||
#can turret fire? (rate of fire control)
|
||||
var turret_cannon = true
|
||||
var firing_solution = null
|
||||
var target_area = null
|
||||
var firing_solution : float
|
||||
var target_area : Vector2
|
||||
|
||||
|
||||
#reset raycast, setup settings
|
||||
@@ -52,7 +52,10 @@ func _physics_process(delta):
|
||||
|
||||
if target_ray.is_colliding and target_ray.get_collider() is player:
|
||||
if turret_cannon == true:
|
||||
fire_turret(turret_muzzle,firing_solution,target_area)
|
||||
fire_turret(turret_muzzle.global_position,firing_solution,target_area)
|
||||
#print(str(turret_muzzle.global_position))
|
||||
#print(str(firing_solution))
|
||||
#print(str(target_area))
|
||||
turret_timer.start()
|
||||
turret_cannon = false
|
||||
|
||||
@@ -90,8 +93,11 @@ func aim_turret(delta):
|
||||
firing_solution = atan2(target.y - turret_pos.y, target.x - turret_pos.x)-90*(PI/180)
|
||||
target_area = target_pos
|
||||
|
||||
func fire_turret(location,rotation,target_area):
|
||||
get_tree().current_scene.firey_wingturret(location,rotation,target_area)
|
||||
func fire_turret(location,firing_solution,target_area):
|
||||
get_tree().current_scene.firey_wingturret(location,firing_solution,target_area)
|
||||
#print(str(location))
|
||||
#print(str(firing_solution))
|
||||
#print(str(target_area))
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user