-
Notifications
You must be signed in to change notification settings - Fork 1
/
Main.gd
100 lines (83 loc) · 2.14 KB
/
Main.gd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
extends Node2D
onready var Player = $CardController/PlayerHand
onready var Enemy = $CardController/EnemyHand
onready var Table = $CardController/Table
onready var Deck = $CardController/Deck
onready var Alert = $UI
enum {intro, warflop, turn, river, showdown}
var state
func _ready():
state = warflop
play_warflop()
func _process(delta):
pass
func play_warflop():
yield(get_tree().create_timer(0.5),"timeout")
get_tree().call_group("players", "draw_cards", 3)
yield(get_tree().create_timer(1.0),"timeout")
Table.draw_flop()
Alert.send_alert("select war card")
# Declare member variables here. Examples:
# var a = 2
# var b = "text"
#onready var table = $CardController/Table
#
#var playerdeck = []
#var enemydeck = []
#var tablecards = []
#
#signal deal_hand
#
#func _ready():
# randomize()
# get_player_deck()
# play_poker(1)
#
#func play_poker(lvl):
# deal_hand(3)
# deal_hand(3, "table")
## deal_hand(3, "enemy")
# deal_flop()
#
#func get_player_deck():
# playerdeck = $CardController/Deck.default_deck()
# playerdeck.shuffle()
# table.make_player_deck(playerdeck)
#
#func deal_hand(num, holder = "player"):
# emit_signal("deal_hand", num, holder)
#
#func deal_flop():
# table.deal_street(1)
#
#
#func _on_PlayTarget_area_entered(area):
# area.set_play_area()
#
#func _on_PlayTarget_area_exited(area):
# area.unset_play_area()
#func _on_Table_update_deck_count(deck):
# $CardsInDeck.text = "Cards in Deck: " + str(deck.size())
#
#func _on_Table_update_discard_count(discard):
# $CardsInDiscard.text = "Cards in Discard: " + str(discard.size())
#
#func _on_Table_update_hand_count(hand):
# $CardsInHand.text = "Cards in Hand: " + str(hand.size())
#func _on_Button_pressed():
# $Table.draw_cards(1)
#
#func _on_DeckButton_pressed():
# $Table.draw_cards(1)
#func _on_DeckOnScreen_toggled(button_pressed):#button_pressed arg removed
# if get_node("VBoxContainer/DeckOnScreen").pressed:
# $Deck.deck_on_screen = true
# $DeckButton.visible = true
# else:
# $Deck.deck_on_screen = false
# $DeckButton.visible = false
#func _on_AddCard_pressed():
# playerdeck.append($Library.get_random_card())
# _on_Table_update_deck_count(playerdeck)
func _on_Timer_timeout():
pass