Browse Source
sunday update
sunday update
87 changed files with 2571 additions and 1226 deletions
-
104ext/server.py
-
106project.godot
-
85resources/ui/i18n.csv
-
BINresources/ui/i18n.de.translation
-
BINresources/ui/i18n.en.translation
-
28resources/ui/theme.tres
-
0scenes/game/World.tscn
-
48scenes/game/test_world.tscn
-
0scenes/lanes/StartLanes.tscn
-
66scenes/menu/ingame.tscn
-
82scenes/menu/lobby.tscn
-
71scenes/menu/local_game.tscn
-
125scenes/menu/main.tscn
-
40scenes/menu/player_settings.tscn
-
91scenes/menu/server.tscn
-
72scenes/menu/settings.tscn
-
10scenes/menus/BaseMenu.tscn
-
70scenes/menus/DirectHostMenu.tscn
-
103scenes/menus/DirectJoinMenu.tscn
-
69scenes/menus/IngameMenu.tscn
-
147scenes/menus/LobbyMenu.tscn
-
108scenes/menus/LocalGameMenu.tscn
-
90scenes/menus/MainMenu.tscn
-
159scenes/menus/MultiplayerMenu.tscn
-
99scenes/menus/ServerCreateGameMenu.tscn
-
189scenes/menus/SettingsControlsMenu.tscn
-
156scenes/menus/SettingsMenu.tscn
-
39scenes/menus/SettingsPlayerMenu.tscn
-
6scenes/player/BotPlayer.tscn
-
30scenes/player/HumanPlayer.tscn
-
4scenes/player/Player.tscn
-
12scenes/road/roadBump.tscn
-
3scenes/road/roadCornerSmall.tscn
-
1scenes/road/roadCornerSmallFlipped.tscn
-
8scenes/road/roadRamp.tscn
-
8scenes/road/roadRampFlipped.tscn
-
8scenes/road/roadRampLong.tscn
-
8scenes/road/roadRampLongCurved.tscn
-
8scenes/road/roadRampLongCurvedFlipped.tscn
-
8scenes/road/roadRampLongFlipped.tscn
-
12scenes/road/roadStart.tscn
-
8scenes/road/roadStraight.tscn
-
8scenes/road/roadStraightArrow.tscn
-
8scenes/road/roadStraightLong.tscn
-
8scenes/road/roadStraightLongBump.tscn
-
4scenes/road/roadStraightLongBumpRound.tscn
-
8scenes/road/roadStraightLongMid.tscn
-
8scenes/road/roadStraightSkew.tscn
-
8scenes/road/roadStraightSkewFlipped.tscn
-
8scripts/Util.gd
-
170scripts/game/game.gd
-
13scripts/game/local_storage.gd
-
5scripts/game/route.gd
-
10scripts/game/world.gd
-
22scripts/menu/direct_host.gd
-
34scripts/menu/direct_join.gd
-
59scripts/menu/main.gd
-
15scripts/menu/player_settings.gd
-
32scripts/menu/server.gd
-
22scripts/menu/settings.gd
-
33scripts/menus/direct_host.gd
-
27scripts/menus/direct_join.gd
-
8scripts/menus/ingame.gd
-
38scripts/menus/lobby.gd
-
15scripts/menus/local_game.gd
-
43scripts/menus/main.gd
-
141scripts/menus/server.gd
-
44scripts/menus/server_create.gd
-
67scripts/menus/settings.gd
-
89scripts/menus/settings_controls.gd
-
14scripts/menus/settings_player.gd
-
44scripts/networking/client.gd
-
14scripts/networking/game_server.gd
-
35scripts/networking/game_server_requests.gd
-
156scripts/networking/server.gd
-
37scripts/player/HumanControls.gd
-
3scripts/player/base_inventory.gd
-
10scripts/player/base_player.gd
-
9scripts/player/bot_controls.gd
-
5scripts/player/bot_inventory.gd
-
51scripts/player/human_controls.gd
-
15scripts/player/human_inventory.gd
-
3scripts/player/inventory_preview.gd
-
40scripts/player/player.gd
-
4scripts/player/race_car.gd
-
25scripts/road/road.gd
-
2scripts/road/roads_factory.gd
@ -0,0 +1,85 @@ |
|||||
|
,en,de |
||||
|
BACK,back,Zurück |
||||
|
MULTIPLAYER,multiplayer,Multiplayer |
||||
|
PRACTISE,practise,Training |
||||
|
SETTINGS,settings,Einstellungen |
||||
|
DEBUG,debug EN,Debug DE |
||||
|
HOST,host,Host |
||||
|
JOIN,join,Beitreten |
||||
|
QUIT,quit,Beenden |
||||
|
DIRECT_HOST,direct host,Direkt hosten |
||||
|
DIRECT_JOIN,direct join,Direkt beitreten |
||||
|
OPEN_GAMES_ONLY,open games only,Nur offene Spiele |
||||
|
REFRESH,refresh,Aktualisieren |
||||
|
CREATE_GAME,create game,Spiel erstellen |
||||
|
PLAYER_NAME,name,Name |
||||
|
PLAYER_COLOR,color,Farbe |
||||
|
BOTS,bots,Bots |
||||
|
GAME,game,Spiel |
||||
|
PORT,port,Port |
||||
|
IP,IP,IP |
||||
|
RESUME,resume,Fortsetzen |
||||
|
END_GAME,end game,Spiel beenden |
||||
|
START_GAME,start game,Spiel starten |
||||
|
GAME_NAME,name,Name |
||||
|
READY,ready,Bereit |
||||
|
ALERT,Alert!,Fehler! |
||||
|
CONTROLS,controls,Steuerung |
||||
|
RESET,reset,Zurücksetzen |
||||
|
PRESS_KEY,Press any key...,Taste drücken… |
||||
|
ERROR_SERVER_CREATION,Cannot create Server!,Server konnte nicht erstellt werden! |
||||
|
INVALID_IP4,Invalid IPv4 address!,Ungültige IPv4 Adresse! |
||||
|
SERVER_DISCONNECTED,Server disconnected!,Serververbindung getrennt! |
||||
|
SERVER_NO_CONNECTION,No connection to server!,Keine Verbindung zu Server! |
||||
|
CONNECTION_FAILED,Connection failed!,Verbindung fehlgeschlagen! |
||||
|
SYSTEM,system,System |
||||
|
LOCALE,language,Sprache |
||||
|
LOCALE_EN,english,Englisch (english) |
||||
|
LOCALE_DE,german (Deutsch),Deutsch |
||||
|
GRAPHICS,graphics,Grafik |
||||
|
SAVE,save,Speichern |
||||
|
KEYBOARD,keyboard,Tastatur |
||||
|
JOYPAD,joypad,Joypad |
||||
|
Up,,Hoch |
||||
|
Down,,Runter |
||||
|
Left,,Links |
||||
|
Right,,Rechts |
||||
|
Space,,Leertaste |
||||
|
Control,,Strg |
||||
|
PageUp,,Bild hoch |
||||
|
PageDown,,Bild runter |
||||
|
Insert,,Einf |
||||
|
Delete,,Entf |
||||
|
Home,,Pos 1 |
||||
|
End,,Ende |
||||
|
,, |
||||
|
StraightLong,straight,Gerade |
||||
|
Straight,short straight,kurze Gerade |
||||
|
CornerLarge,right corner,Rechtskurve |
||||
|
CornerLargeFlipped,left corner,Linkskurve |
||||
|
CornerLarger,long right corner,lange Rechtskurve |
||||
|
CornerLargerFlipped,long left corner,lange Linkskurve |
||||
|
CornerSmall,short right corner,kurze Rechtskurve |
||||
|
CornerSmallFlipped,short left corner,kurze Linkskurve |
||||
|
StraightLongBump,bump,Bodenwelle |
||||
|
Bump,small bump,kurze Bodenwelle |
||||
|
StraightSkew,right skew,rechte Schräge |
||||
|
StraightSkewFlipped,left skew,linke Schräge |
||||
|
RampLong,ramp up,Rampe hoch |
||||
|
RampLongFlipped,ramp down,Rampe runter |
||||
|
RampLongCurved,curved ramp up,Rundung hoch |
||||
|
RampLongCurvedFlipped,curved ramp down,Rundung runter |
||||
|
Ramp,short ramp up,kurze Rampe hoch |
||||
|
RampFlipped,short ramp down,kurze Rampe runter |
||||
|
CurvedFlipped,shicane right,Schikane rechts |
||||
|
Curved,shicane left,Schikane links |
||||
|
Loop,looping,Looping |
||||
|
,, |
||||
|
controls_thrust,thrust,Beschleunigen |
||||
|
controls_break,break,Bremsen |
||||
|
controls_add_road,add,Setzen |
||||
|
controls_next_road_type,next type,Nächste Kategorie |
||||
|
controls_prev_road_type,previous type,Vorherige Kategorie |
||||
|
controls_next_road_variant,next variant,Nächste Variante |
||||
|
controls_prev_road_variant,previous variant,Vorherige Variante |
||||
|
controls_reset,reset,Zurücksetzen |
@ -1,48 +0,0 @@ |
|||||
[gd_scene load_steps=6 format=2] |
|
||||
|
|
||||
[ext_resource path="res://scenes/road/roadStartPositions.tscn" type="PackedScene" id=1] |
|
||||
[ext_resource path="res://scenes/road/roadStart.tscn" type="PackedScene" id=2] |
|
||||
[ext_resource path="res://scenes/road/roadStraightLong.tscn" type="PackedScene" id=3] |
|
||||
[ext_resource path="res://scenes/road/roadStraightLongBump.tscn" type="PackedScene" id=4] |
|
||||
[ext_resource path="res://scenes/raceCar/raceCar.tscn" type="PackedScene" id=5] |
|
||||
|
|
||||
[node name="world" type="Spatial"] |
|
||||
|
|
||||
[node name="sun" type="DirectionalLight" parent="."] |
|
||||
transform = Transform( 0.324827, 0.775291, 0.541675, -0.754407, -0.133022, 0.642788, 0.570402, -0.617438, 0.541675, 0, 100, 0 ) |
|
||||
visible = false |
|
||||
light_energy = 5.0 |
|
||||
directional_shadow_mode = 1 |
|
||||
directional_shadow_max_distance = 25.0 |
|
||||
|
|
||||
[node name="route" type="Spatial" parent="."] |
|
||||
transform = Transform( 10, 0, 0, 0, 10, 0, 0, 0, 10, 0, 0, 0 ) |
|
||||
|
|
||||
[node name="roadStartPositions" parent="route" instance=ExtResource( 1 )] |
|
||||
|
|
||||
[node name="roadStart" parent="route" instance=ExtResource( 2 )] |
|
||||
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 2 ) |
|
||||
|
|
||||
[node name="roadStraightLong" parent="route" instance=ExtResource( 3 )] |
|
||||
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 4 ) |
|
||||
|
|
||||
[node name="roadStraightLongBump" parent="route" instance=ExtResource( 4 )] |
|
||||
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 6 ) |
|
||||
|
|
||||
[node name="roadStraightLong2" parent="route" instance=ExtResource( 3 )] |
|
||||
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 8 ) |
|
||||
|
|
||||
[node name="players" type="Spatial" parent="."] |
|
||||
transform = Transform( 10, 0, 0, 0, 10, 0, 0, 0, 10, 0, 0, 0 ) |
|
||||
|
|
||||
[node name="raceCar" parent="players" instance=ExtResource( 5 )] |
|
||||
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0.258, 0.015, 0.45 ) |
|
||||
|
|
||||
[node name="raceCar2" parent="players" instance=ExtResource( 5 )] |
|
||||
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0.0887639, 0, 0.416576 ) |
|
||||
|
|
||||
[node name="raceCar3" parent="players" instance=ExtResource( 5 )] |
|
||||
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -0.0902514, 0, 0.416576 ) |
|
||||
|
|
||||
[node name="raceCar4" parent="players" instance=ExtResource( 5 )] |
|
||||
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -0.260719, 0, 0.416576 ) |
|
@ -1,66 +0,0 @@ |
|||||
[gd_scene load_steps=6 format=2] |
|
||||
|
|
||||
[ext_resource path="res://resources/ui/theme.tres" type="Theme" id=1] |
|
||||
[ext_resource path="res://scripts/menu/ingame.gd" type="Script" id=2] |
|
||||
[ext_resource path="res://assets/icons/open.png" type="Texture" id=3] |
|
||||
[ext_resource path="res://assets/icons/wrench.png" type="Texture" id=4] |
|
||||
[ext_resource path="res://assets/icons/arrowLeft.png" type="Texture" id=5] |
|
||||
|
|
||||
[node name="ingame_menu" type="Control"] |
|
||||
anchor_right = 1.0 |
|
||||
anchor_bottom = 1.0 |
|
||||
margin_left = -0.857361 |
|
||||
margin_right = -0.857361 |
|
||||
theme = ExtResource( 1 ) |
|
||||
script = ExtResource( 2 ) |
|
||||
|
|
||||
[node name="menu" type="Panel" parent="."] |
|
||||
anchor_left = 0.5 |
|
||||
anchor_top = 0.5 |
|
||||
anchor_right = 0.5 |
|
||||
anchor_bottom = 0.5 |
|
||||
margin_left = -155.0 |
|
||||
margin_top = -155.0 |
|
||||
margin_right = 155.0 |
|
||||
margin_bottom = 155.0 |
|
||||
grow_horizontal = 2 |
|
||||
grow_vertical = 2 |
|
||||
|
|
||||
[node name="resume" type="Button" parent="menu"] |
|
||||
anchor_top = 0.5 |
|
||||
anchor_right = 1.0 |
|
||||
anchor_bottom = 0.5 |
|
||||
margin_left = -0.857422 |
|
||||
margin_top = -153.725 |
|
||||
margin_right = -0.857422 |
|
||||
margin_bottom = -97.7245 |
|
||||
text = "Resume" |
|
||||
icon = ExtResource( 3 ) |
|
||||
flat = true |
|
||||
|
|
||||
[node name="settings" type="Button" parent="menu"] |
|
||||
anchor_top = 0.5 |
|
||||
anchor_right = 1.0 |
|
||||
anchor_bottom = 0.5 |
|
||||
margin_left = -0.572113 |
|
||||
margin_top = -25.128 |
|
||||
margin_right = -0.572113 |
|
||||
margin_bottom = 30.872 |
|
||||
text = "Settings" |
|
||||
icon = ExtResource( 4 ) |
|
||||
flat = true |
|
||||
|
|
||||
[node name="end" type="Button" parent="menu"] |
|
||||
anchor_top = 0.5 |
|
||||
anchor_right = 1.0 |
|
||||
anchor_bottom = 0.5 |
|
||||
margin_left = -0.572113 |
|
||||
margin_top = 98.872 |
|
||||
margin_right = -0.572113 |
|
||||
margin_bottom = 154.872 |
|
||||
text = "End Game" |
|
||||
icon = ExtResource( 5 ) |
|
||||
flat = true |
|
||||
[connection signal="pressed" from="menu/resume" to="." method="_on_resume_pressed"] |
|
||||
[connection signal="pressed" from="menu/settings" to="." method="_on_settings_pressed"] |
|
||||
[connection signal="pressed" from="menu/end" to="." method="_on_end_pressed"] |
|
@ -1,82 +0,0 @@ |
|||||
[gd_scene load_steps=9 format=2] |
|
||||
|
|
||||
[ext_resource path="res://resources/ui/theme.tres" type="Theme" id=1] |
|
||||
[ext_resource path="res://scripts/menu/lobby.gd" type="Script" id=2] |
|
||||
[ext_resource path="res://scenes/menu/base_menu.tscn" type="PackedScene" id=3] |
|
||||
[ext_resource path="res://assets/icons/checkmark.png" type="Texture" id=4] |
|
||||
[ext_resource path="res://assets/icons/question.png" type="Texture" id=5] |
|
||||
[ext_resource path="res://scenes/menu/player_settings.tscn" type="PackedScene" id=6] |
|
||||
[ext_resource path="res://assets/fonts/Kenney Future Narrow.ttf" type="DynamicFontData" id=7] |
|
||||
|
|
||||
[sub_resource type="DynamicFont" id=1] |
|
||||
size = 100 |
|
||||
font_data = ExtResource( 7 ) |
|
||||
|
|
||||
[node name="lobby" type="Control"] |
|
||||
anchor_right = 1.0 |
|
||||
anchor_bottom = 1.0 |
|
||||
margin_left = 0.857376 |
|
||||
margin_top = 0.857422 |
|
||||
margin_right = 0.857422 |
|
||||
margin_bottom = 0.857422 |
|
||||
theme = ExtResource( 1 ) |
|
||||
script = ExtResource( 2 ) |
|
||||
|
|
||||
[node name="menu" parent="." instance=ExtResource( 3 )] |
|
||||
|
|
||||
[node name="players" type="ItemList" parent="menu"] |
|
||||
margin_left = 13.0 |
|
||||
margin_top = 18.0 |
|
||||
margin_right = 500.0 |
|
||||
margin_bottom = 413.0 |
|
||||
|
|
||||
[node name="ready_icon" type="Button" parent="menu/players"] |
|
||||
visible = false |
|
||||
margin_right = 62.0 |
|
||||
margin_bottom = 56.0 |
|
||||
icon = ExtResource( 4 ) |
|
||||
|
|
||||
[node name="not_ready_icon" type="Button" parent="menu/players"] |
|
||||
visible = false |
|
||||
margin_right = 62.0 |
|
||||
margin_bottom = 56.0 |
|
||||
icon = ExtResource( 5 ) |
|
||||
|
|
||||
[node name="player_settings" parent="menu" instance=ExtResource( 6 )] |
|
||||
margin_left = 510.586 |
|
||||
margin_top = 21.0499 |
|
||||
margin_right = 875.586 |
|
||||
margin_bottom = 238.05 |
|
||||
|
|
||||
[node name="ready" type="CheckButton" parent="menu"] |
|
||||
anchor_left = 1.0 |
|
||||
anchor_top = 1.0 |
|
||||
anchor_right = 1.0 |
|
||||
anchor_bottom = 1.0 |
|
||||
margin_left = -166.0 |
|
||||
margin_top = -58.0 |
|
||||
text = "Ready" |
|
||||
flat = true |
|
||||
|
|
||||
[node name="countdown" type="Label" parent="."] |
|
||||
visible = false |
|
||||
anchor_left = 0.5 |
|
||||
anchor_top = 0.5 |
|
||||
anchor_right = 0.5 |
|
||||
anchor_bottom = 0.5 |
|
||||
margin_left = -94.0 |
|
||||
margin_top = -56.5 |
|
||||
margin_right = 94.0 |
|
||||
margin_bottom = 56.5 |
|
||||
custom_fonts/font = SubResource( 1 ) |
|
||||
text = "3" |
|
||||
align = 1 |
|
||||
valign = 1 |
|
||||
|
|
||||
[node name="countdown_timer" type="Timer" parent="."] |
|
||||
process_mode = 0 |
|
||||
wait_time = 3.0 |
|
||||
one_shot = true |
|
||||
[connection signal="toggled" from="menu/ready" to="." method="_on_ready_toggled"] |
|
||||
|
|
||||
[editable path="menu"] |
|
@ -1,71 +0,0 @@ |
|||||
[gd_scene load_steps=7 format=2] |
|
||||
|
|
||||
[ext_resource path="res://resources/ui/theme.tres" type="Theme" id=1] |
|
||||
[ext_resource path="res://scripts/menu/local_game.gd" type="Script" id=2] |
|
||||
[ext_resource path="res://resources/ui/font.tres" type="DynamicFont" id=3] |
|
||||
[ext_resource path="res://assets/icons/exitRight.png" type="Texture" id=4] |
|
||||
[ext_resource path="res://assets/icons/return.png" type="Texture" id=5] |
|
||||
[ext_resource path="res://scenes/menu/player_settings.tscn" type="PackedScene" id=6] |
|
||||
|
|
||||
[node name="local_game" type="Control"] |
|
||||
anchor_right = 1.0 |
|
||||
anchor_bottom = 1.0 |
|
||||
margin_left = 0.857376 |
|
||||
margin_top = 0.857422 |
|
||||
margin_right = 0.857422 |
|
||||
margin_bottom = 0.857422 |
|
||||
theme = ExtResource( 1 ) |
|
||||
script = ExtResource( 2 ) |
|
||||
|
|
||||
[node name="menu" type="Panel" parent="."] |
|
||||
anchor_left = 0.5 |
|
||||
anchor_top = 0.5 |
|
||||
anchor_right = 0.5 |
|
||||
anchor_bottom = 0.5 |
|
||||
margin_left = -217.5 |
|
||||
margin_top = -187.5 |
|
||||
margin_right = 217.5 |
|
||||
margin_bottom = 187.5 |
|
||||
grow_horizontal = 2 |
|
||||
grow_vertical = 2 |
|
||||
|
|
||||
[node name="bots" type="CheckButton" parent="menu"] |
|
||||
margin_left = 18.8485 |
|
||||
margin_top = 238.232 |
|
||||
margin_right = 184.849 |
|
||||
margin_bottom = 296.232 |
|
||||
pressed = true |
|
||||
text = "Bots" |
|
||||
flat = true |
|
||||
|
|
||||
[node name="start" type="Button" parent="menu"] |
|
||||
anchor_left = 1.0 |
|
||||
anchor_top = 1.0 |
|
||||
anchor_right = 1.0 |
|
||||
anchor_bottom = 1.0 |
|
||||
margin_left = -143.0 |
|
||||
margin_top = -56.0 |
|
||||
rect_pivot_offset = Vector2( 1.89856, 0.845154 ) |
|
||||
custom_fonts/font = ExtResource( 3 ) |
|
||||
text = "Start" |
|
||||
icon = ExtResource( 4 ) |
|
||||
flat = true |
|
||||
|
|
||||
[node name="back" type="Button" parent="menu"] |
|
||||
anchor_top = 1.0 |
|
||||
anchor_bottom = 1.0 |
|
||||
margin_top = -56.0 |
|
||||
margin_right = 132.0 |
|
||||
rect_pivot_offset = Vector2( 0.606262, -0.447205 ) |
|
||||
custom_fonts/font = ExtResource( 3 ) |
|
||||
text = "Back" |
|
||||
icon = ExtResource( 5 ) |
|
||||
flat = true |
|
||||
|
|
||||
[node name="player_settings" parent="menu" instance=ExtResource( 6 )] |
|
||||
margin_left = 27.4727 |
|
||||
margin_top = 18.9189 |
|
||||
margin_right = 392.473 |
|
||||
margin_bottom = 235.919 |
|
||||
[connection signal="pressed" from="menu/start" to="." method="_on_start_pressed"] |
|
||||
[connection signal="pressed" from="menu/back" to="." method="_on_back_pressed"] |
|
@ -1,125 +0,0 @@ |
|||||
[gd_scene load_steps=10 format=2] |
|
||||
|
|
||||
[ext_resource path="res://resources/ui/theme.tres" type="Theme" id=1] |
|
||||
[ext_resource path="res://scripts/menu/main.gd" type="Script" id=2] |
|
||||
[ext_resource path="res://assets/icons/massiveMultiplayer.png" type="Texture" id=3] |
|
||||
[ext_resource path="res://assets/icons/singleplayer.png" type="Texture" id=4] |
|
||||
[ext_resource path="res://assets/icons/wrench.png" type="Texture" id=5] |
|
||||
[ext_resource path="res://assets/icons/power.png" type="Texture" id=6] |
|
||||
[ext_resource path="res://assets/icons/cpu.png" type="Texture" id=7] |
|
||||
[ext_resource path="res://assets/icons/exitRight.png" type="Texture" id=8] |
|
||||
|
|
||||
[sub_resource type="StyleBoxFlat" id=1] |
|
||||
bg_color = Color( 0.85098, 0.670588, 0.188235, 1 ) |
|
||||
|
|
||||
[node name="main_menu" type="Control"] |
|
||||
anchor_right = 1.0 |
|
||||
anchor_bottom = 1.0 |
|
||||
margin_left = -0.857361 |
|
||||
margin_right = -0.857361 |
|
||||
theme = ExtResource( 1 ) |
|
||||
script = ExtResource( 2 ) |
|
||||
|
|
||||
[node name="menu" type="Panel" parent="."] |
|
||||
anchor_left = 0.5 |
|
||||
anchor_top = 0.5 |
|
||||
anchor_right = 0.5 |
|
||||
anchor_bottom = 0.5 |
|
||||
margin_left = -155.0 |
|
||||
margin_top = -201.5 |
|
||||
margin_right = 155.0 |
|
||||
margin_bottom = 201.5 |
|
||||
grow_horizontal = 2 |
|
||||
grow_vertical = 2 |
|
||||
|
|
||||
[node name="online" type="Button" parent="menu"] |
|
||||
anchor_top = 0.5 |
|
||||
anchor_right = 1.0 |
|
||||
anchor_bottom = 0.5 |
|
||||
margin_left = -0.857422 |
|
||||
margin_top = -194.725 |
|
||||
margin_right = -0.857422 |
|
||||
margin_bottom = -138.725 |
|
||||
text = "Multiplayer" |
|
||||
icon = ExtResource( 3 ) |
|
||||
flat = true |
|
||||
|
|
||||
[node name="practice" type="Button" parent="menu"] |
|
||||
anchor_top = 0.5 |
|
||||
anchor_right = 1.0 |
|
||||
anchor_bottom = 0.5 |
|
||||
margin_top = -132.154 |
|
||||
margin_bottom = -76.154 |
|
||||
text = "Practice" |
|
||||
icon = ExtResource( 4 ) |
|
||||
flat = true |
|
||||
|
|
||||
[node name="settings" type="Button" parent="menu"] |
|
||||
anchor_top = 0.5 |
|
||||
anchor_right = 1.0 |
|
||||
anchor_bottom = 0.5 |
|
||||
margin_left = -0.572113 |
|
||||
margin_top = -66.128 |
|
||||
margin_right = -0.572113 |
|
||||
margin_bottom = -10.128 |
|
||||
text = "Settings" |
|
||||
icon = ExtResource( 5 ) |
|
||||
flat = true |
|
||||
|
|
||||
[node name="quit" type="Button" parent="menu"] |
|
||||
anchor_top = 0.5 |
|
||||
anchor_right = 1.0 |
|
||||
anchor_bottom = 0.5 |
|
||||
margin_left = -0.572113 |
|
||||
margin_top = 132.872 |
|
||||
margin_right = -0.572113 |
|
||||
margin_bottom = 188.872 |
|
||||
text = "Quit" |
|
||||
icon = ExtResource( 6 ) |
|
||||
flat = true |
|
||||
|
|
||||
[node name="debug" type="Panel" parent="menu"] |
|
||||
margin_top = 193.0 |
|
||||
margin_right = 309.0 |
|
||||
margin_bottom = 327.0 |
|
||||
custom_styles/panel = SubResource( 1 ) |
|
||||
|
|
||||
[node name="debug_label" type="Label" parent="menu/debug"] |
|
||||
anchor_right = 1.0 |
|
||||
margin_top = 3.0 |
|
||||
margin_bottom = 60.0 |
|
||||
text = "debug |
|
||||
localhost:8128" |
|
||||
align = 1 |
|
||||
valign = 1 |
|
||||
|
|
||||
[node name="quick_host" type="Button" parent="menu/debug"] |
|
||||
anchor_top = 0.5 |
|
||||
anchor_bottom = 0.5 |
|
||||
margin_left = 16.3244 |
|
||||
margin_top = 1.68341 |
|
||||
margin_right = 145.324 |
|
||||
margin_bottom = 57.6834 |
|
||||
text = "Host" |
|
||||
icon = ExtResource( 7 ) |
|
||||
|
|
||||
[node name="quick_join" type="Button" parent="menu/debug"] |
|
||||
anchor_top = 0.5 |
|
||||
anchor_bottom = 0.5 |
|
||||
margin_left = 161.885 |
|
||||
margin_top = 2.32294 |
|
||||
margin_right = 290.885 |
|
||||
margin_bottom = 58.3229 |
|
||||
text = "Join" |
|
||||
icon = ExtResource( 8 ) |
|
||||
|
|
||||
[node name="error_dialog" type="AcceptDialog" parent="."] |
|
||||
margin_right = 138.0 |
|
||||
margin_bottom = 84.0 |
|
||||
dialog_text = "Server disconnected!" |
|
||||
[connection signal="pressed" from="menu/online" to="." method="_on_online_pressed"] |
|
||||
[connection signal="pressed" from="menu/practice" to="." method="_on_practice_pressed"] |
|
||||
[connection signal="pressed" from="menu/settings" to="." method="_on_settings_pressed"] |
|
||||
[connection signal="pressed" from="menu/quit" to="." method="_on_quit_pressed"] |
|
||||
[connection signal="pressed" from="menu/debug/quick_host" to="." method="_on_quick_host_pressed"] |
|
||||
[connection signal="pressed" from="menu/debug/quick_join" to="." method="_on_quick_join_pressed"] |
|
@ -1,40 +0,0 @@ |
|||||
[gd_scene load_steps=2 format=2] |
|
||||
|
|
||||
[ext_resource path="res://scripts/menu/player_settings.gd" type="Script" id=1] |
|
||||
|
|
||||
[node name="player_settings" type="Control"] |
|
||||
margin_left = 513.0 |
|
||||
margin_top = 23.0 |
|
||||
margin_right = 878.0 |
|
||||
margin_bottom = 240.0 |
|
||||
script = ExtResource( 1 ) |
|
||||
|
|
||||
[node name="name_label" type="Label" parent="."] |
|
||||
anchor_top = 0.5 |
|
||||
anchor_right = 1.0 |
|
||||
anchor_bottom = 0.5 |
|
||||
margin_top = -95.5 |
|
||||
margin_bottom = -68.5 |
|
||||
text = "Name" |
|
||||
|
|
||||
[node name="name" type="LineEdit" parent="."] |
|
||||
anchor_top = 0.5 |
|
||||
anchor_right = 1.0 |
|
||||
anchor_bottom = 0.5 |
|
||||
margin_top = -51.5 |
|
||||
margin_bottom = -14.5 |
|
||||
|
|
||||
[node name="color_label" type="Label" parent="."] |
|
||||
anchor_top = 0.5 |
|
||||
anchor_right = 1.0 |
|
||||
anchor_bottom = 0.5 |
|
||||
margin_top = 1.5 |
|
||||
margin_bottom = 28.5 |
|
||||
text = "Color" |
|
||||
|
|
||||
[node name="color" type="ColorPickerButton" parent="."] |
|
||||
anchor_top = 0.5 |
|
||||
anchor_right = 1.0 |
|
||||
anchor_bottom = 0.5 |
|
||||
margin_top = 46.5 |
|
||||
margin_bottom = 79.5 |
|
@ -1,91 +0,0 @@ |
|||||
[gd_scene load_steps=8 format=2] |
|
||||
|
|
||||
[ext_resource path="res://resources/ui/theme.tres" type="Theme" id=1] |
|
||||
[ext_resource path="res://scripts/menu/server.gd" type="Script" id=2] |
|
||||
[ext_resource path="res://scenes/menu/base_menu.tscn" type="PackedScene" id=3] |
|
||||
[ext_resource path="res://assets/icons/exitRight.png" type="Texture" id=4] |
|
||||
[ext_resource path="res://assets/icons/fistPlus.png" type="Texture" id=5] |
|
||||
[ext_resource path="res://assets/icons/cpu.png" type="Texture" id=6] |
|
||||
[ext_resource path="res://assets/icons/open.png" type="Texture" id=7] |
|
||||
|
|
||||
[node name="server" type="Control"] |
|
||||
anchor_right = 1.0 |
|
||||
anchor_bottom = 1.0 |
|
||||
margin_left = 0.857376 |
|
||||
margin_top = 0.857422 |
|
||||
margin_right = 0.857422 |
|
||||
margin_bottom = 0.857422 |
|
||||
theme = ExtResource( 1 ) |
|
||||
script = ExtResource( 2 ) |
|
||||
|
|
||||
[node name="menu" parent="." instance=ExtResource( 3 )] |
|
||||
|
|
||||
[node name="filter" type="Control" parent="menu"] |
|
||||
editor/display_folded = true |
|
||||
margin_left = 14.0 |
|
||||
margin_top = 16.0 |
|
||||
margin_right = 878.0 |
|
||||
margin_bottom = 45.0 |
|
||||
|
|
||||
[node name="open" type="CheckButton" parent="menu/filter"] |
|
||||
anchor_left = 1.0 |
|
||||
anchor_top = 0.5 |
|
||||
anchor_right = 1.0 |
|
||||
anchor_bottom = 0.5 |
|
||||
margin_left = -317.0 |
|
||||
margin_top = -16.5 |
|
||||
margin_bottom = 23.5 |
|
||||
text = "Open Games only" |
|
||||
|
|
||||
[node name="games" type="ItemList" parent="menu"] |
|
||||
margin_left = 13.0 |
|
||||
margin_top = 60.0 |
|
||||
margin_right = 880.0 |
|
||||
margin_bottom = 414.0 |
|
||||
|
|
||||
[node name="join" type="Button" parent="menu"] |
|
||||
anchor_left = 1.0 |
|
||||
anchor_top = 1.0 |
|
||||
anchor_right = 1.0 |
|
||||
anchor_bottom = 1.0 |
|
||||
margin_left = -120.0 |
|
||||
margin_top = -56.0 |
|
||||
text = "Join" |
|
||||
icon = ExtResource( 4 ) |
|
||||
flat = true |
|
||||
|
|
||||
[node name="create" type="Button" parent="menu"] |
|
||||
anchor_left = 1.0 |
|
||||
anchor_top = 1.0 |
|
||||
anchor_right = 1.0 |
|
||||
anchor_bottom = 1.0 |
|
||||
margin_left = -366.0 |
|
||||
margin_top = -56.0 |
|
||||
margin_right = -126.0 |
|
||||
text = "Create Game" |
|
||||
icon = ExtResource( 5 ) |
|
||||
flat = true |
|
||||
|
|
||||
[node name="direct_host" type="Button" parent="menu"] |
|
||||
margin_left = 10.0 |
|
||||
margin_top = 2.0 |
|
||||
margin_right = 235.0 |
|
||||
margin_bottom = 58.0 |
|
||||
text = "Direct Host" |
|
||||
icon = ExtResource( 6 ) |
|
||||
flat = true |
|
||||
|
|
||||
[node name="direct_join" type="Button" parent="menu"] |
|
||||
margin_left = 230.0 |
|
||||
margin_top = 2.0 |
|
||||
margin_right = 446.0 |
|
||||
margin_bottom = 58.0 |
|
||||
text = "Direct Join" |
|
||||
icon = ExtResource( 7 ) |
|
||||
flat = true |
|
||||
|
|
||||
[node name="error_dialog" type="AcceptDialog" parent="."] |
|
||||
margin_right = 138.0 |
|
||||
margin_bottom = 84.0 |
|
||||
[connection signal="pressed" from="menu/direct_host" to="." method="_on_direct_host_pressed"] |
|
||||
[connection signal="pressed" from="menu/direct_join" to="." method="_on_direct_join_pressed"] |
|
@ -1,72 +0,0 @@ |
|||||
[gd_scene load_steps=6 format=2] |
|
||||
|
|
||||
[ext_resource path="res://resources/ui/theme.tres" type="Theme" id=1] |
|
||||
[ext_resource path="res://scripts/menu/settings.gd" type="Script" id=2] |
|
||||
[ext_resource path="res://scenes/menu/base_menu.tscn" type="PackedScene" id=3] |
|
||||
[ext_resource path="res://scenes/menu/player_settings.tscn" type="PackedScene" id=4] |
|
||||
[ext_resource path="res://assets/icons/save.png" type="Texture" id=5] |
|
||||
|
|
||||
[node name="settings" type="Control"] |
|
||||
anchor_right = 1.0 |
|
||||
anchor_bottom = 1.0 |
|
||||
margin_left = 1.45612 |
|
||||
margin_top = 1.45612 |
|
||||
margin_right = 1.45605 |
|
||||
margin_bottom = 1.45612 |
|
||||
theme = ExtResource( 1 ) |
|
||||
script = ExtResource( 2 ) |
|
||||
|
|
||||
[node name="menu" parent="." instance=ExtResource( 3 )] |
|
||||
|
|
||||
[node name="tabs" type="TabContainer" parent="menu"] |
|
||||
anchor_left = 0.5 |
|
||||
anchor_top = 0.5 |
|
||||
anchor_right = 0.5 |
|
||||
anchor_bottom = 0.5 |
|
||||
margin_left = -438.5 |
|
||||
margin_top = -217.5 |
|
||||
margin_right = 440.5 |
|
||||
margin_bottom = 177.5 |
|
||||
tab_align = 0 |
|
||||
|
|
||||
[node name="Game" type="Tabs" parent="menu/tabs"] |
|
||||
anchor_right = 1.0 |
|
||||
anchor_bottom = 1.0 |
|
||||
margin_left = 4.0 |
|
||||
margin_top = 45.0 |
|
||||
margin_right = -4.0 |
|
||||
margin_bottom = -4.0 |
|
||||
|
|
||||
[node name="player_settings" parent="menu/tabs/Game" instance=ExtResource( 4 )] |
|
||||
margin_left = 15.4583 |
|
||||
margin_top = 10.7114 |
|
||||
margin_right = 380.458 |
|
||||
margin_bottom = 227.711 |
|
||||
|
|
||||
[node name="bots" type="CheckButton" parent="menu/tabs/Game"] |
|
||||
margin_left = 8.38535 |
|
||||
margin_top = 226.162 |
|
||||
margin_right = 153.385 |
|
||||
margin_bottom = 266.162 |
|
||||
text = "Bots" |
|
||||
|
|
||||
[node name="Controls" type="Tabs" parent="menu/tabs"] |
|
||||
visible = false |
|
||||
anchor_right = 1.0 |
|
||||
anchor_bottom = 1.0 |
|
||||
margin_left = 4.0 |
|
||||
margin_top = 45.0 |
|
||||
margin_right = -4.0 |
|
||||
margin_bottom = -4.0 |
|
||||
|
|
||||
[node name="save" type="Button" parent="menu"] |
|
||||
anchor_left = 1.0 |
|
||||
anchor_top = 1.0 |
|
||||
anchor_right = 1.0 |
|
||||
anchor_bottom = 1.0 |
|
||||
margin_left = -147.0 |
|
||||
margin_top = -56.0 |
|
||||
text = "Save" |
|
||||
icon = ExtResource( 5 ) |
|
||||
flat = true |
|
||||
[connection signal="pressed" from="menu/save" to="." method="_on_save_pressed"] |
|
@ -0,0 +1,69 @@ |
|||||
|
[gd_scene load_steps=6 format=2] |
||||
|
|
||||
|
[ext_resource path="res://resources/ui/theme.tres" type="Theme" id=1] |
||||
|
[ext_resource path="res://scripts/menus/ingame.gd" type="Script" id=2] |
||||
|
[ext_resource path="res://assets/icons/open.png" type="Texture" id=3] |
||||
|
[ext_resource path="res://assets/icons/wrench.png" type="Texture" id=4] |
||||
|
[ext_resource path="res://assets/icons/arrowLeft.png" type="Texture" id=5] |
||||
|
|
||||
|
[node name="ingame_menu" type="Control"] |
||||
|
anchor_right = 1.0 |
||||
|
anchor_bottom = 1.0 |
||||
|
margin_left = -0.857361 |
||||
|
margin_right = -0.857361 |
||||
|
theme = ExtResource( 1 ) |
||||
|
script = ExtResource( 2 ) |
||||
|
|
||||
|
[node name="menu" type="Panel" parent="."] |
||||
|
anchor_left = 0.5 |
||||
|
anchor_top = 0.5 |
||||
|
anchor_right = 0.5 |
||||
|
anchor_bottom = 0.5 |
||||
|
margin_left = -155.0 |
||||
|
margin_top = -100.5 |
||||
|
margin_right = 155.0 |
||||
|
margin_bottom = 100.5 |
||||
|
grow_horizontal = 2 |
||||
|
grow_vertical = 2 |
||||
|
|
||||
|
[node name="GridContainer" type="GridContainer" parent="menu"] |
||||
|
anchor_right = 1.0 |
||||
|
anchor_bottom = 1.0 |
||||
|
|
||||
|
[node name="resume" type="Button" parent="menu/GridContainer"] |
||||
|
margin_right = 310.0 |
||||
|
margin_bottom = 64.0 |
||||
|
focus_neighbour_top = NodePath("../end") |
||||
|
focus_neighbour_bottom = NodePath("../settings") |
||||
|
size_flags_horizontal = 3 |
||||
|
size_flags_vertical = 3 |
||||
|
text = "RESUME" |
||||
|
icon = ExtResource( 3 ) |
||||
|
flat = true |
||||
|
|
||||
|
[node name="settings" type="Button" parent="menu/GridContainer"] |
||||
|
margin_top = 68.0 |
||||
|
margin_right = 310.0 |
||||
|
margin_bottom = 132.0 |
||||
|
focus_neighbour_top = NodePath("../resume") |
||||
|
focus_neighbour_bottom = NodePath("../end") |
||||
|
size_flags_horizontal = 3 |
||||
|
size_flags_vertical = 3 |
||||
|
text = "SETTINGS" |
||||
|
icon = ExtResource( 4 ) |
||||
|
flat = true |
||||
|
|
||||
|
[node name="end" type="Button" parent="menu/GridContainer"] |
||||
|
margin_top = 136.0 |
||||
|
margin_right = 310.0 |
||||
|
margin_bottom = 200.0 |
||||
|
focus_neighbour_top = NodePath("../settings") |
||||
|
focus_neighbour_bottom = NodePath(".") |
||||
|
size_flags_horizontal = 3 |
||||
|
size_flags_vertical = 3 |
||||
|
text = "END_GAME" |
||||
|
icon = ExtResource( 5 ) |
||||
|
flat = true |
||||
|
[connection signal="pressed" from="menu/GridContainer/resume" to="." method="_on_resume_pressed"] |
||||
|
[connection signal="pressed" from="menu/GridContainer/settings" to="." method="_on_settings_pressed"] |
||||
|
[connection signal="pressed" from="menu/GridContainer/end" to="." method="_on_end_pressed"] |
@ -0,0 +1,147 @@ |
|||||
|
[gd_scene load_steps=9 format=2] |
||||
|
|
||||
|
[ext_resource path="res://resources/ui/theme.tres" type="Theme" id=1] |
||||
|
[ext_resource path="res://scripts/menus/lobby.gd" type="Script" id=2] |
||||
|
[ext_resource path="res://scenes/menus/BaseMenu.tscn" type="PackedScene" id=3] |
||||
|
[ext_resource path="res://assets/icons/checkmark.png" type="Texture" id=4] |
||||
|
[ext_resource path="res://assets/icons/question.png" type="Texture" id=5] |
||||
|
[ext_resource path="res://scenes/menus/SettingsPlayerMenu.tscn" type="PackedScene" id=6] |
||||
|
[ext_resource path="res://assets/fonts/Kenney Future Narrow.ttf" type="DynamicFontData" id=7] |
||||
|
|
||||
|
[sub_resource type="DynamicFont" id=1] |
||||
|
size = 100 |
||||
|
font_data = ExtResource( 7 ) |
||||
|
|
||||
|
[node name="lobby_menu" type="Control"] |
||||
|
anchor_right = 1.0 |
||||
|
anchor_bottom = 1.0 |
||||
|
margin_left = 0.857376 |
||||
|
margin_top = 0.857422 |
||||
|
margin_right = 0.857422 |
||||
|
margin_bottom = 0.857422 |
||||
|
theme = ExtResource( 1 ) |
||||
|
script = ExtResource( 2 ) |
||||
|
|
||||
|
[node name="menu" parent="." instance=ExtResource( 3 )] |
||||
|
|
||||
|
[node name="back" parent="menu" index="0"] |
||||
|
focus_neighbour_right = NodePath("../ready") |
||||
|
|
||||
|
[node name="top_bar" type="GridContainer" parent="menu"] |
||||
|
margin_left = 14.0 |
||||
|
margin_top = 12.0 |
||||
|
margin_right = 940.0 |
||||
|
margin_bottom = 52.0 |
||||
|
columns = 2 |
||||
|
|
||||
|
[node name="server_name" type="Label" parent="menu/top_bar"] |
||||
|
margin_right = 779.0 |
||||
|
margin_bottom = 40.0 |
||||
|
mouse_filter = 1 |
||||
|
size_flags_horizontal = 3 |
||||
|
size_flags_vertical = 1 |
||||
|
text = "Server" |
||||
|
valign = 1 |
||||
|
|
||||
|
[node name="server_bots" type="CheckButton" parent="menu/top_bar"] |
||||
|
margin_left = 783.0 |
||||
|
margin_right = 926.0 |
||||
|
margin_bottom = 40.0 |
||||
|
disabled = true |
||||
|
text = "Bots" |
||||
|
align = 2 |
||||
|
|
||||
|
[node name="mid" type="GridContainer" parent="menu"] |
||||
|
margin_left = 12.0 |
||||
|
margin_top = 57.0 |
||||
|
margin_right = 936.0 |
||||
|
margin_bottom = 397.0 |
||||
|
columns = 3 |
||||
|
|
||||
|
[node name="players" type="ItemList" parent="menu/mid"] |
||||
|
margin_right = 456.0 |
||||
|
margin_bottom = 340.0 |
||||
|
size_flags_horizontal = 3 |
||||
|
|
||||
|
[node name="ready_icon" type="Button" parent="menu/mid/players"] |
||||
|
visible = false |
||||
|
margin_right = 62.0 |
||||
|
margin_bottom = 56.0 |
||||
|
icon = ExtResource( 4 ) |
||||
|
|
||||
|
[node name="not_ready_icon" type="Button" parent="menu/mid/players"] |
||||
|
visible = false |
||||
|
margin_right = 62.0 |
||||
|
margin_bottom = 56.0 |
||||
|
icon = ExtResource( 5 ) |
||||
|
|
||||
|
[node name="VSeparator" type="VSeparator" parent="menu/mid"] |
||||
|
margin_left = 460.0 |
||||
|
margin_right = 464.0 |
||||
|
margin_bottom = 340.0 |
||||
|
|
||||
|
[node name="player_settings" parent="menu/mid" instance=ExtResource( 6 )] |
||||
|
margin_left = 468.0 |
||||
|
margin_top = 0.0 |
||||
|
margin_right = 924.0 |
||||
|
margin_bottom = 340.0 |
||||
|
|
||||
|
[node name="name_label" parent="menu/mid/player_settings/GridContainer" index="0"] |
||||
|
margin_right = 456.0 |
||||
|
margin_bottom = 27.0 |
||||
|
|
||||
|
[node name="name" parent="menu/mid/player_settings/GridContainer" index="1"] |
||||
|
margin_top = 31.0 |
||||
|
margin_right = 456.0 |
||||
|
margin_bottom = 68.0 |
||||
|
focus_neighbour_bottom = NodePath("../color") |
||||
|
|
||||
|
[node name="color_label" parent="menu/mid/player_settings/GridContainer" index="2"] |
||||
|
margin_top = 72.0 |
||||
|
margin_right = 456.0 |
||||
|
margin_bottom = 99.0 |
||||
|
|
||||
|
[node name="color" parent="menu/mid/player_settings/GridContainer" index="3"] |
||||
|
margin_top = 103.0 |
||||
|
margin_right = 456.0 |
||||
|
margin_bottom = 136.0 |
||||
|
focus_neighbour_top = NodePath("../name") |
||||
|
focus_neighbour_bottom = NodePath("../../../../ready") |
||||
|
|
||||
|
[node name="ready" type="CheckButton" parent="menu"] |
||||
|
anchor_left = 1.0 |
||||
|
anchor_top = 1.0 |
||||
|
anchor_right = 1.0 |
||||
|
anchor_bottom = 1.0 |
||||
|
margin_left = -166.0 |
||||
|
margin_top = -58.0 |
||||
|
grow_vertical = 0 |
||||
|
focus_neighbour_left = NodePath("../back") |
||||
|
focus_neighbour_top = NodePath("../mid/player_settings/GridContainer/color") |
||||
|
text = "READY" |
||||
|
flat = true |
||||
|
|
||||
|
[node name="countdown" type="Label" parent="."] |
||||
|
visible = false |
||||
|
anchor_left = 0.5 |
||||
|
anchor_top = 0.5 |
||||
|
anchor_right = 0.5 |
||||
|
anchor_bottom = 0.5 |
||||
|
margin_left = -94.0 |
||||
|
margin_top = -56.5 |
||||
|
margin_right = 94.0 |
||||
|
margin_bottom = 56.5 |
||||
|
custom_fonts/font = SubResource( 1 ) |
||||
|
text = "3" |
||||
|
align = 1 |
||||
|
valign = 1 |
||||
|
|
||||
|
[node name="countdown_timer" type="Timer" parent="."] |
||||
|
process_mode = 0 |
||||
|
wait_time = 3.0 |
||||
|
one_shot = true |
||||
|
[connection signal="toggled" from="menu/ready" to="." method="_on_ready_toggled"] |
||||
|
|
||||
|
[editable path="menu"] |
||||
|
|
||||
|
[editable path="menu/mid/player_settings"] |
@ -0,0 +1,108 @@ |
|||||
|
[gd_scene load_steps=7 format=2] |
||||
|
|
||||
|
[ext_resource path="res://resources/ui/theme.tres" type="Theme" id=1] |
||||
|
[ext_resource path="res://scripts/menus/local_game.gd" type="Script" id=2] |
||||
|
[ext_resource path="res://scenes/menus/SettingsPlayerMenu.tscn" type="PackedScene" id=3] |
||||
|
[ext_resource path="res://resources/ui/font.tres" type="DynamicFont" id=4] |
||||
|
[ext_resource path="res://assets/icons/exitRight.png" type="Texture" id=5] |
||||
|
[ext_resource path="res://assets/icons/return.png" type="Texture" id=6] |
||||
|
|
||||
|
[node name="local_game_menu" type="Control"] |
||||
|
anchor_right = 1.0 |
||||
|
anchor_bottom = 1.0 |
||||
|
margin_left = 0.857376 |
||||
|
margin_top = 0.857422 |
||||
|
margin_right = 0.857422 |
||||
|
margin_bottom = 0.857422 |
||||
|
theme = ExtResource( 1 ) |
||||
|
script = ExtResource( 2 ) |
||||
|
|
||||
|
[node name="menu" type="Panel" parent="."] |
||||
|
anchor_left = 0.5 |
||||
|
anchor_top = 0.5 |
||||
|
anchor_right = 0.5 |
||||
|
anchor_bottom = 0.5 |
||||
|
margin_left = -217.5 |
||||
|
margin_top = -130.5 |
||||
|
margin_right = 217.5 |
||||
|
margin_bottom = 130.5 |
||||
|
grow_horizontal = 2 |
||||
|
grow_vertical = 2 |
||||
|
|
||||
|
[node name="GridContainer" type="GridContainer" parent="menu"] |
||||
|
margin_left = 19.0 |
||||
|
margin_top = 21.0 |
||||
|
margin_right = 418.0 |
||||
|
margin_bottom = 197.0 |
||||
|
|
||||
|
[node name="player_settings" parent="menu/GridContainer" instance=ExtResource( 3 )] |
||||
|
margin_left = 0.0 |
||||
|
margin_top = 0.0 |
||||
|
margin_right = 399.0 |
||||
|
margin_bottom = 132.0 |
||||
|
|
||||
|
[node name="name_label" parent="menu/GridContainer/player_settings/GridContainer" index="0"] |
||||
|
margin_right = 399.0 |
||||
|
margin_bottom = 27.0 |
||||
|
|
||||
|
[node name="name" parent="menu/GridContainer/player_settings/GridContainer" index="1"] |
||||
|
margin_top = 31.0 |
||||
|
margin_right = 399.0 |
||||
|
margin_bottom = 68.0 |
||||
|
focus_neighbour_bottom = NodePath("../color") |
||||
|
|
||||
|
[node name="color_label" parent="menu/GridContainer/player_settings/GridContainer" index="2"] |
||||
|
margin_top = 72.0 |
||||
|
margin_right = 399.0 |
||||
|
margin_bottom = 99.0 |
||||
|
|
||||
|
[node name="color" parent="menu/GridContainer/player_settings/GridContainer" index="3"] |
||||
|
margin_top = 103.0 |
||||
|
margin_right = 399.0 |
||||
|
margin_bottom = 136.0 |
||||
|
focus_neighbour_top = NodePath("../name") |
||||
|
focus_neighbour_bottom = NodePath("../../../bots") |
||||
|
|
||||
|
[node name="bots" type="CheckButton" parent="menu/GridContainer"] |
||||
|
margin_top = 136.0 |
||||
|
margin_right = 143.0 |
||||
|
margin_bottom = 176.0 |
||||
|
focus_neighbour_top = NodePath("../player_settings/GridContainer/color") |
||||
|
focus_neighbour_bottom = NodePath("../../start") |
||||
|
size_flags_horizontal = 0 |
||||
|
pressed = true |
||||
|
text = "BOTS" |
||||
|
flat = true |
||||
|
|
||||
|
[node name="start" type="Button" parent="menu"] |
||||
|
anchor_left = 1.0 |
||||
|
anchor_top = 1.0 |
||||
|
anchor_right = 1.0 |
||||
|
anchor_bottom = 1.0 |
||||
|
margin_left = -234.0 |
||||
|
margin_top = -56.0 |
||||
|
grow_horizontal = 0 |
||||
|
rect_pivot_offset = Vector2( 1.89856, 0.845154 ) |
||||
|
focus_neighbour_left = NodePath("../back") |
||||
|
focus_neighbour_top = NodePath("../GridContainer/bots") |
||||
|
custom_fonts/font = ExtResource( 4 ) |
||||
|
text = "START_GAME" |
||||
|
icon = ExtResource( 5 ) |
||||
|
flat = true |
||||
|
|
||||
|
[node name="back" type="Button" parent="menu"] |
||||
|
anchor_top = 1.0 |
||||
|
anchor_bottom = 1.0 |
||||
|
margin_top = -56.0 |
||||
|
margin_right = 132.0 |
||||
|
rect_pivot_offset = Vector2( 0.606262, -0.447205 ) |
||||
|
focus_neighbour_top = NodePath("../GridContainer/bots") |
||||
|
focus_neighbour_right = NodePath("../start") |
||||
|
custom_fonts/font = ExtResource( 4 ) |
||||
|
text = "BACK" |
||||
|
icon = ExtResource( 6 ) |
||||
|
flat = true |
||||
|
[connection signal="pressed" from="menu/start" to="." method="_on_start_pressed"] |
||||
|
[connection signal="pressed" from="menu/back" to="." method="_on_back_pressed"] |
||||
|
|
||||
|
[editable path="menu/GridContainer/player_settings"] |
@ -0,0 +1,90 @@ |
|||||
|
[gd_scene load_steps=7 format=2] |
||||
|
|
||||
|
[ext_resource path="res://resources/ui/theme.tres" type="Theme" id=1] |
||||
|
[ext_resource path="res://scripts/menus/main.gd" type="Script" id=2] |
||||
|
[ext_resource path="res://assets/icons/massiveMultiplayer.png" type="Texture" id=3] |
||||
|
[ext_resource path="res://assets/icons/singleplayer.png" type="Texture" id=4] |
||||
|
[ext_resource path="res://assets/icons/wrench.png" type="Texture" id=5] |
||||
|
[ext_resource path="res://assets/icons/power.png" type="Texture" id=6] |
||||
|
|
||||
|
[node name="main_menu" type="Control"] |
||||
|
anchor_right = 1.0 |
||||
|
anchor_bottom = 1.0 |
||||
|
margin_left = -0.857361 |
||||
|
margin_right = -0.857361 |
||||
|
theme = ExtResource( 1 ) |
||||
|
script = ExtResource( 2 ) |
||||
|
|
||||
|
[node name="menu" type="Panel" parent="."] |
||||
|
anchor_left = 0.5 |
||||
|
anchor_top = 0.5 |
||||
|
anchor_right = 0.5 |
||||
|
anchor_bottom = 0.5 |
||||
|
margin_left = -155.0 |
||||
|
margin_top = -132.5 |
||||
|
margin_right = 155.0 |
||||
|
margin_bottom = 132.5 |
||||
|
grow_horizontal = 2 |
||||
|
grow_vertical = 2 |
||||
|
|
||||
|
[node name="GridContainer" type="GridContainer" parent="menu"] |
||||
|
anchor_right = 1.0 |
||||
|
anchor_bottom = 1.0 |
||||
|
|
||||
|
[node name="multiplayer" type="Button" parent="menu/GridContainer"] |
||||
|
margin_right = 310.0 |
||||
|
margin_bottom = 63.0 |
||||
|
focus_neighbour_top = NodePath("../quit") |
||||
|
focus_neighbour_bottom = NodePath("../practice") |
||||
|
size_flags_horizontal = 3 |
||||
|
size_flags_vertical = 3 |
||||
|
text = "MULTIPLAYER" |
||||
|
icon = ExtResource( 3 ) |
||||
|
flat = true |
||||
|
|
||||
|
[node name="practice" type="Button" parent="menu/GridContainer"] |
||||
|
margin_top = 67.0 |
||||
|
margin_right = 310.0 |
||||
|
margin_bottom = 130.0 |
||||
|
focus_neighbour_top = NodePath("../multiplayer") |
||||
|
focus_neighbour_bottom = NodePath("../settings") |
||||
|
size_flags_horizontal = 3 |
||||
|
size_flags_vertical = 3 |
||||
|
text = "PRACTISE" |
||||
|
icon = ExtResource( 4 ) |
||||
|
flat = true |
||||
|
|
||||
|
[node name="settings" type="Button" parent="menu/GridContainer"] |
||||
|
margin_top = 134.0 |
||||
|
margin_right = 310.0 |
||||
|
margin_bottom = 197.0 |
||||
|
focus_neighbour_top = NodePath("../practice") |
||||
|
focus_neighbour_bottom = NodePath("../quit") |
||||
|
size_flags_horizontal = 3 |
||||
|
size_flags_vertical = 3 |
||||
|
text = "SETTINGS" |
||||
|
icon = ExtResource( 5 ) |
||||
|
flat = true |
||||
|
|
||||
|
[node name="quit" type="Button" parent="menu/GridContainer"] |
||||
|
margin_top = 201.0 |
||||
|
margin_right = 310.0 |
||||
|
margin_bottom = 264.0 |
||||
|
focus_neighbour_top = NodePath("../settings") |
||||
|
focus_neighbour_bottom = NodePath("../multiplayer") |
||||
|
size_flags_horizontal = 3 |
||||
|
size_flags_vertical = 3 |
||||
|
text = "QUIT" |
||||
|
icon = ExtResource( 6 ) |
||||
|
flat = true |
||||
|
|
||||
|
[node name="error_dialog" type="AcceptDialog" parent="."] |
||||
|
margin_right = 138.0 |
||||
|
margin_bottom = 84.0 |
||||
|
window_title = "ALERT" |
||||
|
dialog_text = "Server disconnected!" |
||||
|
[connection signal="pressed" from="menu/GridContainer/multiplayer" to="." method="_on_online_pressed"] |
||||
|
[connection signal="pressed" from="menu/GridContainer/multiplayer" to="." method="_on_multiplayer_pressed"] |
||||
|
[connection signal="pressed" from="menu/GridContainer/practice" to="." method="_on_practice_pressed"] |
||||
|
[connection signal="pressed" from="menu/GridContainer/settings" to="." method="_on_settings_pressed"] |
||||
|
[connection signal="pressed" from="menu/GridContainer/quit" to="." method="_on_quit_pressed"] |
@ -0,0 +1,159 @@ |
|||||
|
[gd_scene load_steps=11 format=2] |
||||
|
|
||||
|
[ext_resource path="res://resources/ui/theme.tres" type="Theme" id=1] |
||||
|
[ext_resource path="res://scripts/menus/server.gd" type="Script" id=2] |
||||
|
[ext_resource path="res://scenes/menus/BaseMenu.tscn" type="PackedScene" id=3] |
||||
|
[ext_resource path="res://assets/icons/cpu.png" type="Texture" id=4] |
||||
|
[ext_resource path="res://assets/icons/exitRight.png" type="Texture" id=5] |
||||
|
[ext_resource path="res://assets/icons/car.png" type="Texture" id=6] |
||||
|
[ext_resource path="res://assets/icons/trophy.png" type="Texture" id=7] |
||||
|
[ext_resource path="res://assets/icons/locked.png" type="Texture" id=8] |
||||
|
[ext_resource path="res://assets/icons/massiveMultiplayer.png" type="Texture" id=9] |
||||
|
[ext_resource path="res://assets/icons/fistPlus.png" type="Texture" id=10] |
||||
|
|
||||
|
[node name="multiplayer_menu" type="Control"] |
||||
|
anchor_right = 1.0 |
||||
|
anchor_bottom = 1.0 |
||||
|
margin_left = -0.142624 |
||||
|
margin_top = 2.85742 |
||||
|
margin_right = -0.142578 |
||||
|
margin_bottom = 2.85742 |
||||
|
theme = ExtResource( 1 ) |
||||
|
script = ExtResource( 2 ) |
||||
|
|
||||
|
[node name="menu" parent="." instance=ExtResource( 3 )] |
||||
|
|
||||
|
[node name="back" parent="menu" index="0"] |
||||
|
focus_neighbour_top = NodePath("../games") |
||||
|
focus_neighbour_right = NodePath("../bottom_bar/refresh") |
||||
|
|
||||
|
[node name="top_bar" type="GridContainer" parent="menu"] |
||||
|
anchor_right = 1.0 |
||||
|
margin_bottom = 56.0 |
||||
|
columns = 3 |
||||
|
|
||||
|
[node name="direct_host" type="Button" parent="menu/top_bar"] |
||||
|
margin_right = 239.0 |
||||
|
margin_bottom = 56.0 |
||||
|
focus_neighbour_right = NodePath("../direct_join") |
||||
|
focus_neighbour_bottom = NodePath("../../games") |
||||
|
text = "DIRECT_HOST" |
||||
|
icon = ExtResource( 4 ) |
||||
|
flat = true |
||||
|
|
||||
|
[node name="direct_join" type="Button" parent="menu/top_bar"] |
||||
|
margin_left = 243.0 |
||||
|
margin_right = 473.0 |
||||
|
margin_bottom = 56.0 |
||||
|
focus_neighbour_left = NodePath("../direct_host") |
||||
|
focus_neighbour_right = NodePath("../open") |
||||
|
focus_neighbour_bottom = NodePath("../../games") |
||||
|
text = "DIRECT_JOIN" |
||||
|
icon = ExtResource( 5 ) |
||||
|
flat = true |
||||
|
|
||||
|
[node name="open" type="CheckButton" parent="menu/top_bar"] |
||||
|
margin_left = 477.0 |
||||
|
margin_right = 945.0 |
||||
|
margin_bottom = 56.0 |
||||
|
focus_neighbour_left = NodePath("../direct_join") |
||||
|
focus_neighbour_bottom = NodePath("../../games") |
||||
|
size_flags_horizontal = 3 |
||||
|
disabled = true |
||||
|
pressed = true |
||||
|
text = "OPEN_GAMES_ONLY" |
||||
|
align = 2 |
||||
|
|
||||
|
[node name="games" type="ItemList" parent="menu"] |
||||
|
margin_left = 13.0 |
||||
|
margin_top = 60.0 |
||||
|
margin_right = 931.0 |
||||
|
margin_bottom = 414.0 |
||||
|
focus_neighbour_top = NodePath("../top_bar/open") |
||||
|
focus_neighbour_bottom = NodePath("../bottom_bar/join") |
||||
|
|
||||
|
[node name="open_icon" type="Button" parent="menu/games"] |
||||
|
visible = false |
||||
|
margin_right = 12.0 |
||||
|
margin_bottom = 33.0 |
||||
|
icon = ExtResource( 6 ) |
||||
|
|
||||
|
[node name="running_icon" type="Button" parent="menu/games"] |
||||
|
visible = false |
||||
|
margin_right = 12.0 |
||||
|
margin_bottom = 33.0 |
||||
|
icon = ExtResource( 7 ) |
||||
|
|
||||
|
[node name="private_icon" type="Button" parent="menu/games"] |
||||
|
visible = false |
||||
|
margin_right = 12.0 |
||||
|
margin_bottom = 33.0 |
||||
|
icon = ExtResource( 8 ) |
||||
|
|
||||
|
[node name="bottom_bar" type="GridContainer" parent="menu"] |
||||
|
anchor_top = 1.0 |
||||
|
anchor_right = 1.0 |
||||
|
anchor_bottom = 1.0 |
||||
|
margin_left = 380.0 |
||||
|
margin_top = -56.0 |
||||
|
grow_horizontal = 0 |
||||
|
columns = 3 |
||||
|
|
||||
|
[node name="refresh" type="Button" parent="menu/bottom_bar"] |
||||
|
margin_right = 183.0 |
||||
|
margin_bottom = 56.0 |
||||
|
grow_horizontal = 0 |
||||
|
focus_neighbour_left = NodePath("../../back") |
||||
|
focus_neighbour_top = NodePath("../../games") |
||||
|
focus_neighbour_right = NodePath("../create") |
||||
|
text = "REFRESH" |
||||
|
icon = ExtResource( 9 ) |
||||
|
flat = true |
||||
|
align = 0 |
||||
|
|
||||
|
[node name="create" type="Button" parent="menu/bottom_bar"] |
||||
|
margin_left = 187.0 |
||||
|
margin_right = 441.0 |
||||
|
margin_bottom = 56.0 |
||||
|
focus_neighbour_left = NodePath("../refresh") |
||||
|
focus_neighbour_top = NodePath("../../games") |
||||
|
focus_neighbour_right = NodePath("../join") |
||||
|
disabled = true |
||||
|
text = "CREATE_GAME" |
||||
|
icon = ExtResource( 10 ) |
||||
|
flat = true |
||||
|
align = 2 |
||||
|
|
||||
|
[node name="join" type="Button" parent="menu/bottom_bar"] |
||||
|
margin_left = 445.0 |
||||
|
margin_right = 565.0 |
||||
|
margin_bottom = 56.0 |
||||
|
focus_neighbour_left = NodePath("../create") |
||||
|
focus_neighbour_top = NodePath("../../games") |
||||
|
disabled = true |
||||
|
text = "JOIN" |
||||
|
icon = ExtResource( 5 ) |
||||
|
flat = true |
||||
|
align = 2 |
||||
|
|
||||
|
[node name="error_dialog" type="AcceptDialog" parent="."] |
||||
|
margin_right = 138.0 |
||||
|
margin_bottom = 84.0 |
||||
|
window_title = "ALERT" |
||||
|
|
||||
|
[node name="refresh_timer" type="Timer" parent="."] |
||||
|
wait_time = 5.0 |
||||
|
autostart = true |
||||
|
[connection signal="draw" from="." to="." method="_on_multiplayer_menu_draw"] |
||||
|
[connection signal="hide" from="." to="." method="_on_multiplayer_menu_hide"] |
||||
|
[connection signal="pressed" from="menu/top_bar/direct_host" to="." method="_on_direct_host_pressed"] |
||||
|
[connection signal="pressed" from="menu/top_bar/direct_join" to="." method="_on_direct_join_pressed"] |
||||
|
[connection signal="toggled" from="menu/top_bar/open" to="." method="_on_open_toggled"] |
||||
|
[connection signal="item_selected" from="menu/games" to="." method="_on_games_item_selected"] |
||||
|
[connection signal="nothing_selected" from="menu/games" to="." method="_on_games_nothing_selected"] |
||||
|
[connection signal="pressed" from="menu/bottom_bar/refresh" to="." method="_on_refresh_pressed"] |
||||
|
[connection signal="pressed" from="menu/bottom_bar/create" to="." method="_on_create_pressed"] |
||||
|
[connection signal="pressed" from="menu/bottom_bar/join" to="." method="_on_join_pressed"] |
||||
|
[connection signal="timeout" from="refresh_timer" to="." method="_on_refresh_timer_timeout"] |
||||
|
|
||||
|
[editable path="menu"] |
@ -0,0 +1,99 @@ |
|||||
|
[gd_scene load_steps=6 format=2] |
||||
|
|
||||
|
[ext_resource path="res://resources/ui/theme.tres" type="Theme" id=1] |
||||
|
[ext_resource path="res://scripts/menus/server_create.gd" type="Script" id=2] |
||||
|
[ext_resource path="res://resources/ui/font.tres" type="DynamicFont" id=3] |
||||
|
[ext_resource path="res://assets/icons/fistPlus.png" type="Texture" id=4] |
||||
|
[ext_resource path="res://assets/icons/return.png" type="Texture" id=5] |
||||
|
|
||||
|
[node name="server_create_menu" type="Control"] |
||||
|
anchor_left = 0.5 |
||||
|
anchor_top = 0.5 |
||||
|
anchor_right = 0.5 |
||||
|
anchor_bottom = 0.5 |
||||
|
margin_left = -512.0 |
||||
|
margin_top = -300.0 |
||||
|
margin_right = 512.0 |
||||
|
margin_bottom = 300.0 |
||||
|
theme = ExtResource( 1 ) |
||||
|
script = ExtResource( 2 ) |
||||
|
|
||||
|
[node name="menu" type="Panel" parent="."] |
||||
|
anchor_left = 0.5 |
||||
|
anchor_top = 0.5 |
||||
|
anchor_right = 0.5 |
||||
|
anchor_bottom = 0.5 |
||||
|
margin_left = -217.5 |
||||
|
margin_top = -68.5 |
||||
|
margin_right = 217.5 |
||||
|
margin_bottom = 68.5 |
||||
|
grow_horizontal = 2 |
||||
|
grow_vertical = 2 |
||||
|
|
||||
|
[node name="GridContainer" type="GridContainer" parent="menu"] |
||||
|
margin_left = 12.0 |
||||
|
margin_top = 11.0 |
||||
|
margin_right = 427.0 |
||||
|
margin_bottom = 92.0 |
||||
|
columns = 2 |
||||
|
|
||||
|
[node name="name_label" type="Label" parent="menu/GridContainer"] |
||||
|
margin_top = 5.0 |
||||
|
margin_right = 162.0 |
||||
|
margin_bottom = 32.0 |
||||
|
text = "GAME_NAME" |
||||
|
|
||||
|
[node name="name" type="LineEdit" parent="menu/GridContainer"] |
||||
|
margin_left = 166.0 |
||||
|
margin_right = 415.0 |
||||
|
margin_bottom = 37.0 |
||||
|
focus_neighbour_left = NodePath("../../back") |
||||
|
focus_neighbour_right = NodePath("../../create") |
||||
|
focus_neighbour_bottom = NodePath("../bots") |
||||
|
size_flags_horizontal = 3 |
||||
|
|
||||
|
[node name="bots" type="CheckButton" parent="menu/GridContainer"] |
||||
|
margin_top = 41.0 |
||||
|
margin_right = 143.0 |
||||
|
margin_bottom = 81.0 |
||||
|
focus_neighbour_left = NodePath("../../back") |
||||
|
focus_neighbour_top = NodePath("../name") |
||||
|
focus_neighbour_right = NodePath("../../create") |
||||
|
focus_neighbour_bottom = NodePath("../../create") |
||||
|
size_flags_horizontal = 0 |
||||
|
text = "BOTS" |
||||
|
|
||||
|
[node name="create" type="Button" parent="menu"] |
||||
|
anchor_left = 1.0 |
||||
|
anchor_top = 1.0 |
||||
|
anchor_right = 1.0 |
||||
|
anchor_bottom = 1.0 |
||||
|
margin_left = -255.0 |
||||
|
margin_top = -56.0001 |
||||
|
margin_right = -1.0 |
||||
|
grow_horizontal = 0 |
||||
|
grow_vertical = 0 |
||||
|
rect_pivot_offset = Vector2( 1.89856, 0.845154 ) |
||||
|
focus_neighbour_left = NodePath("../back") |
||||
|
focus_neighbour_top = NodePath("../GridContainer/bots") |
||||
|
focus_neighbour_right = NodePath("../GridContainer/name") |
||||
|
custom_fonts/font = ExtResource( 3 ) |
||||
|
text = "CREATE_GAME" |
||||
|
icon = ExtResource( 4 ) |
||||
|
flat = true |
||||
|
|
||||
|
[node name="back" type="Button" parent="menu"] |
||||
|
anchor_top = 1.0 |
||||
|
anchor_bottom = 1.0 |
||||
|
margin_top = -56.0 |
||||
|
margin_right = 132.0 |
||||
|
rect_pivot_offset = Vector2( 0.606262, -0.447205 ) |
||||
|
focus_neighbour_top = NodePath("../GridContainer/bots") |
||||
|
focus_neighbour_right = NodePath("../create") |
||||
|
custom_fonts/font = ExtResource( 3 ) |
||||
|
text = "Back" |
||||
|
icon = ExtResource( 5 ) |
||||
|
flat = true |
||||
|
[connection signal="text_changed" from="menu/GridContainer/name" to="." method="_on_name_text_changed"] |
||||
|
[connection signal="pressed" from="menu/create" to="." method="_on_create_pressed"] |
||||
|
[connection signal="pressed" from="menu/back" to="." method="_on_back_pressed"] |
@ -0,0 +1,189 @@ |
|||||
|
[gd_scene load_steps=20 format=2] |
||||
|
|
||||
|
[ext_resource path="res://scripts/menus/settings_controls.gd" type="Script" id=1] |
||||
|
[ext_resource path="res://assets/icons/keySmall_3d.png" type="Texture" id=2] |
||||
|
[ext_resource path="res://assets/icons/buttonA.png" type="Texture" id=3] |
||||
|
[ext_resource path="res://assets/icons/buttonB.png" type="Texture" id=4] |
||||
|
[ext_resource path="res://assets/icons/buttonX.png" type="Texture" id=5] |
||||
|
[ext_resource path="res://assets/icons/buttonY.png" type="Texture" id=6] |
||||
|
[ext_resource path="res://assets/icons/buttonL1.png" type="Texture" id=7] |
||||
|
[ext_resource path="res://assets/icons/buttonR1.png" type="Texture" id=8] |
||||
|
[ext_resource path="res://assets/icons/buttonL2.png" type="Texture" id=9] |
||||
|
[ext_resource path="res://assets/icons/buttonR2.png" type="Texture" id=10] |
||||
|
[ext_resource path="res://assets/icons/buttonL.png" type="Texture" id=11] |
||||
|
[ext_resource path="res://assets/icons/buttonR.png" type="Texture" id=12] |
||||
|
[ext_resource path="res://assets/icons/buttonSelect.png" type="Texture" id=13] |
||||
|
[ext_resource path="res://assets/icons/buttonStart.png" type="Texture" id=14] |
||||
|
[ext_resource path="res://assets/icons/DPAD_up.png" type="Texture" id=15] |
||||
|
[ext_resource path="res://assets/icons/DPAD_down.png" type="Texture" id=16] |
||||
|
[ext_resource path="res://assets/icons/DPAD_left.png" type="Texture" id=17] |
||||
|
[ext_resource path="res://assets/icons/DPAD_right.png" type="Texture" id=18] |
||||
|
[ext_resource path="res://assets/icons/fightJ.png" type="Texture" id=19] |
||||
|
|
||||
|
[node name="settings_controls_menu" type="Control"] |
||||
|
margin_left = 12.0 |
||||
|
margin_top = 8.0 |
||||
|
margin_right = 858.0 |
||||
|
margin_bottom = 335.0 |
||||
|
script = ExtResource( 1 ) |
||||
|
|
||||
|
[node name="key_dialog" type="ConfirmationDialog" parent="."] |
||||
|
margin_left = 18.0 |
||||
|
margin_top = 16.0 |
||||
|
margin_right = 311.0 |
||||
|
margin_bottom = 100.0 |
||||
|
popup_exclusive = true |
||||
|
window_title = "" |
||||
|
dialog_text = "Press any key..." |
||||
|
|
||||
|
[node name="ScrollContainer" type="ScrollContainer" parent="."] |
||||
|
editor/display_folded = true |
||||
|
anchor_right = 1.0 |
||||
|
anchor_bottom = 1.0 |
||||
|
|
||||
|
[node name="grid" type="GridContainer" parent="ScrollContainer"] |
||||
|
margin_right = 846.0 |
||||
|
margin_bottom = 327.0 |
||||
|
size_flags_horizontal = 3 |
||||
|
size_flags_vertical = 3 |
||||
|
columns = 3 |
||||
|
|
||||
|
[node name="empty" type="Label" parent="ScrollContainer/grid"] |
||||
|
margin_bottom = 14.0 |
||||
|
|
||||
|
[node name="keyboard_label" type="Label" parent="ScrollContainer/grid"] |
||||
|
margin_left = 4.0 |
||||
|
margin_right = 423.0 |
||||
|
margin_bottom = 14.0 |
||||
|
size_flags_horizontal = 3 |
||||
|
text = "KEYBOARD" |
||||
|
align = 1 |
||||
|
valign = 1 |
||||
|
|
||||
|
[node name="joypad_label" type="Label" parent="ScrollContainer/grid"] |
||||
|
margin_left = 427.0 |
||||
|
margin_right = 846.0 |
||||
|
margin_bottom = 14.0 |
||||
|
size_flags_horizontal = 3 |
||||
|
text = "JOYPAD" |
||||
|
align = 1 |
||||
|
valign = 1 |
||||
|
|
||||
|
[node name="icons" type="GridContainer" parent="."] |
||||
|
visible = false |
||||
|
margin_right = 40.0 |
||||
|
margin_bottom = 40.0 |
||||
|
size_flags_horizontal = 3 |
||||
|
size_flags_vertical = 3 |
||||
|
|
||||
|
[node name="key" type="Button" parent="icons"] |
||||
|
margin_right = 62.0 |
||||
|
margin_bottom = 56.0 |
||||
|
icon = ExtResource( 2 ) |
||||
|
|
||||
|
[node name="joypad" type="GridContainer" parent="icons"] |
||||
|
editor/display_folded = true |
||||
|
margin_top = 60.0 |
||||
|
margin_right = 62.0 |
||||
|
margin_bottom = 1076.0 |
||||
|
|
||||
|
[node name="0" type="Button" parent="icons/joypad"] |
||||
|
margin_right = 62.0 |
||||
|
margin_bottom = 56.0 |
||||
|
icon = ExtResource( 3 ) |
||||
|
|
||||
|
[node name="1" type="Button" parent="icons/joypad"] |
||||
|
margin_top = 60.0 |
||||
|
margin_right = 62.0 |
||||
|
margin_bottom = 116.0 |
||||
|
icon = ExtResource( 4 ) |
||||
|
|
||||
|
[node name="2" type="Button" parent="icons/joypad"] |
||||
|
margin_top = 120.0 |
||||
|
margin_right = 62.0 |
||||
|
margin_bottom = 176.0 |
||||
|
icon = ExtResource( 5 ) |
||||
|
|
||||
|
[node name="3" type="Button" parent="icons/joypad"] |
||||
|
margin_top = 180.0 |
||||
|
margin_right = 62.0 |
||||
|
margin_bottom = 236.0 |
||||
|
icon = ExtResource( 6 ) |
||||
|
|
||||
|
[node name="4" type="Button" parent="icons/joypad"] |
||||
|
margin_top = 240.0 |
||||
|
margin_right = 62.0 |
||||
|
margin_bottom = 296.0 |
||||
|
icon = ExtResource( 7 ) |
||||
|
|
||||
|
[node name="5" type="Button" parent="icons/joypad"] |
||||
|
margin_top = 300.0 |
||||
|
margin_right = 62.0 |
||||
|
margin_bottom = 356.0 |
||||
|
icon = ExtResource( 8 ) |
||||
|
|
||||
|
[node name="6" type="Button" parent="icons/joypad"] |
||||
|
margin_top = 360.0 |
||||
|
margin_right = 62.0 |
||||
|
margin_bottom = 416.0 |
||||
|
icon = ExtResource( 9 ) |
||||
|
|
||||
|
[node name="7" type="Button" parent="icons/joypad"] |
||||
|
margin_top = 420.0 |
||||
|
margin_right = 62.0 |
||||
|
margin_bottom = 476.0 |
||||
|
icon = ExtResource( 10 ) |
||||
|
|
||||
|
[node name="8" type="Button" parent="icons/joypad"] |
||||
|
margin_top = 480.0 |
||||
|
margin_right = 62.0 |
||||
|
margin_bottom = 536.0 |
||||
|
icon = ExtResource( 11 ) |
||||
|
|
||||
|
[node name="9" type="Button" parent="icons/joypad"] |
||||
|
margin_top = 540.0 |
||||
|
margin_right = 62.0 |
||||
|
margin_bottom = 596.0 |
||||
|
icon = ExtResource( 12 ) |
||||
|
|
||||
|
[node name="10" type="Button" parent="icons/joypad"] |
||||
|
margin_top = 600.0 |
||||
|
margin_right = 62.0 |
||||
|
margin_bottom = 656.0 |
||||
|
icon = ExtResource( 13 ) |
||||
|
|
||||
|
[node name="11" type="Button" parent="icons/joypad"] |
||||
|
margin_top = 660.0 |
||||
|
margin_right = 62.0 |
||||
|
margin_bottom = 716.0 |
||||
|
icon = ExtResource( 14 ) |
||||
|
|
||||
|
[node name="12" type="Button" parent="icons/joypad"] |
||||
|
margin_top = 720.0 |
||||
|
margin_right = 62.0 |
||||
|
margin_bottom = 776.0 |
||||
|
icon = ExtResource( 15 ) |
||||
|
|
||||
|
[node name="13" type="Button" parent="icons/joypad"] |
||||
|
margin_top = 780.0 |
||||
|
margin_right = 62.0 |
||||
|
margin_bottom = 836.0 |
||||
|
icon = ExtResource( 16 ) |
||||
|
|
||||
|
[node name="14" type="Button" parent="icons/joypad"] |
||||
|
margin_top = 840.0 |
||||
|
margin_right = 62.0 |
||||
|
margin_bottom = 896.0 |
||||
|
icon = ExtResource( 17 ) |
||||
|
|
||||
|
[node name="15" type="Button" parent="icons/joypad"] |
||||
|
margin_top = 900.0 |
||||
|
margin_right = 62.0 |
||||
|
margin_bottom = 956.0 |
||||
|
icon = ExtResource( 18 ) |
||||
|
|
||||
|
[node name="other" type="Button" parent="icons/joypad"] |
||||
|
margin_top = 960.0 |
||||
|
margin_right = 62.0 |
||||
|
margin_bottom = 1016.0 |
||||
|
icon = ExtResource( 19 ) |
@ -0,0 +1,156 @@ |
|||||
|
[gd_scene load_steps=7 format=2] |
||||
|
|
||||
|
[ext_resource path="res://resources/ui/theme.tres" type="Theme" id=1] |
||||
|
[ext_resource path="res://scripts/menus/settings.gd" type="Script" id=2] |
||||
|
[ext_resource path="res://scenes/menus/BaseMenu.tscn" type="PackedScene" id=3] |
||||
|
[ext_resource path="res://scenes/menus/SettingsPlayerMenu.tscn" type="PackedScene" id=4] |
||||
|
[ext_resource path="res://scenes/menus/SettingsControlsMenu.tscn" type="PackedScene" id=5] |
||||
|
[ext_resource path="res://assets/icons/save.png" type="Texture" id=6] |
||||
|
|
||||
|
[node name="settings_menu" type="Control"] |
||||
|
anchor_right = 1.0 |
||||
|
anchor_bottom = 1.0 |
||||
|
margin_left = 1.45612 |
||||
|
margin_top = 1.45612 |
||||
|
margin_right = 1.45605 |
||||
|
margin_bottom = 1.45612 |
||||
|
theme = ExtResource( 1 ) |
||||
|
script = ExtResource( 2 ) |
||||
|
|
||||
|
[node name="menu" parent="." instance=ExtResource( 3 )] |
||||
|
|
||||
|
[node name="tabs" type="TabContainer" parent="menu"] |
||||
|
anchor_left = 0.5 |
||||
|
anchor_top = 0.5 |
||||
|
anchor_right = 0.5 |
||||
|
anchor_bottom = 0.5 |
||||
|
margin_left = -464.5 |
||||
|
margin_top = -223.5 |
||||
|
margin_right = 459.5 |
||||
|
margin_bottom = 177.5 |
||||
|
grow_horizontal = 2 |
||||
|
grow_vertical = 2 |
||||
|
size_flags_horizontal = 3 |
||||
|
size_flags_vertical = 3 |
||||
|
tab_align = 0 |
||||
|
|
||||
|
[node name="game" type="Tabs" parent="menu/tabs"] |
||||
|
anchor_right = 1.0 |
||||
|
anchor_bottom = 1.0 |
||||
|
margin_left = 4.0 |
||||
|
margin_top = 45.0 |
||||
|
margin_right = -4.0 |
||||
|
margin_bottom = -4.0 |
||||
|
|
||||
|
[node name="GridContainer" type="GridContainer" parent="menu/tabs/game"] |
||||
|
margin_left = 9.0 |
||||
|
margin_top = 10.0 |
||||
|
margin_right = 416.0 |
||||
|
margin_bottom = 200.0 |
||||
|
|
||||
|
[node name="settings_player" parent="menu/tabs/game/GridContainer" instance=ExtResource( 4 )] |
||||
|
margin_left = 0.0 |
||||
|
margin_top = 0.0 |
||||
|
margin_right = 407.0 |
||||
|
margin_bottom = 146.0 |
||||
|
|
||||
|
[node name="name_label" parent="menu/tabs/game/GridContainer/settings_player/GridContainer" index="0"] |
||||
|
margin_right = 407.0 |
||||
|
margin_bottom = 27.0 |
||||
|
|
||||
|
[node name="name" parent="menu/tabs/game/GridContainer/settings_player/GridContainer" index="1"] |
||||
|
margin_top = 31.0 |
||||
|
margin_right = 407.0 |
||||
|
margin_bottom = 68.0 |
||||
|
|
||||
|
[node name="color_label" parent="menu/tabs/game/GridContainer/settings_player/GridContainer" index="2"] |
||||
|
margin_top = 72.0 |
||||
|
margin_right = 407.0 |
||||
|
margin_bottom = 99.0 |
||||
|
|
||||
|
[node name="color" parent="menu/tabs/game/GridContainer/settings_player/GridContainer" index="3"] |
||||
|
margin_top = 103.0 |
||||
|
margin_right = 407.0 |
||||
|
margin_bottom = 136.0 |
||||
|
|
||||
|
[node name="bots" type="CheckButton" parent="menu/tabs/game/GridContainer"] |
||||
|
margin_top = 150.0 |
||||
|
margin_right = 143.0 |
||||
|
margin_bottom = 190.0 |
||||
|
size_flags_horizontal = 0 |
||||
|
size_flags_vertical = 0 |
||||
|
text = "Bots" |
||||
|
|
||||
|
[node name="controls" type="Tabs" parent="menu/tabs"] |
||||
|
visible = false |
||||
|
anchor_right = 1.0 |
||||
|
anchor_bottom = 1.0 |
||||
|
margin_left = 4.0 |
||||
|
margin_top = 45.0 |
||||
|
margin_right = -4.0 |
||||
|
margin_bottom = -4.0 |
||||
|
|
||||
|
[node name="settings_controls" parent="menu/tabs/controls" instance=ExtResource( 5 )] |
||||
|
|
||||
|
[node name="graphics" type="Tabs" parent="menu/tabs"] |
||||
|
visible = false |
||||
|
anchor_right = 1.0 |
||||
|
anchor_bottom = 1.0 |
||||
|
margin_left = 4.0 |
||||
|
margin_top = 45.0 |
||||
|
margin_right = -4.0 |
||||
|
margin_bottom = -4.0 |
||||
|
|
||||
|
[node name="system" type="Tabs" parent="menu/tabs"] |
||||
|
visible = false |
||||
|
anchor_right = 1.0 |
||||
|
anchor_bottom = 1.0 |
||||
|
margin_left = 4.0 |
||||
|
margin_top = 45.0 |
||||
|
margin_right = -4.0 |
||||
|
margin_bottom = -4.0 |
||||
|
|
||||
|
[node name="GridContainer" type="GridContainer" parent="menu/tabs/system"] |
||||
|
margin_left = 12.0 |
||||
|
margin_top = 8.0 |
||||
|
margin_right = 476.0 |
||||
|
margin_bottom = 124.0 |
||||
|
columns = 2 |
||||
|
|
||||
|
[node name="locale_label" type="Label" parent="menu/tabs/system/GridContainer"] |
||||
|
margin_right = 102.0 |
||||
|
margin_bottom = 27.0 |
||||
|
text = "LOCALE" |
||||
|
valign = 1 |
||||
|
|
||||
|
[node name="locales" type="ItemList" parent="menu/tabs/system/GridContainer"] |
||||
|
margin_left = 106.0 |
||||
|
margin_right = 464.0 |
||||
|
margin_bottom = 27.0 |
||||
|
size_flags_horizontal = 3 |
||||
|
auto_height = true |
||||
|
|
||||
|
[node name="save" type="Button" parent="menu"] |
||||
|
anchor_left = 1.0 |
||||
|
anchor_top = 1.0 |
||||
|
anchor_right = 1.0 |
||||
|
anchor_bottom = 1.0 |
||||
|
margin_left = -147.0 |
||||
|
margin_top = -56.0 |
||||
|
grow_horizontal = 0 |
||||
|
grow_vertical = 0 |
||||
|
size_flags_horizontal = 3 |
||||
|
size_flags_vertical = 3 |
||||
|
text = "SAVE" |
||||
|
icon = ExtResource( 6 ) |
||||
|
flat = true |
||||
|
[connection signal="item_selected" from="menu/tabs/system/GridContainer/locales" to="." method="_on_locales_item_selected"] |
||||
|
[connection signal="tree_exiting" from="menu/tabs/system/GridContainer/locales" to="." method="_on_locales_tree_exiting"] |
||||
|
[connection signal="visibility_changed" from="menu/tabs/system/GridContainer/locales" to="." method="_init_locales"] |
||||
|
[connection signal="pressed" from="menu/save" to="." method="_on_save_pressed"] |
||||
|
|
||||
|
[editable path="menu"] |
||||
|
|
||||
|
[editable path="menu/tabs/game/GridContainer/settings_player"] |
||||
|
|
||||
|
[editable path="menu/tabs/controls/settings_controls"] |
@ -0,0 +1,39 @@ |
|||||
|
[gd_scene load_steps=2 format=2] |
||||
|
|
||||
|
[ext_resource path="res://scripts/menus/settings_player.gd" type="Script" id=1] |
||||
|
|
||||
|
[node name="settings_player_menu" type="Control"] |
||||
|
margin_left = 513.0 |
||||
|
margin_top = 23.0 |
||||
|
margin_right = 878.0 |
||||
|
margin_bottom = 116.0 |
||||
|
size_flags_horizontal = 3 |
||||
|
size_flags_vertical = 3 |
||||
|
script = ExtResource( 1 ) |
||||
|
|
||||
|
[node name="GridContainer" type="GridContainer" parent="."] |
||||
|
anchor_right = 1.0 |
||||
|
anchor_bottom = 1.0 |
||||
|
|
||||
|
[node name="name_label" type="Label" parent="GridContainer"] |
||||
|
margin_right = 365.0 |
||||
|
margin_bottom = 14.0 |
||||
|
text = "PLAYER_NAME" |
||||
|
|
||||
|
[node name="name" type="LineEdit" parent="GridContainer"] |
||||
|
margin_top = 18.0 |
||||
|
margin_right = 365.0 |
||||
|
margin_bottom = 42.0 |
||||
|
size_flags_horizontal = 3 |
||||
|
|
||||
|
[node name="color_label" type="Label" parent="GridContainer"] |
||||
|
margin_top = 46.0 |
||||
|
margin_right = 365.0 |
||||
|
margin_bottom = 60.0 |
||||
|
text = "PLAYER_COLOR" |
||||
|
|
||||
|
[node name="color" type="ColorPickerButton" parent="GridContainer"] |
||||
|
margin_top = 64.0 |
||||
|
margin_right = 365.0 |
||||
|
margin_bottom = 84.0 |
||||
|
size_flags_horizontal = 3 |
@ -1,13 +1,19 @@ |
|||||
[gd_scene load_steps=3 format=2] |
|
||||
|
[gd_scene load_steps=4 format=2] |
||||
|
|
||||
[ext_resource path="res://assets/road/roadBump.obj" type="ArrayMesh" id=1] |
[ext_resource path="res://assets/road/roadBump.obj" type="ArrayMesh" id=1] |
||||
[ext_resource path="res://resources/road/roadBump.tres" type="Curve3D" id=2] |
|
||||
|
[ext_resource path="res://scripts/road/road.gd" type="Script" id=2] |
||||
|
[ext_resource path="res://resources/road/roadBump.tres" type="Curve3D" id=3] |
||||
|
|
||||
[node name="roadBump" type="MeshInstance"] |
[node name="roadBump" type="MeshInstance"] |
||||
|
transform = Transform( 1, 0, 0, 0, 1, -0.0001179, 0, 0.0001179, 1, 0, 0, 0 ) |
||||
mesh = ExtResource( 1 ) |
mesh = ExtResource( 1 ) |
||||
material/0 = null |
material/0 = null |
||||
material/1 = null |
material/1 = null |
||||
material/2 = null |
material/2 = null |
||||
|
script = ExtResource( 2 ) |
||||
|
reset_index = 1 |
||||
|
speed_constrains = PoolVector3Array( 0.45, 0.8, 0.09, 0.45, 0.8, -0.02, 1.15, 1.55, 0.09 ) |
||||
|
force_penalties = PoolVector3Array( 0, 30, 20, 0, 0, -30, 0, 20, 20 ) |
||||
|
|
||||
[node name="Path" type="Path" parent="."] |
[node name="Path" type="Path" parent="."] |
||||
curve = ExtResource( 2 ) |
|
||||
|
curve = ExtResource( 3 ) |
@ -1,13 +1,15 @@ |
|||||
[gd_scene load_steps=3 format=2] |
|
||||
|
[gd_scene load_steps=4 format=2] |
||||
|
|
||||
[ext_resource path="res://assets/road/roadRamp.obj" type="ArrayMesh" id=1] |
[ext_resource path="res://assets/road/roadRamp.obj" type="ArrayMesh" id=1] |
||||
[ext_resource path="res://resources/road/roadRamp.tres" type="Curve3D" id=2] |
|
||||
|
[ext_resource path="res://scripts/road/road.gd" type="Script" id=2] |
||||
|
[ext_resource path="res://resources/road/roadRamp.tres" type="Curve3D" id=3] |
||||
|
|
||||
[node name="roadRamp" type="MeshInstance"] |
[node name="roadRamp" type="MeshInstance"] |
||||
mesh = ExtResource( 1 ) |
mesh = ExtResource( 1 ) |
||||
material/0 = null |
material/0 = null |
||||
material/1 = null |
material/1 = null |
||||
material/2 = null |
material/2 = null |
||||
|
script = ExtResource( 2 ) |
||||
|
|
||||
[node name="Path" type="Path" parent="."] |
[node name="Path" type="Path" parent="."] |
||||
curve = ExtResource( 2 ) |
|
||||
|
curve = ExtResource( 3 ) |
@ -1,13 +1,15 @@ |
|||||
[gd_scene load_steps=3 format=2] |
|
||||
|
[gd_scene load_steps=4 format=2] |
||||
|
|
||||
[ext_resource path="res://assets/road/roadRampFlipped.obj" type="ArrayMesh" id=1] |
[ext_resource path="res://assets/road/roadRampFlipped.obj" type="ArrayMesh" id=1] |
||||
[ext_resource path="res://resources/road/roadRampFlipped.tres" type="Curve3D" id=2] |
|
||||
|
[ext_resource path="res://scripts/road/road.gd" type="Script" id=2] |
||||
|
[ext_resource path="res://resources/road/roadRampFlipped.tres" type="Curve3D" id=3] |
||||
|
|
||||
[node name="roadRampFlipped" type="MeshInstance"] |
[node name="roadRampFlipped" type="MeshInstance"] |
||||
mesh = ExtResource( 1 ) |
mesh = ExtResource( 1 ) |
||||
material/0 = null |
material/0 = null |
||||
material/1 = null |
material/1 = null |
||||
material/2 = null |
material/2 = null |
||||
|
script = ExtResource( 2 ) |
||||
|
|
||||
[node name="Path" type="Path" parent="."] |
[node name="Path" type="Path" parent="."] |
||||
curve = ExtResource( 2 ) |
|
||||
|
curve = ExtResource( 3 ) |
@ -1,13 +1,15 @@ |
|||||
[gd_scene load_steps=3 format=2] |
|
||||
|
[gd_scene load_steps=4 format=2] |
||||
|
|
||||
[ext_resource path="res://assets/road/roadRampLong.obj" type="ArrayMesh" id=1] |
[ext_resource path="res://assets/road/roadRampLong.obj" type="ArrayMesh" id=1] |
||||
[ext_resource path="res://resources/road/roadRampLong.tres" type="Curve3D" id=2] |
|
||||
|
[ext_resource path="res://scripts/road/road.gd" type="Script" id=2] |
||||
|
[ext_resource path="res://resources/road/roadRampLong.tres" type="Curve3D" id=3] |
||||
|
|
||||
[node name="roadRampLong" type="MeshInstance"] |
[node name="roadRampLong" type="MeshInstance"] |
||||
mesh = ExtResource( 1 ) |
mesh = ExtResource( 1 ) |
||||
material/0 = null |
material/0 = null |
||||
material/1 = null |
material/1 = null |
||||
material/2 = null |
material/2 = null |
||||
|
script = ExtResource( 2 ) |
||||
|
|
||||
[node name="Path" type="Path" parent="."] |
[node name="Path" type="Path" parent="."] |
||||
curve = ExtResource( 2 ) |
|
||||
|
curve = ExtResource( 3 ) |
@ -1,13 +1,15 @@ |
|||||
[gd_scene load_steps=3 format=2] |
|
||||
|
[gd_scene load_steps=4 format=2] |
||||
|
|
||||
[ext_resource path="res://assets/road/roadRampLongCurved.obj" type="ArrayMesh" id=1] |
[ext_resource path="res://assets/road/roadRampLongCurved.obj" type="ArrayMesh" id=1] |
||||
[ext_resource path="res://resources/road/roadRampLongCurved.tres" type="Curve3D" id=2] |
|
||||
|
[ext_resource path="res://scripts/road/road.gd" type="Script" id=2] |
||||
|
[ext_resource path="res://resources/road/roadRampLongCurved.tres" type="Curve3D" id=3] |
||||
|
|
||||
[node name="roadRampLongCurved" type="MeshInstance"] |
[node name="roadRampLongCurved" type="MeshInstance"] |
||||
mesh = ExtResource( 1 ) |
mesh = ExtResource( 1 ) |
||||
material/0 = null |
material/0 = null |
||||
material/1 = null |
material/1 = null |
||||
material/2 = null |
material/2 = null |
||||
|
script = ExtResource( 2 ) |
||||
|
|
||||
[node name="Path" type="Path" parent="."] |
[node name="Path" type="Path" parent="."] |
||||
curve = ExtResource( 2 ) |
|
||||
|
curve = ExtResource( 3 ) |
@ -1,13 +1,15 @@ |
|||||
[gd_scene load_steps=3 format=2] |
|
||||
|
[gd_scene load_steps=4 format=2] |
||||
|
|
||||
[ext_resource path="res://assets/road/roadRampLongCurvedFlipped.obj" type="ArrayMesh" id=1] |
[ext_resource path="res://assets/road/roadRampLongCurvedFlipped.obj" type="ArrayMesh" id=1] |
||||
[ext_resource path="res://resources/road/roadRampLongCurvedFlipped.tres" type="Curve3D" id=2] |
|
||||
|
[ext_resource path="res://scripts/road/road.gd" type="Script" id=2] |
||||
|
[ext_resource path="res://resources/road/roadRampLongCurvedFlipped.tres" type="Curve3D" id=3] |
||||
|
|
||||
[node name="roadRampLongCurvedFlipped" type="MeshInstance"] |
[node name="roadRampLongCurvedFlipped" type="MeshInstance"] |
||||
mesh = ExtResource( 1 ) |
mesh = ExtResource( 1 ) |
||||
material/0 = null |
material/0 = null |
||||
material/1 = null |
material/1 = null |
||||
material/2 = null |
material/2 = null |
||||
|
script = ExtResource( 2 ) |
||||
|
|
||||
[node name="Path" type="Path" parent="."] |
[node name="Path" type="Path" parent="."] |
||||
curve = ExtResource( 2 ) |
|
||||
|
curve = ExtResource( 3 ) |
@ -1,13 +1,15 @@ |
|||||
[gd_scene load_steps=3 format=2] |
|
||||
|
[gd_scene load_steps=4 format=2] |
||||
|
|
||||
[ext_resource path="res://assets/road/roadRampLongFlipped.obj" type="ArrayMesh" id=1] |
[ext_resource path="res://assets/road/roadRampLongFlipped.obj" type="ArrayMesh" id=1] |
||||
[ext_resource path="res://resources/road/roadRampLongFlipped.tres" type="Curve3D" id=2] |
|
||||
|
[ext_resource path="res://scripts/road/road.gd" type="Script" id=2] |
||||
|
[ext_resource path="res://resources/road/roadRampLongFlipped.tres" type="Curve3D" id=3] |
||||
|
|
||||
[node name="roadRampLongFlipped" type="MeshInstance"] |
[node name="roadRampLongFlipped" type="MeshInstance"] |
||||
mesh = ExtResource( 1 ) |
mesh = ExtResource( 1 ) |
||||
material/0 = null |
material/0 = null |
||||
material/1 = null |
material/1 = null |
||||
material/2 = null |
material/2 = null |
||||
|
script = ExtResource( 2 ) |
||||
|
|
||||
[node name="Path" type="Path" parent="."] |
[node name="Path" type="Path" parent="."] |
||||
curve = ExtResource( 2 ) |
|
||||
|
curve = ExtResource( 3 ) |
@ -1,13 +1,15 @@ |
|||||
[gd_scene load_steps=3 format=2] |
|
||||
|
[gd_scene load_steps=4 format=2] |
||||
|
|
||||
[ext_resource path="res://assets/road/roadStraight.obj" type="ArrayMesh" id=1] |
[ext_resource path="res://assets/road/roadStraight.obj" type="ArrayMesh" id=1] |
||||
[ext_resource path="res://resources/road/roadStraight.tres" type="Curve3D" id=2] |
|
||||
|
[ext_resource path="res://scripts/road/road.gd" type="Script" id=2] |
||||
|
[ext_resource path="res://resources/road/roadStraight.tres" type="Curve3D" id=3] |
||||
|
|
||||
[node name="roadStraight" type="MeshInstance"] |
[node name="roadStraight" type="MeshInstance"] |
||||
mesh = ExtResource( 1 ) |
mesh = ExtResource( 1 ) |
||||
material/0 = null |
material/0 = null |
||||
material/1 = null |
material/1 = null |
||||
material/2 = null |
material/2 = null |
||||
|
script = ExtResource( 2 ) |
||||
|
|
||||
[node name="Path" type="Path" parent="."] |
[node name="Path" type="Path" parent="."] |
||||
curve = ExtResource( 2 ) |
|
||||
|
curve = ExtResource( 3 ) |
@ -1,13 +1,15 @@ |
|||||
[gd_scene load_steps=3 format=2] |
|
||||
|
[gd_scene load_steps=4 format=2] |
||||
|
|
||||
[ext_resource path="res://assets/road/roadStraightArrow.obj" type="ArrayMesh" id=1] |
[ext_resource path="res://assets/road/roadStraightArrow.obj" type="ArrayMesh" id=1] |
||||
[ext_resource path="res://resources/road/roadStraightArrow.tres" type="Curve3D" id=2] |
|
||||
|
[ext_resource path="res://scripts/road/road.gd" type="Script" id=2] |
||||
|
[ext_resource path="res://resources/road/roadStraightArrow.tres" type="Curve3D" id=3] |
||||
|
|
||||
[node name="roadStraightArrow" type="MeshInstance"] |
[node name="roadStraightArrow" type="MeshInstance"] |
||||
mesh = ExtResource( 1 ) |
mesh = ExtResource( 1 ) |
||||
material/0 = null |
material/0 = null |
||||
material/1 = null |
material/1 = null |
||||
material/2 = null |
material/2 = null |
||||
|
script = ExtResource( 2 ) |
||||
|
|
||||
[node name="Path" type="Path" parent="."] |
[node name="Path" type="Path" parent="."] |
||||
curve = ExtResource( 2 ) |
|
||||
|
curve = ExtResource( 3 ) |
@ -1,13 +1,15 @@ |
|||||
[gd_scene load_steps=3 format=2] |
|
||||
|
[gd_scene load_steps=4 format=2] |
||||
|
|
||||
[ext_resource path="res://assets/road/roadStraightLong.obj" type="ArrayMesh" id=1] |
[ext_resource path="res://assets/road/roadStraightLong.obj" type="ArrayMesh" id=1] |
||||
[ext_resource path="res://resources/road/roadStraightLong.tres" type="Curve3D" id=2] |
|
||||
|
[ext_resource path="res://scripts/road/road.gd" type="Script" id=2] |
||||
|
[ext_resource path="res://resources/road/roadStraightLong.tres" type="Curve3D" id=3] |
||||
|
|
||||
[node name="roadStraightLong" type="MeshInstance"] |
[node name="roadStraightLong" type="MeshInstance"] |
||||
mesh = ExtResource( 1 ) |
mesh = ExtResource( 1 ) |
||||
material/0 = null |
material/0 = null |
||||
material/1 = null |
material/1 = null |
||||
material/2 = null |
material/2 = null |
||||
|
script = ExtResource( 2 ) |
||||
|
|
||||
[node name="Path" type="Path" parent="."] |
[node name="Path" type="Path" parent="."] |
||||
curve = ExtResource( 2 ) |
|
||||
|
curve = ExtResource( 3 ) |
@ -1,13 +1,15 @@ |
|||||
[gd_scene load_steps=3 format=2] |
|
||||
|
[gd_scene load_steps=4 format=2] |
||||
|
|
||||
[ext_resource path="res://assets/road/roadStraightLongBump.obj" type="ArrayMesh" id=1] |
[ext_resource path="res://assets/road/roadStraightLongBump.obj" type="ArrayMesh" id=1] |
||||
[ext_resource path="res://resources/road/roadStraightLongBump.tres" type="Curve3D" id=2] |
|
||||
|
[ext_resource path="res://scripts/road/road.gd" type="Script" id=2] |
||||
|
[ext_resource path="res://resources/road/roadStraightLongBump.tres" type="Curve3D" id=3] |
||||
|
|
||||
[node name="roadStraightLongBump" type="MeshInstance"] |
[node name="roadStraightLongBump" type="MeshInstance"] |
||||
mesh = ExtResource( 1 ) |
mesh = ExtResource( 1 ) |
||||
material/0 = null |
material/0 = null |
||||
material/1 = null |
material/1 = null |
||||
material/2 = null |
material/2 = null |
||||
|
script = ExtResource( 2 ) |
||||
|
|
||||
[node name="Path" type="Path" parent="."] |
[node name="Path" type="Path" parent="."] |
||||
curve = ExtResource( 2 ) |
|
||||
|
curve = ExtResource( 3 ) |
@ -1,9 +1,11 @@ |
|||||
[gd_scene load_steps=2 format=2] |
|
||||
|
[gd_scene load_steps=3 format=2] |
||||
|
|
||||
[ext_resource path="res://assets/road/roadStraightLongBumpRound.obj" type="ArrayMesh" id=1] |
[ext_resource path="res://assets/road/roadStraightLongBumpRound.obj" type="ArrayMesh" id=1] |
||||
|
[ext_resource path="res://scripts/road/road.gd" type="Script" id=2] |
||||
|
|
||||
[node name="roadStraightLongBumpRound" type="MeshInstance"] |
[node name="roadStraightLongBumpRound" type="MeshInstance"] |
||||
mesh = ExtResource( 1 ) |
mesh = ExtResource( 1 ) |
||||
material/0 = null |
material/0 = null |
||||
material/1 = null |
material/1 = null |
||||
material/2 = null |
material/2 = null |
||||
|
script = ExtResource( 2 ) |
@ -1,13 +1,15 @@ |
|||||
[gd_scene load_steps=3 format=2] |
|
||||
|
[gd_scene load_steps=4 format=2] |
||||
|
|
||||
[ext_resource path="res://assets/road/roadStraightLongMid.obj" type="ArrayMesh" id=1] |
[ext_resource path="res://assets/road/roadStraightLongMid.obj" type="ArrayMesh" id=1] |
||||
[ext_resource path="res://resources/road/roadStraightLongMid.tres" type="Curve3D" id=2] |
|
||||
|
[ext_resource path="res://scripts/road/road.gd" type="Script" id=2] |
||||
|
[ext_resource path="res://resources/road/roadStraightLongMid.tres" type="Curve3D" id=3] |
||||
|
|
||||
[node name="roadStraightLongMid" type="MeshInstance"] |
[node name="roadStraightLongMid" type="MeshInstance"] |
||||
mesh = ExtResource( 1 ) |
mesh = ExtResource( 1 ) |
||||
material/0 = null |
material/0 = null |
||||
material/1 = null |
material/1 = null |
||||
material/2 = null |
material/2 = null |
||||
|
script = ExtResource( 2 ) |
||||
|
|
||||
[node name="Path" type="Path" parent="."] |
[node name="Path" type="Path" parent="."] |
||||
curve = ExtResource( 2 ) |
|
||||
|
curve = ExtResource( 3 ) |
@ -1,13 +1,15 @@ |
|||||
[gd_scene load_steps=3 format=2] |
|
||||
|
[gd_scene load_steps=4 format=2] |
||||
|
|
||||
[ext_resource path="res://assets/road/roadStraightSkew.obj" type="ArrayMesh" id=1] |
[ext_resource path="res://assets/road/roadStraightSkew.obj" type="ArrayMesh" id=1] |
||||
[ext_resource path="res://resources/road/roadStraightSkew.tres" type="Curve3D" id=2] |
|
||||
|
[ext_resource path="res://scripts/road/road.gd" type="Script" id=2] |
||||
|
[ext_resource path="res://resources/road/roadStraightSkew.tres" type="Curve3D" id=3] |
||||
|
|
||||
[node name="roadStraightSkew" type="MeshInstance"] |
[node name="roadStraightSkew" type="MeshInstance"] |
||||
mesh = ExtResource( 1 ) |
mesh = ExtResource( 1 ) |
||||
material/0 = null |
material/0 = null |
||||
material/1 = null |
material/1 = null |
||||
material/2 = null |
material/2 = null |
||||
|
script = ExtResource( 2 ) |
||||
|
|
||||
[node name="Path" type="Path" parent="."] |
[node name="Path" type="Path" parent="."] |
||||
curve = ExtResource( 2 ) |
|
||||
|
curve = ExtResource( 3 ) |
@ -1,13 +1,15 @@ |
|||||
[gd_scene load_steps=3 format=2] |
|
||||
|
[gd_scene load_steps=4 format=2] |
||||
|
|
||||
[ext_resource path="res://assets/road/roadStraightSkewFlipped.obj" type="ArrayMesh" id=1] |
[ext_resource path="res://assets/road/roadStraightSkewFlipped.obj" type="ArrayMesh" id=1] |
||||
[ext_resource path="res://resources/road/roadStraightSkewFlipped.tres" type="Curve3D" id=2] |
|
||||
|
[ext_resource path="res://scripts/road/road.gd" type="Script" id=2] |
||||
|
[ext_resource path="res://resources/road/roadStraightSkewFlipped.tres" type="Curve3D" id=3] |
||||
|
|
||||
[node name="roadStraightSkewFlipped" type="MeshInstance"] |
[node name="roadStraightSkewFlipped" type="MeshInstance"] |
||||
mesh = ExtResource( 1 ) |
mesh = ExtResource( 1 ) |
||||
material/0 = null |
material/0 = null |
||||
material/1 = null |
material/1 = null |
||||
material/2 = null |
material/2 = null |
||||
|
script = ExtResource( 2 ) |
||||
|
|
||||
[node name="Path" type="Path" parent="."] |
[node name="Path" type="Path" parent="."] |
||||
curve = ExtResource( 2 ) |
|
||||
|
curve = ExtResource( 3 ) |
@ -1,22 +0,0 @@ |
|||||
extends Control |
|
||||
|
|
||||
var lobby_menu_scene = preload("res://scenes/menu/lobby.tscn") |
|
||||
|
|
||||
func _on_host_pressed(): |
|
||||
var port = get_node("menu/port").text |
|
||||
var err = game.host_game(int(port)) |
|
||||
|
|
||||
if err == OK: |
|
||||
var lobby_menu = lobby_menu_scene.instance() |
|
||||
get_tree().get_root().add_child(lobby_menu) |
|
||||
|
|
||||
game.set_player(get_tree().get_network_unique_id()) |
|
||||
|
|
||||
queue_free() |
|
||||
else: |
|
||||
_on_back_pressed() |
|
||||
get_tree().get_root().get_node("server").show_error_dialog("Cannot create Server!") |
|
||||
|
|
||||
func _on_back_pressed(): |
|
||||
queue_free() |
|
||||
get_tree().get_root().get_node("server").show() |
|
@ -1,34 +0,0 @@ |
|||||
extends Control |
|
||||
|
|
||||
var lobby_menu_scene = preload("res://scenes/menu/lobby.tscn") |
|
||||
|
|
||||
func _ready(): |
|
||||
game.connect("connection_succeeded", self, "_connection_succeeded") |
|
||||
game.connect("connection_failed", self, "_connection_failed") |
|
||||
|
|
||||
func _on_join_pressed(): |
|
||||
var ip = get_node("menu/ip").text |
|
||||
|
|
||||
if not ip.is_valid_ip_address(): |
|
||||
show_error_dialog("Invalid IPv4 address!") |
|
||||
return |
|
||||
|
|
||||
var port = get_node("menu/port").text |
|
||||
game.join_game(ip, int(port)) |
|
||||
|
|
||||
func _connection_succeeded(): |
|
||||
var lobby_menu = lobby_menu_scene.instance() |
|
||||
get_tree().get_root().add_child(lobby_menu) |
|
||||
queue_free() |
|
||||
|
|
||||
func _connection_failed(): |
|
||||
show_error_dialog("Connection failed!") |
|
||||
|
|
||||
func _on_back_pressed(): |
|
||||
queue_free() |
|
||||
get_tree().get_root().get_node("server").show() |
|
||||
|
|
||||
func show_error_dialog(text:String): |
|
||||
var dialog = get_node("error_dialog") |
|
||||
dialog.set_text(text) |
|
||||
dialog.popup_centered() |
|
@ -1,59 +0,0 @@ |
|||||
extends Control |
|
||||
|
|
||||
var server_menu_scene = preload("res://scenes/menu/server.tscn") |
|
||||
var local_menu_scene = preload("res://scenes/menu/local_game.tscn") |
|
||||
var lobby_menu_scene = preload("res://scenes/menu/lobby.tscn") |
|
||||
var settings_menu_scene = preload("res://scenes/menu/settings.tscn") |
|
||||
|
|
||||
func _ready(): |
|
||||
game.connect("server_disconnected", self, "_server_disconnected") |
|
||||
|
|
||||
func _on_online_pressed(): |
|
||||
var server_menu = server_menu_scene.instance() |
|
||||
get_tree().get_root().add_child(server_menu) |
|
||||
hide() |
|
||||
|
|
||||
func _on_practice_pressed(): |
|
||||
var local_menu = local_menu_scene.instance() |
|
||||
get_tree().get_root().add_child(local_menu) |
|
||||
hide() |
|
||||
|
|
||||
func _on_settings_pressed(): |
|
||||
var settings_menu = settings_menu_scene.instance() |
|
||||
get_tree().get_root().add_child(settings_menu) |
|
||||
hide() |
|
||||
|
|
||||
func _on_quit_pressed(): |
|
||||
get_tree().quit() |
|
||||
|
|
||||
func _on_quick_host_pressed(): |
|
||||
var err = game.host_game(8128) |
|
||||
if err != OK: |
|
||||
show_error_dialog("Cannot create Server!") |
|
||||
return |
|
||||
|
|
||||
var lobby_menu = lobby_menu_scene.instance() |
|
||||
get_tree().get_root().add_child(lobby_menu) |
|
||||
game.set_player(get_tree().get_network_unique_id()) |
|
||||
hide() |
|
||||
|
|
||||
func _on_quick_join_pressed(): |
|
||||
game.connect("connection_succeeded", self, "_quick_connection_succeeded") |
|
||||
game.connect("connection_failed", self, "_quick_connection_failed") |
|
||||
game.join_game("127.0.0.1", 8128) |
|
||||
|
|
||||
func _quick_connection_succeeded(): |
|
||||
var lobby_menu = lobby_menu_scene.instance() |
|
||||
get_tree().get_root().add_child(lobby_menu) |
|
||||
hide() |
|
||||
|
|
||||
func _quick_connection_failed(): |
|
||||
show_error_dialog("Connection failed!") |
|
||||
|
|
||||
func _server_disconnected(): |
|
||||
show_error_dialog("Server disconnected!") |
|
||||
|
|
||||
func show_error_dialog(text:String): |
|
||||
var dialog = get_node("error_dialog") |
|
||||
dialog.set_text(text) |
|
||||
dialog.popup_centered() |
|
@ -1,15 +0,0 @@ |
|||||
extends Control |
|
||||
|
|
||||
func _ready(): |
|
||||
var values = local_storage.read_values() |
|
||||
if values.has('player_name'): |
|
||||
get_name_node().set_text(values['player_name']) |
|
||||
if values.has('player_color'): |
|
||||
get_color_node().set_pick_color(Color(values['player_color'])) |
|
||||
|
|
||||
func get_name_node(): |
|
||||
return get_node("name") |
|
||||
|
|
||||
func get_color_node(): |
|
||||
return get_node("color") |
|
||||
|
|
@ -1,32 +0,0 @@ |
|||||
extends Control |
|
||||
|
|
||||
var direct_host_menu_scene = preload("res://scenes/menu/direct_host.tscn") |
|
||||
var direct_join_menu_scene = preload("res://scenes/menu/direct_join.tscn") |
|
||||
|
|
||||
func _ready(): |
|
||||
get_node("menu/back").connect("pressed",self,"_on_back_pressed") |
|
||||
game.connect("server_disconnected", self, "_server_disconnected") |
|
||||
|
|
||||
func _on_back_pressed(): |
|
||||
queue_free() |
|
||||
get_tree().get_root().get_node("main_menu").show() |
|
||||
|
|
||||
func _on_direct_host_pressed(): |
|
||||
var direct_host_menu = direct_host_menu_scene.instance() |
|
||||
get_tree().get_root().add_child(direct_host_menu) |
|
||||
get_tree().get_root().get_node("main_menu").hide() |
|
||||
hide() |
|
||||
|
|
||||
func _on_direct_join_pressed(): |
|
||||
var direct_join_menu = direct_join_menu_scene.instance() |
|
||||
get_tree().get_root().add_child(direct_join_menu) |
|
||||
get_tree().get_root().get_node("main_menu").hide() |
|
||||
hide() |
|
||||
|
|
||||
func _server_disconnected(): |
|
||||
show_error_dialog("Server disconnected!") |
|
||||
|
|
||||
func show_error_dialog(text:String): |
|
||||
var dialog = get_node("error_dialog") |
|
||||
dialog.set_text(text) |
|
||||
dialog.popup_centered() |
|
@ -1,22 +0,0 @@ |
|||||
extends Control |
|
||||
|
|
||||
onready var player_settings = get_node("menu/tabs/Game/player_settings") |
|
||||
|
|
||||
|
|
||||
func _ready(): |
|
||||
get_node("menu/back").connect("pressed",self,"_on_back_pressed") |
|
||||
get_node("menu/tabs/Game/bots").set_pressed(local_storage.read_value("bots", true)) |
|
||||
|
|
||||
func _on_back_pressed(): |
|
||||
queue_free() |
|
||||
get_tree().get_root().get_node("main_menu").show() |
|
||||
|
|
||||
func _on_save_pressed(): |
|
||||
var values = {} |
|
||||
values['player_name'] = player_settings.get_name_node().text |
|
||||
values['player_color'] = player_settings.get_color_node().color.to_html() |
|
||||
values['bots'] = get_node("menu/tabs/Game/bots").is_pressed() |
|
||||
local_storage.write_values(values) |
|
||||
_on_back_pressed() |
|
||||
|
|
||||
|
|
@ -0,0 +1,33 @@ |
|||||
|
extends Control |
||||
|
|
||||
|
var LobbyMenu = preload("res://scenes/menus/LobbyMenu.tscn") |
||||
|
|
||||
|
|
||||
|
func _ready(): |
||||
|
find_node("bots").set_pressed(local_storage.read_value("bots", true)) |
||||
|
|
||||
|
|
||||
|
func _draw(): |
||||
|
find_node("host").grab_focus() |
||||
|
|
||||
|
|
||||
|
func _on_host_pressed(): |
||||
|
var port = find_node("port").text |
||||
|
var bots = find_node("bots").is_pressed() |
||||
|
var err = server.host_game(int(port), bots) |
||||
|
|
||||
|
if err == OK: |
||||
|
var lobby_menu = LobbyMenu.instance() |
||||
|
get_tree().get_root().add_child(lobby_menu) |
||||
|
|
||||
|
game.set_player(get_tree().get_network_unique_id()) |
||||
|
|
||||
|
queue_free() |
||||
|
else: |
||||
|
_on_back_pressed() |
||||
|
get_tree().get_root().get_node("multiplayer_menu").show_error_dialog(tr("ERROR_SERVER_CREATION")) |
||||
|
|
||||
|
|
||||
|
func _on_back_pressed(): |
||||
|
queue_free() |
||||
|
get_tree().get_root().get_node("multiplayer_menu").show() |
@ -0,0 +1,27 @@ |
|||||
|
extends Control |
||||
|
|
||||
|
|
||||
|
func _draw(): |
||||
|
find_node("join").grab_focus() |
||||
|
|
||||
|
|
||||
|
func _on_join_pressed(): |
||||
|
var ip = find_node("ip").text |
||||
|
|
||||
|
if not ip.is_valid_ip_address(): |
||||
|
show_error_dialog(tr("INVALIP_IP4")) |
||||
|
return |
||||
|
|
||||
|
var port = find_node("port").text |
||||
|
client.join_game(ip, int(port)) |
||||
|
queue_free() |
||||
|
|
||||
|
|
||||
|
func _on_back_pressed(): |
||||
|
queue_free() |
||||
|
|
||||
|
|
||||
|
func show_error_dialog(text:String): |
||||
|
var dialog = get_node("error_dialog") |
||||
|
dialog.set_text(text) |
||||
|
dialog.popup_centered() |
@ -1,16 +1,23 @@ |
|||||
extends Control |
extends Control |
||||
|
|
||||
onready var player_settings = get_node("menu/player_settings") |
|
||||
|
onready var player_settings = find_node("player_settings") |
||||
|
|
||||
|
|
||||
func _ready(): |
func _ready(): |
||||
get_node("menu/bots").set_pressed(local_storage.read_value("bots", true)) |
|
||||
|
find_node("bots").set_pressed(local_storage.read_value("bots", true)) |
||||
|
|
||||
|
|
||||
|
func _draw(): |
||||
|
find_node("start").grab_focus() |
||||
|
|
||||
|
|
||||
func _on_start_pressed(): |
func _on_start_pressed(): |
||||
var name = player_settings.get_name_node().text |
var name = player_settings.get_name_node().text |
||||
var color = player_settings.get_color_node().color |
var color = player_settings.get_color_node().color |
||||
var bots = get_node("menu/bots").is_pressed() |
|
||||
|
var bots = find_node("bots").is_pressed() |
||||
queue_free() |
queue_free() |
||||
game.local_game(name,color,bots) |
|
||||
|
server.local_game(name,color,bots) |
||||
|
|
||||
|
|
||||
func _on_back_pressed(): |
func _on_back_pressed(): |
||||
queue_free() |
queue_free() |
@ -0,0 +1,43 @@ |
|||||
|
extends Control |
||||
|
|
||||
|
var MultiplayerMenu = preload("res://scenes/menus/MultiplayerMenu.tscn") |
||||
|
var LocalGameMenu = preload("res://scenes/menus/LocalGameMenu.tscn") |
||||
|
var SettingsMenu = preload("res://scenes/menus/SettingsMenu.tscn") |
||||
|
|
||||
|
|
||||
|
func _ready(): |
||||
|
game.connect("server_disconnected", self, "_server_disconnected") |
||||
|
|
||||
|
func _draw(): |
||||
|
find_node("multiplayer").grab_focus() |
||||
|
|
||||
|
func _on_multiplayer_pressed(): |
||||
|
var multiplayer_menu = MultiplayerMenu.instance() |
||||
|
get_tree().get_root().add_child(multiplayer_menu) |
||||
|
hide() |
||||
|
|
||||
|
|
||||
|
func _on_practice_pressed(): |
||||
|
var local_game_menu = LocalGameMenu.instance() |
||||
|
get_tree().get_root().add_child(local_game_menu) |
||||
|
hide() |
||||
|
|
||||
|
|
||||
|
func _on_settings_pressed(): |
||||
|
var settings_menu = SettingsMenu.instance() |
||||
|
get_tree().get_root().add_child(settings_menu) |
||||
|
hide() |
||||
|
|
||||
|
|
||||
|
func _on_quit_pressed(): |
||||
|
get_tree().quit() |
||||
|
|
||||
|
|
||||
|
func _server_disconnected(): |
||||
|
show_error_dialog(tr("SERVER_DISCONNECTED")) |
||||
|
|
||||
|
|
||||
|
func show_error_dialog(text:String): |
||||
|
var dialog = get_node("error_dialog") |
||||
|
dialog.set_text(text) |
||||
|
dialog.popup_centered() |
@ -0,0 +1,141 @@ |
|||||
|
extends Control |
||||
|
|
||||
|
var ServerCreateGameMenu = preload("res://scenes/menus/ServerCreateGameMenu.tscn") |
||||
|
var LobbyMenu = preload("res://scenes/menus/LobbyMenu.tscn") |
||||
|
var DirectHostMenu = preload("res://scenes/menus/DirectHostMenu.tscn") |
||||
|
var DirectJoinMenu = preload("res://scenes/menus/DirectJoinMenu.tscn") |
||||
|
|
||||
|
onready var games_list = get_node("menu/games") |
||||
|
var games = [] |
||||
|
var selected_game = {} |
||||
|
|
||||
|
|
||||
|
func _ready(): |
||||
|
get_node("menu/back").connect("pressed",self,"_on_back_pressed") |
||||
|
client.connect("connection_succeeded", self, "_connection_succeeded") |
||||
|
client.connect("connection_failed", self, "_connection_failed") |
||||
|
client.connect("server_disconnected", self, "_server_disconnected") |
||||
|
|
||||
|
|
||||
|
func _draw(): |
||||
|
find_node("refresh").grab_focus() |
||||
|
|
||||
|
|
||||
|
func _on_multiplayer_menu_draw(): |
||||
|
get_games(find_node("open").is_pressed()) |
||||
|
get_node("refresh_timer").start() |
||||
|
|
||||
|
|
||||
|
func _on_multiplayer_menu_hide(): |
||||
|
get_node("refresh_timer").stop() |
||||
|
|
||||
|
|
||||
|
func _on_back_pressed(): |
||||
|
queue_free() |
||||
|
get_tree().get_root().get_node("main_menu").show() |
||||
|
|
||||
|
|
||||
|
func _on_direct_host_pressed(): |
||||
|
var direct_host_menu = DirectHostMenu.instance() |
||||
|
get_tree().get_root().add_child(direct_host_menu) |
||||
|
get_tree().get_root().get_node("main_menu").hide() |
||||
|
|
||||
|
|
||||
|
func _on_direct_join_pressed(): |
||||
|
var direct_join_menu = DirectJoinMenu.instance() |
||||
|
get_tree().get_root().add_child(direct_join_menu) |
||||
|
get_tree().get_root().get_node("main_menu").hide() |
||||
|
|
||||
|
|
||||
|
func _on_open_toggled(button_pressed): |
||||
|
get_games(button_pressed) |
||||
|
|
||||
|
|
||||
|
func _on_refresh_pressed(): |
||||
|
if get_node("refresh_timer").is_stopped(): |
||||
|
get_node("refresh_timer").start() |
||||
|
get_games(find_node("open").is_pressed()) |
||||
|
|
||||
|
|
||||
|
func _on_refresh_timer_timeout(): |
||||
|
get_games(find_node("open").is_pressed()) |
||||
|
|
||||
|
|
||||
|
func _server_disconnected(): |
||||
|
show_error_dialog(tr("SERVER_DISCONNECTED")) |
||||
|
|
||||
|
|
||||
|
func show_error_dialog(text:String): |
||||
|
var dialog = get_node("error_dialog") |
||||
|
dialog.set_text(text) |
||||
|
dialog.popup_centered() |
||||
|
|
||||
|
|
||||
|
func get_games(only_open:bool): |
||||
|
var req = game_server.http() |
||||
|
req.connect_http(self,"_on_get_games") |
||||
|
if only_open: |
||||
|
req.get_request('client/games?open') |
||||
|
else: |
||||
|
req.get_request('client/games') |
||||
|
|
||||
|
|
||||
|
func _on_get_games(result, response_code, headers, body): |
||||
|
if result == OK && response_code == HTTPClient.RESPONSE_OK: |
||||
|
find_node("create").set_disabled(false) |
||||
|
find_node("open").set_disabled(false) |
||||
|
var json = JSON.parse(body.get_string_from_utf8()) |
||||
|
games_list.clear() |
||||
|
games = json.result |
||||
|
for game in games: |
||||
|
var name = game.name |
||||
|
name += " (" |
||||
|
name += str(game.player_count) |
||||
|
name += "/4)" |
||||
|
if game.bots: |
||||
|
name += " [with Bots]" |
||||
|
games_list.add_item(name) |
||||
|
if game.running: |
||||
|
games_list.set_item_icon(games_list.get_item_count()-1, games_list.get_node("running_icon").get_button_icon()) |
||||
|
elif game.has('private') && game.private: |
||||
|
games_list.set_item_icon(games_list.get_item_count()-1, games_list.get_node("private_icon").get_button_icon()) |
||||
|
else: |
||||
|
games_list.set_item_icon(games_list.get_item_count()-1, games_list.get_node("open_icon").get_button_icon()) |
||||
|
else: |
||||
|
find_node("create").set_disabled(true) |
||||
|
find_node("join").set_disabled(true) |
||||
|
find_node("open").set_disabled(true) |
||||
|
show_error_dialog(tr("SERVER_NO_CONNECTION")) |
||||
|
get_node("refresh_timer").stop() |
||||
|
|
||||
|
|
||||
|
func _on_create_pressed(): |
||||
|
var server_create_game_menu = ServerCreateGameMenu.instance() |
||||
|
get_tree().get_root().add_child(server_create_game_menu) |
||||
|
get_tree().get_root().get_node("main_menu").hide() |
||||
|
|
||||
|
|
||||
|
func _on_join_pressed(): |
||||
|
client.join_game(game_server.SERVER_ADDR, int(selected_game['port'])) |
||||
|
|
||||
|
|
||||
|
func _connection_succeeded(): |
||||
|
var lobby_menu = LobbyMenu.instance() |
||||
|
if selected_game && selected_game.has('name'): |
||||
|
game.game_name = selected_game.name |
||||
|
get_tree().get_root().add_child(lobby_menu) |
||||
|
get_node("refresh_timer").stop() |
||||
|
hide() |
||||
|
|
||||
|
|
||||
|
func _connection_failed(): |
||||
|
show_error_dialog(tr("CONNECTION_FAILED")) |
||||
|
|
||||
|
|
||||
|
func _on_games_item_selected(index): |
||||
|
selected_game = games[index] |
||||
|
find_node("join").set_disabled(false) |
||||
|
|
||||
|
|
||||
|
func _on_games_nothing_selected(): |
||||
|
find_node("join").set_disabled(true) |
@ -0,0 +1,44 @@ |
|||||
|
extends Control |
||||
|
|
||||
|
|
||||
|
func _ready(): |
||||
|
var player_name = local_storage.read_value("player_name", false) |
||||
|
var game_title = "New Game" |
||||
|
if player_name: |
||||
|
game_title += " by " + player_name |
||||
|
find_node("name").set_text(game_title) |
||||
|
find_node("bots").set_pressed(local_storage.read_value("bots", true)) |
||||
|
|
||||
|
|
||||
|
func _draw(): |
||||
|
find_node("create").grab_focus() |
||||
|
|
||||
|
|
||||
|
func _on_create_pressed(): |
||||
|
var req = game_server.http() |
||||
|
req.connect_http(self,"_on_game_created") |
||||
|
var server_name = find_node("name").text |
||||
|
var bots = 0 |
||||
|
if find_node("bots").is_pressed(): |
||||
|
bots = 1 |
||||
|
req.post_request('client/game/create', to_json({'name' : server_name, 'bots' : bots})) |
||||
|
|
||||
|
|
||||
|
func _on_game_created(result, response_code, headers, body): |
||||
|
if result == OK && response_code == HTTPClient.RESPONSE_OK: |
||||
|
var json = JSON.parse(body.get_string_from_utf8()) |
||||
|
game.game_name = json.result['name'] |
||||
|
client.join_game(game_server.SERVER_ADDR, int(json.result['port'])) |
||||
|
queue_free() |
||||
|
|
||||
|
|
||||
|
func _on_name_text_changed(new_text): |
||||
|
if new_text: |
||||
|
find_node("create").set_disabled(false) |
||||
|
else: |
||||
|
find_node("create").set_disabled(true) |
||||
|
|
||||
|
|
||||
|
func _on_back_pressed(): |
||||
|
queue_free() |
||||
|
get_tree().get_root().get_node("multiplayer_menu").show() |
@ -0,0 +1,67 @@ |
|||||
|
extends Control |
||||
|
|
||||
|
onready var player_settings = find_node("settings_player") |
||||
|
onready var game_tab = find_node("game") |
||||
|
onready var controls_tab = find_node("controls") |
||||
|
onready var graphics_tab = find_node("graphics") |
||||
|
onready var system_tab = find_node("system") |
||||
|
|
||||
|
var locale |
||||
|
|
||||
|
|
||||
|
func _ready(): |
||||
|
get_node("menu/back").connect("pressed",self,"_on_back_pressed") |
||||
|
find_node("bots").set_pressed(local_storage.read_value("bots", true)) |
||||
|
game_tab.set_name(tr("GAME")) |
||||
|
controls_tab.set_name(tr("CONTROLS")) |
||||
|
graphics_tab.set_name(tr("GRAPHICS")) |
||||
|
system_tab.set_name(tr("SYSTEM")) |
||||
|
|
||||
|
|
||||
|
func _on_back_pressed(): |
||||
|
queue_free() |
||||
|
get_tree().get_root().get_node("main_menu").show() |
||||
|
|
||||
|
|
||||
|
func _on_locales_item_selected(index): |
||||
|
match index: |
||||
|
0: |
||||
|
locale = "en" |
||||
|
1: |
||||
|
locale = "de" |
||||
|
_: |
||||
|
locale = "en" |
||||
|
TranslationServer.set_locale(locale) |
||||
|
game_tab.set_name(tr("GAME")) |
||||
|
controls_tab.set_name(tr("CONTROLS")) |
||||
|
graphics_tab.set_name(tr("GRAPHICS")) |
||||
|
system_tab.set_name(tr("SYSTEM")) |
||||
|
|
||||
|
|
||||
|
func _init_locales(): |
||||
|
var locales = find_node("locales") |
||||
|
locales.clear() |
||||
|
locales.add_item(tr("LOCALE_EN")) |
||||
|
locales.add_item(tr("LOCALE_DE")) |
||||
|
locale = local_storage.read_value("locale","en") |
||||
|
match locale: |
||||
|
"en": |
||||
|
locales.select(0) |
||||
|
_on_locales_item_selected(0) |
||||
|
"de": |
||||
|
locales.select(1) |
||||
|
_on_locales_item_selected(1) |
||||
|
|
||||
|
|
||||
|
func _on_locales_tree_exiting(): |
||||
|
TranslationServer.set_locale(local_storage.read_value("locale","en")) |
||||
|
|
||||
|
|
||||
|
func _on_save_pressed(): |
||||
|
var values = {} |
||||
|
values['player_name'] = player_settings.get_name_node().text |
||||
|
values['player_color'] = player_settings.get_color_node().color.to_html() |
||||
|
values['bots'] = find_node("bots").is_pressed() |
||||
|
values['locale'] = locale |
||||
|
local_storage.write_values(values) |
||||
|
_on_back_pressed() |
@ -0,0 +1,89 @@ |
|||||
|
tool |
||||
|
|
||||
|
extends Control |
||||
|
|
||||
|
onready var grid = find_node("grid") |
||||
|
onready var key_dialog = get_node("key_dialog") |
||||
|
|
||||
|
const INPUT_TYPE_KEY = 0 |
||||
|
const INPUT_TYPE_JOYPAD = 1 |
||||
|
|
||||
|
var last_action:String |
||||
|
var last_event:InputEvent |
||||
|
|
||||
|
var new_inputs = {} |
||||
|
|
||||
|
func _ready(): |
||||
|
init_mapping() |
||||
|
|
||||
|
|
||||
|
func init_mapping(): |
||||
|
new_inputs = {} |
||||
|
for action in InputMap.get_actions(): |
||||
|
if action.begins_with("controls_"): |
||||
|
var action_label = Label.new() |
||||
|
action_label.set_name(action + "_label") |
||||
|
action_label.set_text(action) |
||||
|
grid.add_child(action_label) |
||||
|
|
||||
|
var key_action_button = Button.new() |
||||
|
key_action_button.set_h_size_flags(SIZE_SHRINK_CENTER) |
||||
|
key_action_button.set_flat(true) |
||||
|
key_action_button.set_meta("action",action) |
||||
|
key_action_button.set_button_icon(get_node("icons/key").get_button_icon()) |
||||
|
|
||||
|
var joypad_action_button = Button.new() |
||||
|
joypad_action_button.set_h_size_flags(SIZE_SHRINK_CENTER) |
||||
|
joypad_action_button.set_flat(true) |
||||
|
joypad_action_button.set_meta("action",action) |
||||
|
|
||||
|
for mapping in InputMap.get_action_list(action): |
||||
|
if mapping is InputEventKey: |
||||
|
key_action_button.set_text(mapping.as_text()) |
||||
|
key_action_button.set_tooltip(mapping.as_text()) |
||||
|
elif mapping is InputEventJoypadButton: |
||||
|
joypad_action_button.set_tooltip(str(mapping.button_index)) |
||||
|
if has_node("icons/joypad/" + str(mapping.button_index)): |
||||
|
joypad_action_button.set_button_icon(get_node("icons/joypad/" + str(mapping.button_index)).get_button_icon()) |
||||
|
else: |
||||
|
joypad_action_button.set_button_icon(get_node("icons/joypad/other").get_button_icon()) |
||||
|
joypad_action_button.set_text(str(mapping.button_index)) |
||||
|
|
||||
|
grid.add_child(key_action_button) |
||||
|
key_action_button.connect("pressed",self,"_on_button_pressed",[action, INPUT_TYPE_KEY]) |
||||
|
|
||||
|
grid.add_child(joypad_action_button) |
||||
|
joypad_action_button.connect("pressed",self,"_on_button_pressed",[action, INPUT_TYPE_JOYPAD]) |
||||
|
|
||||
|
func _unhandled_input(event): |
||||
|
if key_dialog.is_visible_in_tree(): |
||||
|
if key_dialog.get_meta("type") == INPUT_TYPE_KEY && event is InputEventKey: |
||||
|
last_event = event |
||||
|
key_dialog.set_text(tr(last_event.as_text())) |
||||
|
key_dialog.get_ok().set_disabled(false) |
||||
|
elif key_dialog.get_meta("type") == INPUT_TYPE_JOYPAD && event is InputEventJoypadButton: |
||||
|
last_event = event |
||||
|
key_dialog.set_text(last_event.as_text()) |
||||
|
key_dialog.get_ok().set_disabled(false) |
||||
|
|
||||
|
|
||||
|
func _on_button_pressed(action, type): |
||||
|
last_action = action |
||||
|
last_event = null |
||||
|
key_dialog.set_text(tr("PRESS_KEY")) |
||||
|
key_dialog.set_meta("type", type) |
||||
|
key_dialog.connect("confirmed",self,"_on_dialog_confirmed") |
||||
|
key_dialog.get_ok().set_disabled(true) |
||||
|
key_dialog.popup_centered() |
||||
|
|
||||
|
|
||||
|
func _on_dialog_confirmed(type): |
||||
|
if not new_inputs.has(last_action): |
||||
|
new_inputs[last_action] = {} |
||||
|
match key_dialog.get_meta("type"): |
||||
|
INPUT_TYPE_KEY: |
||||
|
if last_event is InputEventKey: |
||||
|
new_inputs[last_action]["key"] = OS.get_scancode_string(last_event.scancode) |
||||
|
INPUT_TYPE_JOYPAD: |
||||
|
if last_event is InputEventJoypadButton: |
||||
|
new_inputs[last_action]["joypad"] = last_event.button_index |
@ -0,0 +1,14 @@ |
|||||
|
extends Control |
||||
|
|
||||
|
|
||||
|
func _ready(): |
||||
|
get_name_node().set_text(local_storage.read_value("player_name", "Player")) |
||||
|
get_color_node().set_pick_color(Color(local_storage.read_value("player_color", "#000000"))) |
||||
|
|
||||
|
|
||||
|
func get_name_node(): |
||||
|
return find_node("name") |
||||
|
|
||||
|
|
||||
|
func get_color_node(): |
||||
|
return find_node("color") |
@ -0,0 +1,44 @@ |
|||||
|
extends Node |
||||
|
|
||||
|
signal connection_failed() |
||||
|
signal connection_succeeded() |
||||
|
signal server_disconnected() |
||||
|
|
||||
|
|
||||
|
func join_game(ip, port:int): |
||||
|
get_tree().connect("connected_to_server", self, "_connected_ok") |
||||
|
get_tree().connect("connection_failed", self, "_connected_fail") |
||||
|
get_tree().connect("server_disconnected", self, "_server_disconnected") |
||||
|
game.connect("game_ended",self,"_game_ended") |
||||
|
var host = NetworkedMultiplayerENet.new() |
||||
|
host.create_client(ip, port) |
||||
|
get_tree().set_network_peer(host) |
||||
|
|
||||
|
|
||||
|
func _connected_ok(): |
||||
|
game.rpc("set_player", get_tree().get_network_unique_id()) |
||||
|
emit_signal("connection_succeeded") |
||||
|
|
||||
|
|
||||
|
func _connected_fail(): |
||||
|
get_tree().disconnect("connected_to_server", self, "_connected_ok") |
||||
|
get_tree().disconnect("connection_failed", self, "_connected_fail") |
||||
|
get_tree().disconnect("server_disconnected", self, "_server_disconnected") |
||||
|
get_tree().set_network_peer(null) |
||||
|
emit_signal("connection_failed") |
||||
|
|
||||
|
|
||||
|
func _server_disconnected(): |
||||
|
game.quit_game() |
||||
|
emit_signal("server_disconnected") |
||||
|
|
||||
|
|
||||
|
func _game_ended(): |
||||
|
get_tree().disconnect("connected_to_server", self, "_connected_ok") |
||||
|
get_tree().disconnect("connection_failed", self, "_connected_fail") |
||||
|
get_tree().disconnect("server_disconnected", self, "_server_disconnected") |
||||
|
|
||||
|
game.disconnect("game_ended",self,"_game_ended") |
||||
|
|
||||
|
get_tree().set_refuse_new_network_connections(false) |
||||
|
get_tree().set_network_peer(null) |
@ -0,0 +1,14 @@ |
|||||
|
extends Spatial |
||||
|
|
||||
|
class_name GameServer |
||||
|
|
||||
|
const SERVER_ADDR = "127.0.0.1" |
||||
|
const API_ADDR = "http://" + SERVER_ADDR + ":5000/" |
||||
|
const HEADERS = ["Content-Type: application/json"] |
||||
|
const SSL = false |
||||
|
|
||||
|
|
||||
|
func http(): |
||||
|
var game_server_requests = GameServerRequests.new() |
||||
|
add_child(game_server_requests) |
||||
|
return game_server_requests |
@ -0,0 +1,35 @@ |
|||||
|
extends Spatial |
||||
|
|
||||
|
class_name GameServerRequests |
||||
|
|
||||
|
var http:HTTPRequest |
||||
|
|
||||
|
|
||||
|
func _ready(): |
||||
|
http = HTTPRequest.new() |
||||
|
add_child(http) |
||||
|
http.connect("request_completed",self, "_self_destroy") |
||||
|
|
||||
|
|
||||
|
func connect_http(node,function): |
||||
|
http.connect("request_completed",node,function) |
||||
|
|
||||
|
|
||||
|
func get_request(path:String): |
||||
|
http.request(game_server.API_ADDR + path, game_server.HEADERS, game_server.SSL, HTTPClient.METHOD_GET) |
||||
|
|
||||
|
|
||||
|
func post_request(path:String, data:String = ""): |
||||
|
http.request(game_server.API_ADDR + path, game_server.HEADERS, game_server.SSL, HTTPClient.METHOD_POST, data) |
||||
|
|
||||
|
|
||||
|
func put_request(path:String, data:String = ""): |
||||
|
http.request(game_server.API_ADDR + path, game_server.HEADERS, game_server.SSL, HTTPClient.METHOD_PUT, data) |
||||
|
|
||||
|
|
||||
|
func delete_request(path:String, data:String = ""): |
||||
|
http.request(game_server.API_ADDR + path, game_server.HEADERS, game_server.SSL, HTTPClient.METHOD_DELETE, data) |
||||
|
|
||||
|
|
||||
|
func _self_destroy(result, response_code, headers, body): |
||||
|
queue_free() |
@ -0,0 +1,156 @@ |
|||||
|
extends Node |
||||
|
|
||||
|
const MAX_PEERS = 4 |
||||
|
const LOBBY_READY_WAIT_TIME = 3 |
||||
|
const EMPTY_WAIT_TIME = 30 |
||||
|
|
||||
|
var port:int = -1 |
||||
|
var dedicated_server:bool = false |
||||
|
var server_secret:String = "" |
||||
|
var server_id:String = "[GAME:-1] " |
||||
|
|
||||
|
var timer:Timer |
||||
|
|
||||
|
signal server_error(type, data) |
||||
|
|
||||
|
|
||||
|
func _ready(): |
||||
|
for argument in OS.get_cmdline_args(): |
||||
|
if argument.split("=")[0] == "--port": |
||||
|
dedicated_server = true |
||||
|
port = int(argument.split("=")[1]) |
||||
|
if argument.split("=")[0] == "--server-id": |
||||
|
server_id = "[GAME:" + str(argument.split("=")[1]) + "] " |
||||
|
if argument.split("=")[0] == "--secret": |
||||
|
server_secret=argument.split("=")[1] |
||||
|
if argument.split("=")[0] == "--bots": |
||||
|
game.set_bots(bool(int(argument.split("=")[1]))) |
||||
|
|
||||
|
if dedicated_server: |
||||
|
var err = host_game(port) |
||||
|
if err == OK: |
||||
|
print(server_id + "New game hosted: port=" + str(port) + " secret=" + str(server_secret) + " bots=" + str(game.bots)) |
||||
|
else: |
||||
|
print(server_id + "Could not create Server! (port=" + str(port) + " secret=" + str(server_secret) + ")") |
||||
|
quit_server() |
||||
|
|
||||
|
|
||||
|
func host_game(port:int, set_bots:bool = false): |
||||
|
var host = NetworkedMultiplayerENet.new() |
||||
|
var err = host.create_server(port, MAX_PEERS) |
||||
|
get_tree().set_network_peer(host) |
||||
|
|
||||
|
get_tree().connect("network_peer_connected", self, "_client_connected") |
||||
|
get_tree().connect("network_peer_disconnected", self,"_client_disconnected") |
||||
|
|
||||
|
game.connect("players_changed",self,"_players_changed") |
||||
|
game.connect("game_ready",self,"_game_ready") |
||||
|
game.connect("game_ended",self,"_game_ended") |
||||
|
|
||||
|
if set_bots: |
||||
|
game.bots = true |
||||
|
|
||||
|
if timer == null: |
||||
|
timer = Timer.new() |
||||
|
timer.set_name("timer") |
||||
|
timer.set_timer_process_mode(Timer.TIMER_PROCESS_PHYSICS) |
||||
|
timer.set_one_shot(true) |
||||
|
timer.set_autostart(false) |
||||
|
add_child(timer) |
||||
|
|
||||
|
if err != OK: |
||||
|
emit_signal("server_error", "HOST", err) |
||||
|
|
||||
|
return err |
||||
|
|
||||
|
|
||||
|
func local_game(name:String, color:Color, bots:bool): |
||||
|
var localhost = NetworkedMultiplayerENet.new() |
||||
|
localhost.create_server(0, 0) |
||||
|
get_tree().set_network_peer(localhost) |
||||
|
game.bots = bots |
||||
|
game.set_player(get_tree().get_network_unique_id(), name, color) |
||||
|
game.prepare_game() |
||||
|
game.post_start_game() |
||||
|
|
||||
|
|
||||
|
func update_server_data(): |
||||
|
var req = game_server.http() |
||||
|
req.put_request("game",to_json({'secret' : server_secret, 'player_count' : game.players.size(), 'running' : game.game_running})) |
||||
|
|
||||
|
func _client_connected(id): |
||||
|
if get_tree().is_network_server(): |
||||
|
if dedicated_server: |
||||
|
print(server_id + "peer connected: " + str(id)) |
||||
|
game.rpc_id(id, "set_bots" ,game.bots) |
||||
|
if not timer.is_stopped(): |
||||
|
timer.disconnect("timeout",self,"quit_server") |
||||
|
timer.stop() |
||||
|
|
||||
|
|
||||
|
func _client_disconnected(id): |
||||
|
if get_tree().is_network_server(): |
||||
|
if dedicated_server: |
||||
|
print(server_id + "peer disconnected: " + str(id)) |
||||
|
if game.game_running: |
||||
|
emit_signal("server_error", "DISCONNECTED", [id]) |
||||
|
game.rpc("remove_player" ,id) |
||||
|
else: |
||||
|
game.rpc("remove_player" ,id) |
||||
|
|
||||
|
|
||||
|
func _players_changed(players): |
||||
|
if get_tree().is_network_server(): |
||||
|
if dedicated_server: |
||||
|
update_server_data() |
||||
|
if players.empty(): |
||||
|
if game.game_running: |
||||
|
print(server_id + "All players disconnected, close server.") |
||||
|
quit_server() |
||||
|
else: |
||||
|
print(server_id + "All players disconnected, wait for closing...") |
||||
|
timer.set_wait_time(EMPTY_WAIT_TIME) |
||||
|
timer.connect("timeout",self,"quit_server",[true]) |
||||
|
timer.start() |
||||
|
|
||||
|
|
||||
|
func quit_server(triggered:bool = false): |
||||
|
if dedicated_server && triggered: |
||||
|
print(server_id + "Closing time over...quit") |
||||
|
var req = game_server.http() |
||||
|
req.connect_http(self,"_on_delete_server") |
||||
|
req.delete_request("game",to_json({'secret' : server_secret})) |
||||
|
|
||||
|
|
||||
|
func _on_delete_server(result, response_code, headers, body): |
||||
|
if result != OK || response_code != HTTPClient.RESPONSE_OK: |
||||
|
print(server_id + "ERROR: _on_delete_server, server is in undefined state!") |
||||
|
|
||||
|
|
||||
|
func _start_game(): |
||||
|
if get_tree().is_network_server(): |
||||
|
get_tree().set_refuse_new_network_connections(true) |
||||
|
game.rpc("prepare_game") |
||||
|
|
||||
|
|
||||
|
func _game_ready(all_ready): |
||||
|
if get_tree().is_network_server(): |
||||
|
if all_ready: |
||||
|
timer.set_wait_time(LOBBY_READY_WAIT_TIME) |
||||
|
timer.connect("timeout",self,"_start_game") |
||||
|
timer.start() |
||||
|
else: |
||||
|
timer.disconnect("timeout",self,"_start_game") |
||||
|
timer.stop() |
||||
|
|
||||
|
|
||||
|
func _game_ended(): |
||||
|
get_tree().disconnect("network_peer_connected", self, "_client_connected") |
||||
|
get_tree().disconnect("network_peer_disconnected", self,"_client_disconnected") |
||||
|
|
||||
|
game.disconnect("players_changed",self,"_players_changed") |
||||
|
game.disconnect("game_ready",self,"_game_ready") |
||||
|
game.disconnect("game_ended",self,"_game_ended") |
||||
|
|
||||
|
get_tree().set_refuse_new_network_connections(false) |
||||
|
get_tree().set_network_peer(null) |
@ -1,37 +0,0 @@ |
|||||
extends Spatial |
|
||||
|
|
||||
var player:Player |
|
||||
var camera:InterpolatedCamera |
|
||||
|
|
||||
func _physics_process(delta): |
|
||||
if is_network_master() && player != null: |
|
||||
if player.is_out: |
|
||||
camera.set_speed(0.1) |
|
||||
if player.timer.get_time_left() > 0: |
|
||||
get_node("hud/reset").set_text(str(int(player.timer.get_time_left()) + 1)) |
|
||||
else: |
|
||||
get_node("hud/reset").set_text("reset") |
|
||||
if Input.is_action_pressed("ui_down"): |
|
||||
camera.set_speed(10) |
|
||||
player.reset() |
|
||||
get_node("hud/reset").set_text("") |
|
||||
else: |
|
||||
if Input.is_action_pressed("ui_up") && player.current_speed <= player.MAX_SPEED: |
|
||||
player.current_speed += player.speed_factor |
|
||||
elif Input.is_action_pressed("ui_down") && player.current_speed <= player.MAX_SPEED: |
|
||||
player.current_speed -= player.speed_factor |
|
||||
elif player.current_speed > 0: |
|
||||
player.current_speed -= player.speed_factor * player.brake_factor |
|
||||
elif player.current_speed < 0: |
|
||||
player.current_speed = 0 |
|
||||
|
|
||||
get_node("hud/speed").set_text(str(player.current_speed)) |
|
||||
|
|
||||
func set_player(path:String): |
|
||||
player = get_node(path) |
|
||||
get_node("inventory").set_player(player) |
|
||||
camera = InterpolatedCamera.new() |
|
||||
camera.set_target_path(path + "/Path/PathFollow/raceCar/CameraTarget") |
|
||||
camera.set_interpolation_enabled(true) |
|
||||
camera.set_speed(10) |
|
||||
add_child(camera) |
|
@ -0,0 +1,51 @@ |
|||||
|
extends Spatial |
||||
|
|
||||
|
var player:Player |
||||
|
onready var camera:InterpolatedCamera = get_node("camera") |
||||
|
|
||||
|
|
||||
|
func _physics_process(delta): |
||||
|
if is_network_master() && player != null: |
||||
|
if player.is_out: |
||||
|
camera.set_speed(0.1) |
||||
|
if player.timer.get_time_left() > 0: |
||||
|
get_node("hud/reset").set_text(str(int(player.timer.get_time_left()) + 1)) |
||||
|
else: |
||||
|
get_node("hud/reset").set_text(tr("RESET")) |
||||
|
if Input.is_action_pressed("controls_reset"): |
||||
|
if player.reset(): |
||||
|
camera.set_speed(10) |
||||
|
get_node("hud/reset").set_text("") |
||||
|
else: |
||||
|
if Input.is_action_pressed("controls_thrust") && player.current_speed <= player.MAX_SPEED: |
||||
|
player.current_speed += player.speed_factor |
||||
|
elif Input.is_action_pressed("controls_break") && player.current_speed <= player.MAX_SPEED: |
||||
|
player.current_speed -= player.speed_factor * player.brake_factor |
||||
|
elif player.current_speed > 0: |
||||
|
player.current_speed -= player.speed_factor * player.friction_brake_factor |
||||
|
elif player.current_speed < 0: |
||||
|
player.current_speed = 0 |
||||
|
|
||||
|
get_node("hud/speed").set_text(str(player.current_speed)) |
||||
|
|
||||
|
if Input.is_action_pressed("debug_camera_1"): |
||||
|
set_debug_camera(0) |
||||
|
elif Input.is_action_pressed("debug_camera_2"): |
||||
|
set_debug_camera(1) |
||||
|
elif Input.is_action_pressed("debug_camera_3"): |
||||
|
set_debug_camera(2) |
||||
|
elif Input.is_action_pressed("debug_camera_4"): |
||||
|
set_debug_camera(3) |
||||
|
|
||||
|
|
||||
|
func set_player(path:String): |
||||
|
player = get_node(path) |
||||
|
get_node("inventory").set_player(player) |
||||
|
camera.set_target_path(player.find_node("CameraTarget").get_path()) |
||||
|
camera.set_interpolation_enabled(true) |
||||
|
camera.set_speed(10) |
||||
|
|
||||
|
|
||||
|
func set_debug_camera(idx): |
||||
|
if idx < player.get_parent().get_child_count(): |
||||
|
camera.set_target_path(player.get_parent().get_child(idx).find_node("CameraTarget").get_path()) |
Write
Preview
Loading…
Cancel
Save
Reference in new issue