Renamed MapLoader to MapParser, added level select menu

This commit is contained in:
2020-01-28 23:41:44 -06:00
parent c1b5e72d7d
commit ea68748234
9 changed files with 42 additions and 20 deletions

View File

@@ -13,7 +13,7 @@ class IMICFPS
push_state(SettingsMenu)
end
link "Disconnect" do
link "Quit" do
push_state(MainMenu)
end
end

View File

@@ -0,0 +1,20 @@
class IMICFPS
class LevelSelectMenu < Menu
def setup
title "I-MIC FPS"
subtitle "Choose a Map"
Dir.glob(GAME_ROOT_PATH + "/maps/*.json").map { |file| [file, MapParser.new(map_file: file)]}.each do |file, map|
link map.metadata.name do
push_state(
LoadingState.new(forward: Game, map_file: file)
)
end
end
link "Back" do
pop_state
end
end
end
end

View File

@@ -3,7 +3,8 @@ class IMICFPS
def setup
title "I-MIC FPS"
link "Single Player" do
push_state(LoadingState.new(forward: Game, map_file: GAME_ROOT_PATH + "/maps/test_map.json"))
push_state(LevelSelectMenu)
# push_state(LoadingState.new(forward: Game, map_file: GAME_ROOT_PATH + "/maps/test_map.json"))
end
link "Settings" do
push_state(SettingsMenu)
@@ -13,4 +14,4 @@ class IMICFPS
end
end
end
end
end