Fixed shield crash and material coloring
This commit is contained in:
parent
793938857e
commit
255a47f6da
7 changed files with 10 additions and 12 deletions
|
|
@ -19,7 +19,7 @@ func _on_body_entered(body):
|
|||
ship_in_menu = true
|
||||
body.allow_shooting = false
|
||||
menu_inst = menu.instantiate()
|
||||
menu_inst.modulate = get_parent().modulate
|
||||
menu_inst.modulate = get_parent().material.get_shader_parameter('color')
|
||||
menu_inst.base = get_parent()
|
||||
body.find_child("GUI").add_child(menu_inst)
|
||||
body.minimap.visible = false
|
||||
|
|
|
|||
|
|
@ -20,6 +20,7 @@ var wave_positions = [Vector2.ZERO,Vector2.ZERO,Vector2.ZERO,Vector2.ZERO,Vector
|
|||
func _ready():
|
||||
recharge_timer.timeout.connect(recharging_timer_out)
|
||||
laser_timer.timeout.connect(laser_timer_out)
|
||||
material = ship.material
|
||||
|
||||
func deal_damage(damage : float,hit_position : Vector2):
|
||||
# Shield wave
|
||||
|
|
|
|||
|
|
@ -16,19 +16,10 @@ var turbo_enabled = false
|
|||
var alternative_movement = false
|
||||
var destination_angle : float
|
||||
var destination_difference : float
|
||||
var rdy = false
|
||||
|
||||
func _ready():
|
||||
get_tree().create_timer(0.05).timeout.connect(is_rdy)
|
||||
|
||||
func is_rdy():
|
||||
rdy = true
|
||||
hull = ship.hull
|
||||
|
||||
func _physics_process(delta):
|
||||
if !rdy:
|
||||
return
|
||||
hull = ship.hull
|
||||
modulate = ship.material.get_shader_parameter('color')
|
||||
var turbo_input = Input.get_action_raw_strength("turbo")
|
||||
var acceleration_input = Input.get_axis("deccelerate", "accelerate") if ship is MainShip else 1.0
|
||||
var rotation_input = Input.get_axis("rotateleft","rotateright")
|
||||
|
|
|
|||
|
|
@ -45,5 +45,5 @@ func shoot():
|
|||
proj_inst.global_position = spawner.global_position
|
||||
proj_inst.global_rotation = spawner.global_rotation + randf_range(-deviation/2, deviation/2)
|
||||
proj_inst.faction = ship.faction
|
||||
proj_inst.modulate = ship.modulate
|
||||
proj_inst.modulate = ship.material.get_shader_parameter('color')
|
||||
weapon_shooted.emit()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue