Skip to content

Commit

Permalink
Destroy global.gd, add configurable settings in engine.cfg
Browse files Browse the repository at this point in the history
  • Loading branch information
bojidar-bg committed Mar 19, 2016
1 parent b725eb8 commit 5eb19f7
Show file tree
Hide file tree
Showing 13 changed files with 209 additions and 235 deletions.
15 changes: 14 additions & 1 deletion engine.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,24 @@ main_scene="res://menu/menu.tscn"
icon="icon.png"
boot_splash="res://KOBUGE_Splash.png"

[application.config]

version_patch="0"
debug_load_level=true
debug_load_level_pack="spaceship"
debug_load_level_id=7
version_major="1"
version_minor="2"
version_build="dev"

[autoload]

config="res://shared/config.gd"
SaveManager="*res://shared/save_manager.gd"
ScreenManager="res://shared/screen_manager.gd"
ScenesManager="*res://shared/scenes_manager.gd"
SettingsManager="*res://shared/settings_manager.gd"
FileManager="*res://shared/file_manager.gd"
global="res://scripts/global.gd"
SUTjoystick="res://scripts/SUTjoystick.gd"

[display]
Expand Down
3 changes: 1 addition & 2 deletions main/gui.gd
Original file line number Diff line number Diff line change
Expand Up @@ -105,14 +105,13 @@ func popup_button_pressed(name): # Actions for different popup buttons
if name == "retry":
level_holder.retry_level()
elif name == "next":
print(allow_next_level)
if allow_next_level:
allow_next_level = false
level_holder.next_level()
else:
return
elif name == "menu":
get_node("/root/global").load_scene("res://menu/menu.tscn")
ScenesManager.load_scene("res://menu/menu.tscn")

JS.emulate_mouse(false)
hide_popup()
Expand Down
5 changes: 1 addition & 4 deletions main/level_holder.gd
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ onready var sample_player = get_node("../sample_player")
onready var music = get_node("../music")
onready var gui = get_node("../gui")
onready var player = get_node("../player_holder/player")
onready var global = get_node("/root/global")

onready var raw_packs = FileManager.get_file_lines("res://levels/packs.txt")

Expand Down Expand Up @@ -116,14 +115,13 @@ func goal_take(type = "", wait = 0): # Called when a goal is taken
goals_left = goals_left - 1

if goals_left == 0:
global.set_reached_level(current_pack, current_level + 1)
SaveManager.set_reached_level(current_pack, current_level + 1)

# Check if there are more levels
for raw_pack in raw_packs:
var line_parts = raw_pack.split(" ")
if line_parts.size() >= 2:
if line_parts[0] == current_pack:
print(int(line_parts[1]), int(current_level) + 1)
gui.prompt_finsh_level(turns, int(line_parts[1]) >= int(current_level) + 1)
break

Expand All @@ -149,5 +147,4 @@ func retry_level(): # Retry the current level
load_level(current_pack, current_level)

func next_level(): # Go to the next level
print("!")
load_level(current_pack, int(current_level) + 1)
Loading

0 comments on commit 5eb19f7

Please sign in to comment.