feat: 初步实现卡牌位置相关函数

This commit is contained in:
2026-03-31 20:02:46 +08:00
parent 588d812939
commit 3258c22b18
2 changed files with 8 additions and 0 deletions
+6
View File
@@ -12,3 +12,9 @@ func set_texture(pic: String) -> void:
func set_card(cname: String) -> void: func set_card(cname: String) -> void:
card_name = cname card_name = cname
set_texture("user://download/sources/%s/assets/pics/%s" % [DownloadManager.uuid, GameManager.pic_list[card_name]]) set_texture("user://download/sources/%s/assets/pics/%s" % [DownloadManager.uuid, GameManager.pic_list[card_name]])
func set_pos(x: int, y: int) -> void:
$Sprite.position = Vector2(x, y)
func get_pos() -> Vector2:
return $Sprite.position
+2
View File
@@ -8,6 +8,8 @@ func _ready() -> void:
init() init()
var card = create_card("Oxygen") var card = create_card("Oxygen")
card.show() card.show()
card.set_pos(300, 300)
print(card.get_pos())
func init() -> void: func init() -> void:
if multiplayer.is_server(): if multiplayer.is_server():