Code Monkey home page Code Monkey logo

card_game's Introduction

Card and Hand Scenes

image

Card Scene (card.tscn)

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 named CardSprite.
  • A shadow effect is created using another Sprite2D node named ShadowSprite.
  • 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.

Hand Scene (hand.tscn)

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.

Dependencies

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.

License

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!

card_game's People

Contributors

zondug avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.