![image](https://private-user-images.githubusercontent.com/13306437/327523021-27b74722-9957-4b82-a728-8c54beb7d6cd.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjM5ODM5MTgsIm5iZiI6MTcyMzk4MzYxOCwicGF0aCI6Ii8xMzMwNjQzNy8zMjc1MjMwMjEtMjdiNzQ3MjItOTk1Ny00YjgyLWE3MjgtOGM1NGJlYjdkNmNkLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA4MTglMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwODE4VDEyMjAxOFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWJkNGVjYmVlZWIxNTI5MGI4ZmU2ZGQwZWExYzk3YThiOTk5YjFjMmYxYzEwMzk4NWE1ZTVjNmQ5YzkxMzZkMmUmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.FDXW7lUbURJT6HHixVwup83mI_whfXCxUZ2pAVBVYUw)
The card.tscn
scene represents an individual card in the game. It has the following features and behaviors:
- The card is displayed using a
Sprite2D
node namedCardSprite
. - A shadow effect is created using another
Sprite2D
node namedShadowSprite
. - The card has a label (
Label
node) for displaying text or numbers on the card. - An
Area2D
node is used for detecting mouse input events on the card. - The card supports dragging functionality. When the user clicks and drags the card, it follows the mouse position.
- The card has a hover effect. When the mouse enters the card area, the card scales up and moves in the direction of its original rotation.
- When the mouse exits the card area or the card is dropped, it returns to its original position and scale.
- The card uses a custom shader (
card_shader.gdshader
) to create a visual effect when the card is hovered over.
The hand.tscn
scene represents a collection of cards arranged in a hand-like layout. It has the following features:
- The hand scene contains multiple instances of the
card.tscn
scene as child nodes. - The cards are arranged in an arc shape, simulating a hand of cards.
- The positioning and rotation of the cards are calculated based on the number of cards and the desired arc angle.
- The hand scene can be customized by adjusting parameters such as the number of cards, arc angle, and card spacing.
The card and hand scenes have the following dependencies:
- Godot Engine (version 4.2)
card_shader.gdshader
file for the card hover effect
Make sure to have the required dependencies set up in your project before using the card and hand scenes.
This project is licensed under the MIT License.
Feel free to use, modify, and distribute the code and assets in this project for both personal and commercial purposes. Attribution is appreciated but not required.
If you have any questions or suggestions, please feel free to contact the project maintainer.
Enjoy creating your card game!