func: turn

This commit is contained in:
Aspergerli
2026-03-19 11:48:25 +01:00
parent 637eaaca30
commit 5d937e42d7
4 changed files with 34 additions and 7 deletions

View File

@@ -0,0 +1,14 @@
extends Pile
signal played
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
pass # Replace with function body.
func play_check():
print("waiting")
enable_drop_zone = true
while true:
if get_top_cards(1) != null:
played.emit()
break

View File

@@ -0,0 +1 @@
uid://be2xbeq4mjtyi

View File

@@ -7,6 +7,7 @@
[ext_resource type="Curve" uid="uid://bpxa7v4vk7pod" path="res://resources/Hand_Curve.tres" id="5_kdjyk"] [ext_resource type="Curve" uid="uid://bpxa7v4vk7pod" path="res://resources/Hand_Curve.tres" id="5_kdjyk"]
[ext_resource type="Curve" uid="uid://c2d322obqbcgc" path="res://resources/Hand_Curve_Vert.tres" id="6_ikr1a"] [ext_resource type="Curve" uid="uid://c2d322obqbcgc" path="res://resources/Hand_Curve_Vert.tres" id="6_ikr1a"]
[ext_resource type="Script" uid="uid://6ams8uvg43gu" path="res://addons/card-framework/pile.gd" id="7_rwigh"] [ext_resource type="Script" uid="uid://6ams8uvg43gu" path="res://addons/card-framework/pile.gd" id="7_rwigh"]
[ext_resource type="Script" uid="uid://be2xbeq4mjtyi" path="res://scenes/player_1_play_pile.gd" id="8_el68r"]
[ext_resource type="Texture2D" uid="uid://jxi7my6yp71x" path="res://icon.svg" id="8_waqni"] [ext_resource type="Texture2D" uid="uid://jxi7my6yp71x" path="res://icon.svg" id="8_waqni"]
[ext_resource type="Texture2D" uid="uid://besq7oa4a37mb" path="res://icon_red_background.webp" id="9_ggwjq"] [ext_resource type="Texture2D" uid="uid://besq7oa4a37mb" path="res://icon_red_background.webp" id="9_ggwjq"]
[ext_resource type="Curve" uid="uid://ddxsxuabgpk7w" path="res://resources/Hand_Curve_invert.tres" id="10_kdjyk"] [ext_resource type="Curve" uid="uid://ddxsxuabgpk7w" path="res://resources/Hand_Curve_invert.tres" id="10_kdjyk"]
@@ -17,9 +18,6 @@
[ext_resource type="Texture2D" uid="uid://dvqxm048cpqso" path="res://cards/images/cardDiamondsJ.png" id="14_el68r"] [ext_resource type="Texture2D" uid="uid://dvqxm048cpqso" path="res://cards/images/cardDiamondsJ.png" id="14_el68r"]
[ext_resource type="Texture2D" uid="uid://d0fi2w3eqskmy" path="res://cards/images/cardClubsJ.png" id="15_ir868"] [ext_resource type="Texture2D" uid="uid://d0fi2w3eqskmy" path="res://cards/images/cardClubsJ.png" id="15_ir868"]
[sub_resource type="CanvasTexture" id="CanvasTexture_ggwjq"]
diffuse_texture = ExtResource("8_waqni")
[sub_resource type="CanvasTexture" id="CanvasTexture_unpya"] [sub_resource type="CanvasTexture" id="CanvasTexture_unpya"]
diffuse_texture = ExtResource("9_ggwjq") diffuse_texture = ExtResource("9_ggwjq")
@@ -73,8 +71,10 @@ offset_left = 790.0
offset_top = 560.0 offset_top = 560.0
offset_right = 790.0 offset_right = 790.0
offset_bottom = 560.0 offset_bottom = 560.0
script = ExtResource("7_rwigh") script = ExtResource("8_el68r")
sensor_texture = SubResource("CanvasTexture_ggwjq") stack_display_gap = 1
max_stack_display = 1
sensor_texture = ExtResource("8_waqni")
sensor_visibility = true sensor_visibility = true
metadata/_custom_type_script = "uid://6ams8uvg43gu" metadata/_custom_type_script = "uid://6ams8uvg43gu"
@@ -109,6 +109,7 @@ offset_top = 560.0
offset_right = 980.0 offset_right = 980.0
offset_bottom = 560.0 offset_bottom = 560.0
script = ExtResource("7_rwigh") script = ExtResource("7_rwigh")
enable_drop_zone = false
sensor_texture = SubResource("CanvasTexture_kdjyk") sensor_texture = SubResource("CanvasTexture_kdjyk")
sensor_visibility = true sensor_visibility = true
metadata/_custom_type_script = "uid://6ams8uvg43gu" metadata/_custom_type_script = "uid://6ams8uvg43gu"
@@ -142,6 +143,7 @@ offset_top = 330.0
offset_right = 980.0 offset_right = 980.0
offset_bottom = 330.0 offset_bottom = 330.0
script = ExtResource("7_rwigh") script = ExtResource("7_rwigh")
enable_drop_zone = false
sensor_texture = ExtResource("8_waqni") sensor_texture = ExtResource("8_waqni")
sensor_visibility = true sensor_visibility = true
metadata/_custom_type_script = "uid://6ams8uvg43gu" metadata/_custom_type_script = "uid://6ams8uvg43gu"
@@ -166,6 +168,7 @@ offset_top = 330.0
offset_right = 790.0 offset_right = 790.0
offset_bottom = 330.0 offset_bottom = 330.0
script = ExtResource("7_rwigh") script = ExtResource("7_rwigh")
enable_drop_zone = false
sensor_texture = ExtResource("8_waqni") sensor_texture = ExtResource("8_waqni")
sensor_visibility = true sensor_visibility = true
metadata/_custom_type_script = "uid://6ams8uvg43gu" metadata/_custom_type_script = "uid://6ams8uvg43gu"

View File

@@ -3,10 +3,15 @@ extends Node2D
@onready var card_manager = $CardManager @onready var card_manager = $CardManager
@onready var deck = $CardManager/deck @onready var deck = $CardManager/deck
@onready var player_1_hand = $CardManager/Player1Hand @onready var player_1_hand = $CardManager/Player1Hand
@onready var player_1_pile = $CardManager/Player1PlayPile
@onready var player_2_hand = $CardManager/Player2Hand @onready var player_2_hand = $CardManager/Player2Hand
@onready var player_2_pile = $CardManager/Player2PlayPile
@onready var player_3_hand = $CardManager/Player3Hand @onready var player_3_hand = $CardManager/Player3Hand
@onready var player_3_pile = $CardManager/Player3PlayPile
@onready var player_4_hand = $CardManager/Player4Hand @onready var player_4_hand = $CardManager/Player4Hand
@onready var player_4_pile = $CardManager/Player4PlayPile
@onready var trumpbuttons = $ButtonsTrumpSelect @onready var trumpbuttons = $ButtonsTrumpSelect
@onready var first_player = $CardManager/Player1PlayPile
var trump : String var trump : String
signal dealt signal dealt
@@ -46,9 +51,13 @@ func setup_game():
trumpbuttons.visible = true trumpbuttons.visible = true
func define_trump(suit : String): func define_trump(suit : String):
print(suit) trump = suit
turn(first_player)
func turn(first):
first.play_check()
await first.played
first.enable_drop_zone = false
func create_standard_deck(): func create_standard_deck():
var suits = ["Club", "Diamond", "Heart", "Spade"] var suits = ["Club", "Diamond", "Heart", "Spade"]