Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into dev_adri
Browse files Browse the repository at this point in the history
# Conflicts:
#	real_deal/scripts/utils/player/player_manager.gd
  • Loading branch information
SeindElBardo committed May 17, 2021
2 parents 8a176c7 + ad3ef40 commit b6fc75c
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
5 changes: 5 additions & 0 deletions real_deal/scripts/map/niveles/LevelLoader.gd
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,11 @@ func _enter_tree():

func cambiar_nivel(portal_path):
var portal = get_node(portal_path)
# TODO esto lo ideal es pasar algún tipo de "callback" o funciones extras" para no hacer casos concretos
# A NO SER que solo vaya a existir este "if"
if "limbo" in portal.hacia:
PlayerManager.restore_player()

SceneManager.goto_scene(
"res://real_deal/scenes/map/{}.tscn".format([portal.hacia], "{}"),
{"escena": portal.hacia}
Expand Down
1 change: 0 additions & 1 deletion real_deal/scripts/menu/MainMenu.gd
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,4 @@ func _on_Quit_pressed():

func _on_Start_pressed():
# Cambia la escena al juego
PlayerManager._ready()
SceneManager.goto_scene("res://real_deal/scenes/map/mvp_limbo.tscn", {"escena": "mvp_limbo"})
7 changes: 7 additions & 0 deletions real_deal/scripts/utils/player/player_manager.gd
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,13 @@ func _ready():
"fire"
]
inventory = Inventory.new()


func restore_player():
""" Pone la vida y la energía al máximo
"""
self.health = self.max_health
self.energy = self.max_energy


func save():
Expand Down

0 comments on commit b6fc75c

Please sign in to comment.