added test stickman card deck textures

This commit is contained in:
2025-07-14 22:00:59 +02:00
parent 59ff9a429a
commit 8dde6a813f
124 changed files with 2167 additions and 7 deletions
+62 -4
View File
@@ -4,6 +4,10 @@ extends Node
@export var card_textures: Dictionary[int, Texture]
@export var card_fallback_texture: Texture
enum CardStyle {
STICKMAN,
}
func get_shuffled_cards(client_ids: Array[String], cards_to_pick: int) -> Dictionary: # Dictionary[String, Array[int]]
var dict: Dictionary = {}
var deck: Array[int] = full_deck.keys()
@@ -24,8 +28,62 @@ func get_shuffled_cards(client_ids: Array[String], cards_to_pick: int) -> Dictio
return dict
func get_card_texture(card_id: int) -> Texture:
if card_textures.has(card_id):
return card_textures[card_id]
func get_card_texture(card_id: int, style: CardStyle = CardStyle.STICKMAN) -> Texture:
#if card_textures.has(card_id):
#return card_textures[card_id]
var style_name: String = ""
match style:
CardStyle.STICKMAN:
style_name = "stickman"
var a = "res://cards/textures/" + style_name + "/" + _get_card_name(card_id) + ".webp"
print(a)
return load(a)
return card_fallback_texture
#return card_fallback_texture
func _get_card_name(card_id: int) -> String:
var color: String
var suffix: String
if card_id < 13:
color = "blue"
elif card_id < 26:
color = "green"
elif card_id < 39:
color = "violet"
else:
color = "orange"
match card_id:
0, 13, 26, 39:
suffix = "1"
1, 14, 27, 40:
suffix = "2"
2, 15, 28, 41:
suffix = "3"
3, 16, 29, 42:
suffix = "4"
4, 17, 30, 43:
suffix = "5"
5, 18, 31, 44:
suffix = "6"
6, 19, 32, 45:
suffix = "7"
7, 20, 33, 46:
suffix = "8"
8, 21, 34, 47:
suffix = "9"
9, 22, 35, 48:
suffix = "10"
10, 23, 36, 49:
suffix = "11"
11, 24, 37, 50:
suffix = "12"
12, 25, 38, 51:
suffix = "13"
52, 53, 54, 55:
suffix = "joker"
56, 57, 58, 59:
suffix = "magician"
return color + "_" + suffix