A team game with an emphasis on movement (with no shooting), inspired by Overwatch and Zineth
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

235 lines
5.1 KiB

[WIP] Split up lobby -> menu, lobby, custom_game lobby.gd had gotten big, bloated, ugly, and hard to read. It needed a refactor. The first thing I did is split up the *GUI* into the logical steps it should be. So the new flow is: - Start the game - Click "Quick Play" - Matchmaking begins on my dedicated server - Start the game - Click "Custom Game" - *Only now* am I presented with server / client options - Start the game - Click "Singleplayer" - Singleplayer NOW, and only now, and NO MATTER WHAT PATH I TAKE, I am taken to the *lobby*, which now is where I: - Choose my name - Choose hero - See list of players - Get my team assigned - Anything else that I might like to put in The point here is that this has *nothing* to do with handshaking / matchmaking / etc! This is just part of the game! At this point I have *already been connected* to the server. I've already been aquainted with my other players. The game has begun. I put the things that don't belong in any of these flows in networking.gd, a sort of model-view sorta thing. All of these flows use some sort of networking thing like `init_server` that tbh should be *completely* abstracted from the UI. It's totally a WIP!!! Above is the IDEA, but below is what I've actually *done*: - Made the scenes, made a passable UI for each one that at least indicates ~what they'll do - Made the corresponding scripts, and split up the lobby script into ABOUT where I think it'll end up, but no promises It still errors all over the place, and it's nowhere near properly organized. PLUS, I'd also like to rewrite a lot of the code / rename things as part of the initial refactor goal of making me able to actually think about networking.
7 years ago
  1. [gd_scene load_steps=5 format=2]
  2. [ext_resource path="res://assets/theme.tres" type="Theme" id=1]
  3. [ext_resource path="res://scripts/custom_game.gd" type="Script" id=2]
  4. [ext_resource path="res://assets/DejaVuSansMono.ttf" type="DynamicFontData" id=3]
  5. [sub_resource type="DynamicFont" id=1]
  6. size = 30
  7. use_mipmaps = false
  8. use_filter = false
  9. font_data = ExtResource( 3 )
  10. [node name="CustomGame" type="Control"]
  11. anchor_left = 0.0
  12. anchor_top = 0.0
  13. anchor_right = 0.0
  14. anchor_bottom = 0.0
  15. margin_right = 40.0
  16. margin_bottom = 40.0
  17. rect_pivot_offset = Vector2( 0, 0 )
  18. mouse_filter = 0
  19. mouse_default_cursor_shape = 0
  20. size_flags_horizontal = 1
  21. size_flags_vertical = 1
  22. theme = ExtResource( 1 )
  23. script = ExtResource( 2 )
  24. [node name="VSeparator" type="VSeparator" parent="." index="0"]
  25. anchor_left = 0.0
  26. anchor_top = 0.0
  27. anchor_right = 0.0
  28. anchor_bottom = 0.0
  29. margin_left = 498.0
  30. margin_top = 140.0
  31. margin_right = 518.0
  32. margin_bottom = 563.0
  33. rect_pivot_offset = Vector2( 0, 0 )
  34. mouse_filter = 0
  35. mouse_default_cursor_shape = 0
  36. size_flags_horizontal = 1
  37. size_flags_vertical = 1
  38. [node name="Label" type="Label" parent="." index="1"]
  39. anchor_left = 0.0
  40. anchor_top = 0.0
  41. anchor_right = 0.0
  42. anchor_bottom = 0.0
  43. margin_left = 54.0
  44. margin_top = 66.0
  45. margin_right = 395.0
  46. margin_bottom = 102.0
  47. rect_pivot_offset = Vector2( 0, 0 )
  48. mouse_filter = 2
  49. mouse_default_cursor_shape = 0
  50. size_flags_horizontal = 1
  51. size_flags_vertical = 4
  52. custom_fonts/font = SubResource( 1 )
  53. text = "Custom Game"
  54. percent_visible = 1.0
  55. lines_skipped = 0
  56. max_lines_visible = -1
  57. [node name="Server" type="Button" parent="." index="2"]
  58. anchor_left = 0.0
  59. anchor_top = 0.0
  60. anchor_right = 0.0
  61. anchor_bottom = 0.0
  62. margin_left = 68.0
  63. margin_top = 261.0
  64. margin_right = 272.0
  65. margin_bottom = 331.0
  66. rect_pivot_offset = Vector2( 0, 0 )
  67. focus_mode = 2
  68. mouse_filter = 0
  69. mouse_default_cursor_shape = 0
  70. size_flags_horizontal = 1
  71. size_flags_vertical = 1
  72. toggle_mode = false
  73. enabled_focus_mode = 2
  74. shortcut = null
  75. group = null
  76. text = "Host Game"
  77. flat = false
  78. align = 1
  79. [node name="LevelSelect" type="OptionButton" parent="." index="3"]
  80. anchor_left = 0.0
  81. anchor_top = 0.0
  82. anchor_right = 0.0
  83. anchor_bottom = 0.0
  84. margin_left = 72.0
  85. margin_top = 201.0
  86. margin_right = 243.0
  87. margin_bottom = 236.0
  88. rect_pivot_offset = Vector2( 0, 0 )
  89. focus_mode = 2
  90. mouse_filter = 0
  91. mouse_default_cursor_shape = 0
  92. size_flags_horizontal = 1
  93. size_flags_vertical = 1
  94. toggle_mode = false
  95. action_mode = 0
  96. enabled_focus_mode = 2
  97. shortcut = null
  98. group = null
  99. text = "Platform map"
  100. flat = false
  101. align = 0
  102. selected = 0
  103. items = [ "Platform map", null, false, 0, null, "City-like thing", null, false, 1, null, "Slide", null, false, 2, null ]
  104. [node name="Client" type="Button" parent="." index="4"]
  105. anchor_left = 0.0
  106. anchor_top = 0.0
  107. anchor_right = 0.0
  108. anchor_bottom = 0.0
  109. margin_left = 588.0
  110. margin_top = 258.0
  111. margin_right = 812.0
  112. margin_bottom = 332.0
  113. rect_pivot_offset = Vector2( 0, 0 )
  114. focus_mode = 2
  115. mouse_filter = 0
  116. mouse_default_cursor_shape = 0
  117. size_flags_horizontal = 1
  118. size_flags_vertical = 1
  119. toggle_mode = false
  120. enabled_focus_mode = 2
  121. shortcut = null
  122. group = null
  123. text = "Join Game"
  124. flat = false
  125. align = 1
  126. [node name="IPLabel" type="Label" parent="." index="5"]
  127. anchor_left = 0.0
  128. anchor_top = 0.0
  129. anchor_right = 0.0
  130. anchor_bottom = 0.0
  131. margin_left = 592.0
  132. margin_top = 205.0
  133. margin_right = 625.0
  134. margin_bottom = 227.0
  135. rect_pivot_offset = Vector2( 0, 0 )
  136. mouse_filter = 2
  137. mouse_default_cursor_shape = 0
  138. size_flags_horizontal = 1
  139. size_flags_vertical = 4
  140. text = "IP:"
  141. percent_visible = 1.0
  142. lines_skipped = 0
  143. max_lines_visible = -1
  144. [node name="IP" type="TextEdit" parent="." index="6"]
  145. anchor_left = 0.0
  146. anchor_top = 0.0
  147. anchor_right = 0.0
  148. anchor_bottom = 0.0
  149. margin_left = 632.0
  150. margin_top = 202.0
  151. margin_right = 783.0
  152. margin_bottom = 231.0
  153. rect_pivot_offset = Vector2( 0, 0 )
  154. focus_mode = 2
  155. mouse_filter = 0
  156. mouse_default_cursor_shape = 0
  157. size_flags_horizontal = 1
  158. size_flags_vertical = 1
  159. text = "127.0.0.1"
  160. readonly = false
  161. highlight_current_line = false
  162. syntax_highlighting = false
  163. show_line_numbers = false
  164. highlight_all_occurrences = false
  165. override_selected_font_color = false
  166. context_menu_enabled = true
  167. smooth_scrolling = false
  168. v_scroll_speed = 80.0
  169. hiding_enabled = 0
  170. wrap_lines = false
  171. caret_block_mode = false
  172. caret_blink = false
  173. caret_blink_speed = 0.65
  174. caret_moving_by_right_click = true
  175. [node name="Label2" type="Label" parent="." index="7"]
  176. anchor_left = 0.0
  177. anchor_top = 0.0
  178. anchor_right = 0.0
  179. anchor_bottom = 0.0
  180. margin_left = 72.0
  181. margin_top = 145.0
  182. margin_right = 171.0
  183. margin_bottom = 167.0
  184. rect_pivot_offset = Vector2( 0, 0 )
  185. mouse_filter = 2
  186. mouse_default_cursor_shape = 0
  187. size_flags_horizontal = 1
  188. size_flags_vertical = 4
  189. text = "Host game"
  190. percent_visible = 1.0
  191. lines_skipped = 0
  192. max_lines_visible = -1
  193. [node name="Label3" type="Label" parent="." index="8"]
  194. anchor_left = 0.0
  195. anchor_top = 0.0
  196. anchor_right = 0.0
  197. anchor_bottom = 0.0
  198. margin_left = 577.0
  199. margin_top = 147.0
  200. margin_right = 617.0
  201. margin_bottom = 169.0
  202. rect_pivot_offset = Vector2( 0, 0 )
  203. mouse_filter = 2
  204. mouse_default_cursor_shape = 0
  205. size_flags_horizontal = 1
  206. size_flags_vertical = 4
  207. text = "Join Game"
  208. percent_visible = 1.0
  209. lines_skipped = 0
  210. max_lines_visible = -1