v.0.6.4: Dead Zones hinzugefügt

Ja, mir ist kein besserer Name eingefallen xD

Hab btw die GUI wieder bissl geändert lol
main
Ileyan Al Jaaf 2024-04-01 18:17:58 +02:00
parent 331e63f7e3
commit e8f7cb1f3f
5 changed files with 60 additions and 14 deletions

BIN
assets/skull.png 100644

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.9 KiB

View File

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://cxsd3rd3k3eaj"
path="res://.godot/imported/skull.png-b3e3a5526e5abbe508c3491f9d549a8b.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://assets/skull.png"
dest_files=["res://.godot/imported/skull.png-b3e3a5526e5abbe508c3491f9d549a8b.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
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

21
game.gd
View File

@ -41,7 +41,7 @@ func _ready():
board.reset()
won = ""
ereignis.text = "Ereignis: "
sequenz.text = "Steine zum gewinnen: 4"
sequenz.text = "4 - Gewinnt!"
wonPlayer.hide()
nextPlayer.region_rect.position.x = current_player * 300
nextPlayer.show()
@ -52,7 +52,7 @@ func _ready():
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(_delta):
if won == "":
if Input.is_action_just_pressed("Click") and move_allowed:
if Input.is_action_just_pressed("Click") and move_allowed and !luckyWheel.wheelActive:
var grid_pos = board.gridpos_at_mouse()
if enable_remove:
print(grid_pos)
@ -232,7 +232,8 @@ func _instant_loose():
#Zum Testen der Events
func _on_test_pressed():
get_tree().change_scene_to_file("res://lucky_wheel.tscn")
var rand = randi() % 6 + 1
_dead_zone(rand)
func _spin_the_wheel(result: int) -> void:
@ -258,7 +259,7 @@ func _spin_the_wheel(result: int) -> void:
_spin_the_wheel(randi() % 100 + 1)
else:
ereignis.text += "Ab jetzt gilt 5 - Gewinnt!"
sequenz.text = "Steine zum gewinnen: 5"
sequenz.text = "5 - Gewinnt!"
_five_wins()
elif result <= 65:
var zeile_zum_loeschen = randi() % 6 + 1
@ -271,10 +272,16 @@ func _spin_the_wheel(result: int) -> void:
await get_tree().create_timer(6).timeout
board.delete_row(spalte_zum_loeschen)
elif result <= 100:
ereignis.text += str(result)
print("größer als 85")#Debug
var spalte = randi() % 6 + 1
ereignis.text += "Totes Feld in Spalte " + str(spalte)
_dead_zone(spalte)
func _dead_zone(spalte :int):
var pos = board._calculate_drop_pos(Vector2(spalte-3,0))
board.set_state(pos, "Triangle2")
#Am Glücksrad drehen
func _on_spin_the_wheel_pressed():
if wheel_spin_allowed:
@ -293,6 +300,7 @@ func switch_to_schnick():
schnick.show()
func switch_to_wheel():
luckyWheel.wheelActive = true
move_allowed = false
gui.hide()
numbers.hide()
@ -300,6 +308,7 @@ func switch_to_wheel():
luckyWheel.show()
func switch_to_game():
luckyWheel.wheelActive = false
move_allowed = true
gui.show()
numbers.show()

View File

@ -20,6 +20,7 @@ position = Vector2(879, 280)
layer_0/tile_data = PackedInt32Array(65537, 1, 0, 131073, 1, 0, 131074, 1, 0, 0, 1, 0, 65536, 1, 0, 131072, 1, 0, 1, 1, 0, 2, 1, 0, 65538, 1, 0, 65534, 1, 0, 131070, 1, 0, 131071, 1, 0, 196607, 1, 0, 65535, 1, 0, 196606, 1, 0, 262142, 1, 0, 327678, 1, 0, 393214, 1, 0, 393215, 1, 0, 327680, 1, 0, 327681, 1, 0, 327682, 1, 0, 327683, 1, 0, 262147, 1, 0, 196611, 1, 0, 131075, 1, 0, 65539, 1, 0, 3, 1, 0, 196610, 1, 0, 262146, 1, 0, 262145, 1, 0, 196609, 1, 0, 262144, 1, 0, 196608, 1, 0, 327679, 1, 0, 262143, 1, 0)
[node name="BlindBoard" parent="." instance=ExtResource("1_ym80r")]
visible = false
position = Vector2(879, 280)
layer_0/tile_data = PackedInt32Array(65537, 196609, 0, 131073, 196609, 0, 131074, 196609, 0, 0, 196609, 0, 65536, 196609, 0, 131072, 196609, 0, 1, 196609, 0, 2, 196609, 0, 65538, 196609, 0, 65534, 196609, 0, 131070, 196609, 0, 131071, 196609, 0, 196607, 196609, 0, 65535, 196609, 0, 196606, 196609, 0, 262142, 196609, 0, 327678, 196609, 0, 393214, 196609, 0, 393215, 196609, 0, 327680, 196609, 0, 327681, 196609, 0, 327682, 196609, 0, 327683, 196609, 0, 262147, 196609, 0, 196611, 196609, 0, 131075, 196609, 0, 65539, 196609, 0, 3, 196609, 0, 196610, 196609, 0, 262146, 196609, 0, 262145, 196609, 0, 196609, 196609, 0, 262144, 196609, 0, 196608, 196609, 0, 327679, 196609, 0, 262143, 196609, 0)
@ -116,7 +117,7 @@ offset_top = 473.15
offset_right = 331.0
offset_bottom = 556.15
theme_override_font_sizes/font_size = 60
text = "Player 1:"
text = "Spieler 1:"
[node name="Player1Sprite" type="Sprite2D" parent="GUI"]
texture_filter = 1
@ -132,7 +133,7 @@ offset_top = 629.3
offset_right = 331.0
offset_bottom = 712.3
theme_override_font_sizes/font_size = 60
text = "Player 2:"
text = "Spieler 2:"
[node name="Player2Sprite" type="Sprite2D" parent="GUI"]
texture_filter = 1
@ -151,12 +152,13 @@ theme_override_font_sizes/font_size = 50
text = "Ereignis:"
[node name="Sequenz" type="Label" parent="GUI"]
offset_left = 20.0
offset_top = 199.0
offset_right = 814.0
offset_bottom = 268.0
theme_override_font_sizes/font_size = 50
text = "Steine zum gewinnen: "
offset_left = 108.0
offset_top = 362.0
offset_right = 902.0
offset_bottom = 445.0
theme_override_colors/font_color = Color(0.282353, 0.560784, 0.772549, 1)
theme_override_font_sizes/font_size = 55
text = "4 - Gewinnt!"
[node name="Schnick" type="Node2D" parent="."]
visible = false

View File

@ -5,6 +5,7 @@ extends Control
@export var power: int = 2
@export var reward_position = 0
@export var spun = false
@export var wheelActive = false
signal sig_reward
var vat_pham = [
{