fixes
This commit is contained in:
parent
847670821d
commit
c5a54977ac
|
@ -7,7 +7,6 @@ func _ready():
|
|||
if parent is WORLD:
|
||||
parent.currentLevel = self
|
||||
|
||||
|
||||
func save():
|
||||
var data = {
|
||||
"filename": get_filename(),
|
||||
|
|
|
@ -2,6 +2,6 @@ extends StaticBody2D
|
|||
|
||||
onready var animation = $Animation
|
||||
|
||||
func _on_SaveArea_body_entered(body):
|
||||
func _on_SaveArea_body_entered(_body):
|
||||
animation.play("Save")
|
||||
SaverLoader.save_game()
|
||||
|
|
|
@ -2,4 +2,5 @@ extends Powerup
|
|||
|
||||
func _pickup():
|
||||
PlayerStats.missiles_unlocked = true
|
||||
PlayerStats.missiles += 1
|
||||
queue_free()
|
||||
|
|
|
@ -57,7 +57,17 @@ func assign_world_camera():
|
|||
cameraFollow.remote_path = MainInstances.WorldCamera.get_path()
|
||||
|
||||
func _exit_tree():
|
||||
MainInstances.Player = null
|
||||
# We need to check if the player in maininstances is this player instance,
|
||||
# it could be a loaded player and this call is made after the new player
|
||||
# is instanced and set in the MainInstances, so the new player is there and
|
||||
# we set it to null, breaking the game.
|
||||
if MainInstances.Player == self:
|
||||
MainInstances.Player = null
|
||||
|
||||
# This is another solution to the above problem
|
||||
# func queue_free():
|
||||
# MainInstances.Player = null
|
||||
# .queue_free()
|
||||
|
||||
func _physics_process(delta):
|
||||
just_jumped = false
|
||||
|
|
|
@ -5,7 +5,7 @@ var max_health = 4
|
|||
var health = max_health setget set_health
|
||||
var missiles_unlocked = false setget set_missiles_unlocked
|
||||
var max_missiles = 3
|
||||
var missiles = max_missiles setget set_missiles
|
||||
var missiles = 0 setget set_missiles
|
||||
|
||||
signal player_health_changed(value)
|
||||
signal player_missiles_unlocked(value)
|
||||
|
|
|
@ -13,7 +13,7 @@ func _ready():
|
|||
func _exit_tree():
|
||||
MainInstances.WorldCamera = null
|
||||
|
||||
func _process(delta):
|
||||
func _process(_delta):
|
||||
offset_h = rand_range(-shake, shake)
|
||||
offset_v = rand_range(-shake, shake)
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@ signal triggered
|
|||
var enabled = true
|
||||
|
||||
|
||||
func _on_Trigger_body_entered(body):
|
||||
func _on_Trigger_body_entered(_body):
|
||||
if enabled:
|
||||
emit_signal("triggered")
|
||||
enabled = false
|
||||
|
|
Loading…
Reference in New Issue