diff --git a/Assets/Textures/GUI/frame_player2.png b/Assets/Textures/GUI/frame_player2.png new file mode 100644 index 0000000..7dbf131 Binary files /dev/null and b/Assets/Textures/GUI/frame_player2.png differ diff --git a/Assets/Textures/GUI/frame_player2.png.import b/Assets/Textures/GUI/frame_player2.png.import new file mode 100644 index 0000000..341462e --- /dev/null +++ b/Assets/Textures/GUI/frame_player2.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://qud0m3iwlyed" +path="res://.godot/imported/frame_player2.png-43a6c06fdb2884e9016e890a7eb7af86.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://Assets/Textures/GUI/frame_player2.png" +dest_files=["res://.godot/imported/frame_player2.png-43a6c06fdb2884e9016e890a7eb7af86.ctex"] + +[params] + +compress/mode=0 +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/bptc_ldr=0 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/Assets/Textures/Opera_senza_titolo.png b/Assets/Textures/Gunpowder.png similarity index 100% rename from Assets/Textures/Opera_senza_titolo.png rename to Assets/Textures/Gunpowder.png diff --git a/Assets/Textures/Gunpowder.png.import b/Assets/Textures/Gunpowder.png.import new file mode 100644 index 0000000..a2e291e --- /dev/null +++ b/Assets/Textures/Gunpowder.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://clemmheiw1kq" +path="res://.godot/imported/Gunpowder.png-f662122f3929411add4bcd12f4c21e21.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://Assets/Textures/Gunpowder.png" +dest_files=["res://.godot/imported/Gunpowder.png-f662122f3929411add4bcd12f4c21e21.ctex"] + +[params] + +compress/mode=0 +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/bptc_ldr=0 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/Assets/Textures/Opera_senza_titolo (1).png b/Assets/Textures/Kohle.png similarity index 100% rename from Assets/Textures/Opera_senza_titolo (1).png rename to Assets/Textures/Kohle.png diff --git a/Assets/Textures/Kohle.png.import b/Assets/Textures/Kohle.png.import new file mode 100644 index 0000000..a29269f --- /dev/null +++ b/Assets/Textures/Kohle.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://dfqal4ri4ftrf" +path="res://.godot/imported/Kohle.png-2be21c5c26a72d51f2eb2ca2dbf16029.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://Assets/Textures/Kohle.png" +dest_files=["res://.godot/imported/Kohle.png-2be21c5c26a72d51f2eb2ca2dbf16029.ctex"] + +[params] + +compress/mode=0 +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/bptc_ldr=0 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/Nodes/UI.tscn b/Nodes/UI.tscn index 9e0f3d7..42541a9 100644 --- a/Nodes/UI.tscn +++ b/Nodes/UI.tscn @@ -1,7 +1,8 @@ -[gd_scene load_steps=6 format=3 uid="uid://cys06pnxfjl2m"] +[gd_scene load_steps=7 format=3 uid="uid://cys06pnxfjl2m"] [ext_resource type="Texture2D" uid="uid://b8rsm7uapp583" path="res://undefined - Imgur (1).png" id="1_cb7ct"] [ext_resource type="Texture2D" uid="uid://44lfs83sax35" path="res://undefined - Imgur.png" id="2_udann"] +[ext_resource type="PackedScene" uid="uid://dgr3cta6n1tg3" path="res://menu/stats_player_1.tscn" id="3_yhsvf"] [sub_resource type="StyleBoxTexture" id="StyleBoxTexture_fir3c"] @@ -61,3 +62,5 @@ max_value = 150.0 value = 50.0 editable = false scrollable = false + +[node name="Stats_Player1" parent="." instance=ExtResource("3_yhsvf")] diff --git a/Nodes/game.tscn b/Nodes/game.tscn index f420c01..02e9cb1 100644 --- a/Nodes/game.tscn +++ b/Nodes/game.tscn @@ -1,10 +1,10 @@ [gd_scene load_steps=11 format=3 uid="uid://b8u4bo4mklj55"] [ext_resource type="Script" path="res://scripts/Logic/Game.gd" id="1_dubwq"] -[ext_resource type="PackedScene" path="res://Nodes/light_setup.tscn" id="2_1lh4t"] +[ext_resource type="PackedScene" uid="uid://nxapkgcq2c70" path="res://Nodes/light_setup.tscn" id="2_1lh4t"] [ext_resource type="PackedScene" uid="uid://bqe8ucbruto1j" path="res://Nodes/StartNode.tscn" id="3_xcgy2"] [ext_resource type="PackedScene" uid="uid://md2ofbviios3" path="res://Nodes/Train_P1.tscn" id="4_gg4ea"] -[ext_resource type="PackedScene" path="res://Nodes/InfiniteScroller.tscn" id="5_3jhcw"] +[ext_resource type="PackedScene" uid="uid://bw3yluhr72n2t" path="res://Nodes/InfiniteScroller.tscn" id="5_3jhcw"] [ext_resource type="PackedScene" uid="uid://bikdn7ep2vpxw" path="res://Nodes/Train_P2.tscn" id="5_wi6pu"] [ext_resource type="PackedScene" uid="uid://cys06pnxfjl2m" path="res://Nodes/UI.tscn" id="6_eicse"] [ext_resource type="AudioStream" uid="uid://c5jhukuk8r3mf" path="res://Assets/Sounds/_MUSIC_/GameJamGameLoop.wav" id="7_wagg2"] diff --git a/menu/Speedometer.gd b/menu/Speedometer_player1.gd similarity index 67% rename from menu/Speedometer.gd rename to menu/Speedometer_player1.gd index 712c57b..97f6dcb 100644 --- a/menu/Speedometer.gd +++ b/menu/Speedometer_player1.gd @@ -1,7 +1,6 @@ extends CanvasLayer var currentSpeed - var maxSpeed = float(TrainEngine.maxSpeed) var minSpeed = 0.0 @@ -9,22 +8,20 @@ var deg var rad @onready var root = self.get_parent() - +#acceptable rotations range from -35 to +35 degrees func _ready(): #get Game Node reference while not root is Game: root = root.get_parent() - print(root.name) - print(maxSpeed) + print("maxSpeed =", maxSpeed) -#acceptable rotations range from -35 to +35 degrees func _process(delta): currentSpeed = root.p1_train.current_speed - deg = ((70.0/maxSpeed)* currentSpeed) - 35.0 - rad = (deg * 3.14)/180.0 + print("currentSpeed", currentSpeed) + deg = currentSpeed * (70.0/maxSpeed) - 35.0 + print(deg) + rad = (deg * 3.14) / 180 self.get_node("Pfeil").rotation = rad -func round_to_digit(num, digit): - return round(num * pow(10.0, digit)) / pow(10.0, digit) diff --git a/menu/Speedometer_player1.tscn b/menu/Speedometer_player1.tscn index 2924c08..b0159f6 100644 --- a/menu/Speedometer_player1.tscn +++ b/menu/Speedometer_player1.tscn @@ -1,12 +1,12 @@ -[gd_scene load_steps=5 format=3 uid="uid://cunv4n2t33057"] +[gd_scene load_steps=5 format=3 uid="uid://bxlhdan6h6qwi"] [ext_resource type="Texture2D" uid="uid://cj5tvg0uksgif" path="res://Assets/Textures/GUI/Speedometer_background.png" id="1_8h3os"] -[ext_resource type="Script" path="res://menu/Scripts/Speedometer.gd" id="1_qr0vh"] +[ext_resource type="Script" path="res://menu/Speedometer_player1.gd" id="1_8r0bw"] [ext_resource type="Texture2D" uid="uid://hy1r4mahhob2" path="res://Assets/Textures/GUI/Speedometer_pointer.png" id="2_vm8nm"] [ext_resource type="Texture2D" uid="uid://c8087dusjhilc" path="res://Assets/Textures/GUI/Speedometer_foreground.png" id="3_7tp67"] [node name="Speedometer" type="CanvasLayer"] -script = ExtResource("1_qr0vh") +script = ExtResource("1_8r0bw") [node name="Background" type="TextureRect" parent="."] offset_right = 472.0 diff --git a/menu/main_menu.tscn b/menu/main_menu.tscn index 5ea61d5..0c6fa65 100644 --- a/menu/main_menu.tscn +++ b/menu/main_menu.tscn @@ -13,7 +13,6 @@ grow_vertical = 2 script = ExtResource("1_hyw8p") [node name="ColorRect" type="ColorRect" parent="."] -layout_mode = 1 anchors_preset = 15 anchor_right = 1.0 anchor_bottom = 1.0 @@ -22,7 +21,6 @@ grow_vertical = 2 color = Color(0.513726, 0.403922, 0.27451, 1) [node name="VBoxContainer" type="VBoxContainer" parent="."] -layout_mode = 1 anchors_preset = 8 anchor_left = 0.5 anchor_top = 0.5 @@ -36,31 +34,42 @@ grow_horizontal = 2 grow_vertical = 2 [node name="Start" type="Button" parent="VBoxContainer"] -layout_mode = 2 +offset_right = 87.0 +offset_bottom = 31.0 text = "Start " [node name="Tutorial" type="Button" parent="VBoxContainer"] -layout_mode = 2 +offset_top = 35.0 +offset_right = 87.0 +offset_bottom = 66.0 text = "Tutorial " [node name="Settings" type="Button" parent="VBoxContainer"] -layout_mode = 2 +offset_top = 70.0 +offset_right = 87.0 +offset_bottom = 101.0 text = "Volume:" [node name="VolSlider" type="HSlider" parent="VBoxContainer"] -layout_mode = 2 +offset_top = 105.0 +offset_right = 87.0 +offset_bottom = 121.0 min_value = -30.0 max_value = 0.0 script = ExtResource("2_h85ei") [node name="Quit" type="Button" parent="VBoxContainer"] -layout_mode = 2 +offset_top = 125.0 +offset_right = 87.0 +offset_bottom = 156.0 text = "Quit" [node name="FullScreen" type="Button" parent="VBoxContainer"] -layout_mode = 2 +offset_top = 160.0 +offset_right = 87.0 +offset_bottom = 191.0 text = "Fullscreen" [connection signal="pressed" from="VBoxContainer/Start" to="." method="_on_start_pressed"] diff --git a/menu/stats_player_1.gd b/menu/stats_player_1.gd new file mode 100644 index 0000000..66330fd --- /dev/null +++ b/menu/stats_player_1.gd @@ -0,0 +1,5 @@ +extends CanvasLayer + +func _ready(): + var hbox = self.get_node("Rahmen/Ressourcen/RessourcenBox") + hbox.add_spacer(true) diff --git a/menu/stats_player_1.tscn b/menu/stats_player_1.tscn index a60e864..20e6b03 100644 --- a/menu/stats_player_1.tscn +++ b/menu/stats_player_1.tscn @@ -1,9 +1,14 @@ -[gd_scene load_steps=3 format=3 uid="uid://c8als41yc56ep"] +[gd_scene load_steps=7 format=3 uid="uid://dgr3cta6n1tg3"] -[ext_resource type="PackedScene" uid="uid://cunv4n2t33057" path="res://menu/Speedometer_player1.tscn" id="1_8v7ps"] +[ext_resource type="Script" path="res://menu/stats_player_1.gd" id="1_7a1hg"] +[ext_resource type="PackedScene" uid="uid://bxlhdan6h6qwi" path="res://menu/Speedometer_player1.tscn" id="1_8v7ps"] [ext_resource type="Texture2D" uid="uid://c62xglrjom4sn" path="res://Assets/Textures/GUI/frame_player1.png" id="2_1uihe"] +[ext_resource type="Texture2D" uid="uid://dfqal4ri4ftrf" path="res://Assets/Textures/Kohle.png" id="3_tjc2l"] +[ext_resource type="Texture2D" uid="uid://clemmheiw1kq" path="res://Assets/Textures/Gunpowder.png" id="4_jn38u"] +[ext_resource type="Texture2D" uid="uid://bhmyyu0uhx541" path="res://Assets/Textures/Opera_senza_titolo (2).png" id="5_b5gk5"] [node name="Stats_Player1" type="CanvasLayer"] +script = ExtResource("1_7a1hg") [node name="Speedometer_player1" parent="." instance=ExtResource("1_8v7ps")] scale = Vector2(0.4, 0.4) @@ -18,28 +23,60 @@ scale = Vector2(0.5, 0.5) texture = ExtResource("2_1uihe") [node name="Ressourcen" type="CanvasLayer" parent="Rahmen"] +offset = Vector2(0, 220) +scale = Vector2(0.02, 0.02) +transform = Transform2D(0.02, 0, 0, 0.02, 0, 220) -[node name="HBoxContainer" type="HBoxContainer" parent="Rahmen/Ressourcen"] +[node name="RessourcenBox" type="HBoxContainer" parent="Rahmen/Ressourcen"] +custom_minimum_size = Vector2(100, 20) offset_left = 40.0 offset_top = 226.0 offset_right = 123.0 offset_bottom = 256.0 -[node name="VBoxContainer" type="VBoxContainer" parent="Rahmen/Ressourcen/HBoxContainer"] -offset_right = 10.0 -offset_bottom = 30.0 +[node name="Kohle" type="VBoxContainer" parent="Rahmen/Ressourcen/RessourcenBox"] +offset_right = 945.0 +offset_bottom = 977.0 -[node name="TextureRect" type="TextureRect" parent="Rahmen/Ressourcen/HBoxContainer/VBoxContainer"] -offset_right = 10.0 +[node name="TextureRect" type="TextureRect" parent="Rahmen/Ressourcen/RessourcenBox/Kohle"] +offset_right = 945.0 +offset_bottom = 931.0 +texture = ExtResource("3_tjc2l") -[node name="Label" type="Label" parent="Rahmen/Ressourcen/HBoxContainer/VBoxContainer"] -offset_top = 4.0 -offset_right = 10.0 -offset_bottom = 30.0 +[node name="Label" type="Label" parent="Rahmen/Ressourcen/RessourcenBox/Kohle"] +offset_top = 935.0 +offset_right = 945.0 +offset_bottom = 961.0 text = "5 " -[node name="VBoxContainer2" type="VBoxContainer" parent="Rahmen/Ressourcen/HBoxContainer"] -offset_left = 14.0 -offset_right = 14.0 -offset_bottom = 30.0 +[node name="GunPowder" type="VBoxContainer" parent="Rahmen/Ressourcen/RessourcenBox"] +offset_left = 949.0 +offset_right = 1894.0 +offset_bottom = 977.0 + +[node name="TextureRect" type="TextureRect" parent="Rahmen/Ressourcen/RessourcenBox/GunPowder"] +offset_right = 945.0 +offset_bottom = 931.0 +texture = ExtResource("4_jn38u") + +[node name="Label" type="Label" parent="Rahmen/Ressourcen/RessourcenBox/GunPowder"] +offset_top = 935.0 +offset_right = 945.0 +offset_bottom = 958.0 + +[node name="Munition" type="VBoxContainer" parent="Rahmen/Ressourcen/RessourcenBox"] +offset_left = 1898.0 +offset_right = 2843.0 +offset_bottom = 977.0 + +[node name="MunitionSprite" type="TextureRect" parent="Rahmen/Ressourcen/RessourcenBox/Munition"] +offset_right = 945.0 +offset_bottom = 931.0 +texture = ExtResource("5_b5gk5") + +[node name="Label" type="Label" parent="Rahmen/Ressourcen/RessourcenBox/Munition"] +offset_top = 935.0 +offset_right = 945.0 +offset_bottom = 977.0 +theme_override_font_sizes/font_size = 30