client: cards can now be clicked

This commit is contained in:
2025-07-08 16:48:41 +02:00
parent a7ea8510f7
commit 167b455160
3 changed files with 25 additions and 10 deletions
+14 -6
View File
@@ -17,15 +17,23 @@ func _ready() -> void:
func move_to(new_x_position: float) -> void:
#self.position.x = new_x_position
var tween = create_tween()
tween.set_trans(Tween.TRANS_BACK)
tween.set_ease(Tween.EASE_OUT)
tween.tween_property(self, "position:x", new_x_position, move_duration)
_get_new_tween().tween_property(self, "position:x", new_x_position, move_duration)
func select() -> void:
_get_new_tween().tween_property(self, "position:y", 0.36, move_duration)
func unselect() -> void:
_get_new_tween().tween_property(self, "position:y", 0.0, move_duration)
func set_front_texture(texture: Texture) -> void:
card_mesh.get_surface_override_material(0).albedo_texture = front_texture
func _get_new_tween() -> Tween:
var tween = create_tween()
tween.set_trans(Tween.TRANS_BACK)
tween.set_ease(Tween.EASE_OUT)
return tween
func _on_input_event(camera: Node, event: InputEvent, event_position: Vector3, normal: Vector3, shape_idx: int) -> void:
if event.is_action_pressed("left_mouse_button"):
print("yahaha!")
if event.is_action_released("left_mouse_button"):
card_clicked.emit(self)