From 775f4c17a8ce36d6719787d5a858ede887cbd25b Mon Sep 17 00:00:00 2001 From: Ileyan <3003916@stud.hs-mannheim.de> Date: Sat, 30 Mar 2024 03:50:20 +0100 Subject: [PATCH] v.0.5.7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 5 Gewinnt kommt jetzt nur einmal vor - Glücksrad Ereignisse werden anzgezeigt in der GUI - GUI angepasst - Anzahl der benötigten Felder zum gewinnen wird jetzt angezeigt (Habs ausversehen Steine genannt lol) --- .DS_Store | Bin 6148 -> 6148 bytes assets/.DS_Store | Bin 0 -> 6148 bytes game.gd | 31 ++++++++++++++++++------- game.tscn | 59 ++++++++++++++++++++++++++++------------------- schnick.tscn | 18 +++++++++++++++ 5 files changed, 76 insertions(+), 32 deletions(-) create mode 100644 assets/.DS_Store create mode 100644 schnick.tscn diff --git a/.DS_Store b/.DS_Store index d9e6ac5dd4f3fedd130a16f8b31f0abd28e12e03..b90f04508e8a8ebd7f4855ff8d7f804c4671c927 100644 GIT binary patch delta 320 zcmZoMXfc@J&nU1lU^g?Pz+@g4{dzWrM22D@Ol2rxC{8LbE=bDBPhwzT*pXC_lUZD1 zU~r9*iJ66!jh%y?gPS8ZI3vG2xFoTpwAd-JC>q2I$5S!Fq!;>%lS{oE)6-0ut5Lrj|xJ3dTlewK@vb zmPQ6T3MR&8wY8iaqRRT#LGjr+xq10rK*s?ABO`=n;DypKsvF2a@l;uGQC?1dUOG@5 zq=%Iui6I~8=^};{&z$_to-Aoh{5-$_NM^`j$YaO^(%F;mu}bhTtOu&+`ws>a3r#n( IbNuB80DT!&s{jB1 delta 36 scmZoMXfc@J&&azmU^g=(?_?ep{mt5}B}|jAvm0z|&|uum&heKY0Lxno7XSbN diff --git a/assets/.DS_Store b/assets/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..79ff83a25d95fda9d5c733e6cacc640ba4bd2fb8 GIT binary patch literal 6148 zcmeHKOG*Pl5PhXt1hNUPvJv_O0dFvbxNz+SBvB*~onWHt*?Snz=Sp9F6z79W5v_vi zSKVEoo(Iz(0J3&er1dL zw(@Hy2fHcBKr)aFBm@7H0iM|^0*^v$gkmde#=|6;(z38Z{`iTbBTKbRU`7 dq|X<%=~o3dj+#ZsEu5Ga0V5=vWZ(xFcn33+Oi=&; literal 0 HcmV?d00001 diff --git a/game.gd b/game.gd index 2e63c7f..0f61f6f 100644 --- a/game.gd +++ b/game.gd @@ -14,13 +14,18 @@ var _sequence = [] @onready var diceSprite = $GUI/DiceSprite as Sprite2D @onready var player1Sprite = $GUI/Player1Sprite as Sprite2D @onready var player2Sprite = $GUI/Player2Sprite as Sprite2D +@onready var ereignis = $GUI/Event as Label +@onready var sequenz = $GUI/Sequenz as Label # Called when the node enters the scene tree for the first time. func _ready(): current_player = 0 + sequence_needed = 4 board.reset() won = "" + ereignis.text = "Ereignis: " + sequenz.text = "Steine zum gewinnen: 4" wonPlayer.hide() nextPlayer.region_rect.position.x = current_player * 300 nextPlayer.show() @@ -95,9 +100,9 @@ func _roll_dice() -> int: animation_help = zahl_davor await get_tree().create_timer(0.25).timeout - _update_dice_sprite(zahl) - print(zahl) #Debug ausgabe, später löschen lol + print(zahl) #Debug ausgabe, später löschen + return zahl @@ -166,30 +171,40 @@ func _instant_win(): #Zum Testen der Events func _on_test_pressed(): - board.delete_column(6) + ereignis.text += "test" func _spin_the_wheel(result: int) -> void: - if result <= 5: + ereignis.text = "Ereignis: " + if result <= 3: + ereignis.text += "Instant win!" _instant_win() elif result <= 15: - print("1 ding löschen")#Debug + ereignis.text += "Du darfst einen Stein entfernen!" if Input.is_action_just_pressed("Click"): var grid_pos = board.gridpos_at_mouse() board._clear_enemy_tile(grid_pos) elif result <= 30: + ereignis.text += "Symboltausch!" _change_symbols() elif result <= 45: - _five_wins() + if sequence_needed == 5: + print("lol") + _spin_the_wheel(randi() % 100 + 1) + else: + ereignis.text += "Ab jetzt gilt 5 - Gewinnt!" + sequenz.text = "Steine zum gewinnen: 5" + _five_wins() elif result <= 65: var zeile_zum_loeschen = randi() % 6 + 1 - print("delete column"+ zeile_zum_loeschen)#Debug + ereignis.text += "Zeile " + str(zeile_zum_loeschen) + " wird entfernt!" board.delete_column(zeile_zum_loeschen) elif result <= 85: var spalte_zum_loeschen = randi() % 6 + 1 - print("delete row" + spalte_zum_loeschen)#Debug + ereignis.text += "Spalte " + str(spalte_zum_loeschen) + " wird entfernt!" board.delete_row(spalte_zum_loeschen) elif result <= 100: + ereignis.text += str(result) print("größer als 85")#Debug diff --git a/game.tscn b/game.tscn index 5a63ac3..bb2e98e 100644 --- a/game.tscn +++ b/game.tscn @@ -24,10 +24,9 @@ offset_right = 1215.0 offset_bottom = 74.0 theme_override_font_sizes/font_size = 40 text = "Tic Tac Toe Extreme" -metadata/_edit_use_anchors_ = true [node name="NextPlayer" type="Sprite2D" parent="GUI"] -position = Vector2(1107.63, 239.75) +position = Vector2(1112, 240) scale = Vector2(1.0075, 0.995) texture = ExtResource("3_0333r") region_enabled = true @@ -41,10 +40,9 @@ offset_bottom = 277.5 size_flags_horizontal = 4 theme_override_font_sizes/font_size = 45 text = "Next:" -metadata/_edit_use_anchors_ = true [node name="WonPlayer" type="Sprite2D" parent="GUI"] -position = Vector2(1106, 341.5) +position = Vector2(1112, 336) scale = Vector2(0.999999, 0.995) texture = ExtResource("3_0333r") region_enabled = true @@ -58,10 +56,9 @@ offset_bottom = 378.5 size_flags_horizontal = 4 theme_override_font_sizes/font_size = 45 text = "Winner:" -metadata/_edit_use_anchors_ = true [node name="DiceSprite" type="Sprite2D" parent="GUI"] -position = Vector2(1197, 538) +position = Vector2(1198, 498) scale = Vector2(1.26596, 1.2191) texture = ExtResource("3_0333r") region_enabled = true @@ -69,36 +66,36 @@ region_rect = Rect2(207, 410, 85, 85) [node name="RestartButton" type="Button" parent="GUI"] offset_left = 866.0 -offset_top = 707.0 -offset_right = 1095.0 -offset_bottom = 827.0 +offset_top = 712.0 +offset_right = 1096.0 +offset_bottom = 832.0 theme_override_colors/font_color = Color(1, 0, 0, 1) theme_override_font_sizes/font_size = 30 text = "Restart" -metadata/_edit_use_anchors_ = true [node name="DiceButton" type="Button" parent="GUI"] -offset_left = 865.0 -offset_top = 480.0 +offset_left = 866.0 +offset_top = 440.0 offset_right = 1097.0 -offset_bottom = 600.0 +offset_bottom = 560.0 theme_override_font_sizes/font_size = 30 text = "Würfeln" -metadata/_edit_use_anchors_ = true [node name="Test" type="Button" parent="GUI"] -offset_left = 872.0 -offset_top = 605.0 -offset_right = 1096.0 -offset_bottom = 701.0 +offset_left = 1184.0 +offset_top = 640.0 +offset_right = 1416.0 +offset_bottom = 736.0 +rotation = 0.000312189 theme_override_font_sizes/font_size = 35 text = "Test" [node name="Spin the Wheel" type="Button" parent="GUI"] -offset_left = 1395.0 -offset_top = 691.0 -offset_right = 1710.0 -offset_bottom = 835.0 +offset_left = 866.0 +offset_top = 576.0 +offset_right = 1096.0 +offset_bottom = 696.0 +theme_override_font_sizes/font_size = 25 text = "Spin the Wheel" [node name="Player1Label" type="Label" parent="GUI"] @@ -108,7 +105,6 @@ offset_right = 350.0 offset_bottom = 108.0 theme_override_font_sizes/font_size = 45 text = "Player 1:" -metadata/_edit_use_anchors_ = true [node name="Player1Sprite" type="Sprite2D" parent="GUI"] position = Vector2(403, 79.1) @@ -124,7 +120,6 @@ offset_right = 684.0 offset_bottom = 108.1 theme_override_font_sizes/font_size = 45 text = "Player 2:" -metadata/_edit_use_anchors_ = true [node name="Player2Sprite" type="Sprite2D" parent="GUI"] position = Vector2(735.388, 78.0625) @@ -133,6 +128,22 @@ texture = ExtResource("3_0333r") region_enabled = true region_rect = Rect2(307, 108, 86, 86) +[node name="Event" type="Label" parent="GUI"] +offset_left = 312.0 +offset_top = 888.0 +offset_right = 517.0 +offset_bottom = 957.0 +theme_override_font_sizes/font_size = 50 +text = "Ereignis:" + +[node name="Sequenz" type="Label" parent="GUI"] +offset_left = 1256.0 +offset_top = 310.0 +offset_right = 2050.0 +offset_bottom = 379.0 +theme_override_font_sizes/font_size = 50 +text = "Steine zum gewinnen: " + [connection signal="pressed" from="GUI/RestartButton" to="." method="_on_restart_button_pressed"] [connection signal="pressed" from="GUI/DiceButton" to="." method="_on_dice_button_pressed"] [connection signal="pressed" from="GUI/Test" to="." method="_on_test_pressed"] diff --git a/schnick.tscn b/schnick.tscn new file mode 100644 index 0000000..b90d0da --- /dev/null +++ b/schnick.tscn @@ -0,0 +1,18 @@ +[gd_scene format=3 uid="uid://da75wsdk40fp4"] + +[node name="Schnick" type="Window"] +title = "Schere, Stein, Papier!" +initial_position = 1 +size = Vector2i(1500, 1000) + +[node name="Label" type="Label" parent="."] +anchors_preset = 10 +anchor_right = 1.0 +offset_bottom = 49.0 +grow_horizontal = 2 +size_flags_horizontal = 0 +size_flags_vertical = 0 +theme_override_font_sizes/font_size = 50 +text = "Du hast eine eins gewürfelt. + Was wählst du nun: Schere, Stein oder Papier?" +horizontal_alignment = 1