Fix enemy lasers crashing mothership. Randomized boss spawns

This commit is contained in:
Sage Vaillancourt 2018-06-05 16:43:23 -04:00
parent 2ae7067aeb
commit c3301f068a
3 changed files with 45 additions and 35 deletions

View File

@ -19,7 +19,7 @@ animations = [ {
"speed": 20.0 "speed": 20.0
} ] } ]
[node name="Laser" type="Area2D" index="0"] [node name="Laser" type="Area2D"]
input_pickable = true input_pickable = true
gravity_vec = Vector2( 0, 1 ) gravity_vec = Vector2( 0, 1 )

26
Main.gd
View File

@ -141,18 +141,28 @@ var sendblob = 1
var bad_health_multi = 1.5 var bad_health_multi = 1.5
var total_bads_spawned = 0 var total_bads_spawned = 0
func BaddieTimer(): func BaddieTimer():
if total_bads_spawned%6 == 0: # 75 default #if total_bads_spawned%6 == 0: # 75 default
if get_tree().is_network_server(): # if get_tree().is_network_server():
total_bads_spawned += 1 # total_bads_spawned += 1
rpc("bossMode") # rpc("bossMode")
else: # else:
total_bads_spawned += 1 # total_bads_spawned += 1
bossMode() # bossMode()
#
if bads_this_round <= a_round_of_bads && bad_spawning_enabled: if bads_this_round <= a_round_of_bads && bad_spawning_enabled:
var bad_type var bad_type
var badposition = Vector2() var badposition = Vector2()
if sendblob%6 == 0:
if get_tree().is_network_server():
total_bads_spawned += 1
sendblob += 1
rpc("bossMode")
else:
total_bads_spawned += 1
sendblob += 1
bossMode()
else:
if sendblob%50 == 0: if sendblob%50 == 0:
bad_type = 3 bad_type = 3
sendblob += 1 sendblob += 1

View File

@ -270,10 +270,10 @@ _sections_unfolded = [ "Visibility" ]
[connection signal="other_shooting_upgrade" from="Player" to="." method="other_shooting_upgrade"] [connection signal="other_shooting_upgrade" from="Player" to="." method="other_shooting_upgrade"]
[connection signal="restart_game" from="Player" to="." method="_on_Player_restart_game"]
[connection signal="restart_game" from="Player" to="Mothership" method="_on_Player_restart_game"] [connection signal="restart_game" from="Player" to="Mothership" method="_on_Player_restart_game"]
[connection signal="restart_game" from="Player" to="." method="_on_Player_restart_game"]
[connection signal="update_display" from="Player" to="." method="_on_Player_update_display"] [connection signal="update_display" from="Player" to="." method="_on_Player_update_display"]
[connection signal="timeout" from="BaddieTimer" to="." method="BaddieTimer"] [connection signal="timeout" from="BaddieTimer" to="." method="BaddieTimer"]