diff --git a/objects/card/card.gd b/objects/card/card.gd index 72b76c1..4e6bcb9 100644 --- a/objects/card/card.gd +++ b/objects/card/card.gd @@ -25,6 +25,7 @@ var is_shaking := false func _ready(): origin_global_position = global_position last_global_position = global_position + $HighlightSprite.visible = false func _on_mouse_release(): #prints(entered_area.name, is_card_entered, entered_area.occupied) @@ -135,22 +136,22 @@ func shake(is_letter_red: bool, amount: float, duration: float) -> void: if is_letter_red: $Word.set_color(ImageLib.PALETTE["red"]) else: - $CardBackSprite.animation = "default" + $HighlightSprite.visible = false + func _on_mouse_entered(): - $CardBackSprite.animation = "highlighted" + $HighlightSprite.visible = true Input.set_default_cursor_shape(Input.CURSOR_POINTING_HAND) func _on_mouse_exited(): - $CardBackSprite.animation = "default" + $HighlightSprite.visible = false Input.set_default_cursor_shape(Input.CURSOR_ARROW) func set_color(value: Color) -> void: $Word.set_color(value) - func set_victory(v: bool): if v: $CollisionShape2D.set_deferred("disabled", true) diff --git a/objects/card/card.tscn b/objects/card/card.tscn index 531bdc5..8f54e54 100644 --- a/objects/card/card.tscn +++ b/objects/card/card.tscn @@ -5,11 +5,9 @@ [ext_resource type="Texture2D" uid="uid://cfbqh1k0etr6g" path="res://objects/card/card1.png" id="3_o4f0v"] [ext_resource type="Texture2D" uid="uid://c8qjbksyn1bqt" path="res://objects/card/card2.png" id="4_c30j1"] [ext_resource type="Texture2D" uid="uid://bevrfq1hhyqwe" path="res://objects/card/card3.png" id="5_w81n3"] -[ext_resource type="Texture2D" uid="uid://cmcc5xrpkrd0f" path="res://objects/card/card_highlighted.png" id="6_po2i6"] +[ext_resource type="Texture2D" uid="uid://pmapbo480in1" path="res://objects/card/card_highlight_border.png" id="7_kix4t"] [ext_resource type="AudioStream" uid="uid://cj4v8ehypq3sk" path="res://objects/card/put_down.wav" id="7_u4ylf"] -[sub_resource type="RectangleShape2D" id="RectangleShape2D_gu6l6"] - [sub_resource type="SpriteFrames" id="SpriteFrames_fo0r0"] animations = [{ "frames": [{ @@ -25,16 +23,10 @@ animations = [{ "loop": true, "name": &"default", "speed": 5.0 -}, { -"frames": [{ -"duration": 1.0, -"texture": ExtResource("6_po2i6") -}], -"loop": true, -"name": &"highlighted", -"speed": 5.0 }] +[sub_resource type="RectangleShape2D" id="RectangleShape2D_gu6l6"] + [node name="Card" type="Area2D"] z_index = 50 script = ExtResource("1_0bviv") @@ -45,14 +37,17 @@ frame_progress = 0.111549 text_id = 1 color = Color(0, 0, 0, 1) -[node name="CollisionShape2D" type="CollisionShape2D" parent="."] -z_index = 15 -shape = SubResource("RectangleShape2D_gu6l6") - [node name="CardBackSprite" type="AnimatedSprite2D" parent="."] sprite_frames = SubResource("SpriteFrames_fo0r0") autoplay = "default" +[node name="HighlightSprite" type="Sprite2D" parent="."] +texture = ExtResource("7_kix4t") + +[node name="CollisionShape2D" type="CollisionShape2D" parent="."] +z_index = 15 +shape = SubResource("RectangleShape2D_gu6l6") + [node name="SFXPutDown" type="AudioStreamPlayer" parent="."] stream = ExtResource("7_u4ylf") volume_db = 13.117 diff --git a/objects/card/card_highlight_border.png b/objects/card/card_highlight_border.png new file mode 100644 index 0000000..2f7f195 Binary files /dev/null and b/objects/card/card_highlight_border.png differ diff --git a/objects/card/card_highlight_border.png.import b/objects/card/card_highlight_border.png.import new file mode 100644 index 0000000..ba37e56 --- /dev/null +++ b/objects/card/card_highlight_border.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://pmapbo480in1" +path="res://.godot/imported/card_highlight_border.png-c0b130850c2d1dcdc5af25ea7e1dafdc.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://objects/card/card_highlight_border.png" +dest_files=["res://.godot/imported/card_highlight_border.png-c0b130850c2d1dcdc5af25ea7e1dafdc.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/objects/card/card_highlighted.png b/objects/card/card_highlighted.png deleted file mode 100644 index cac2f73..0000000 Binary files a/objects/card/card_highlighted.png and /dev/null differ