Abstract
This paper presents a software engineering case study on designing a reusable architecture for interactive 2D card games using Godot 4 and GDScript. Rather than focusing only on a specific game implementation, the study investigates generalizable engineering patterns for managing interactive objects, visual feedback, user interaction, and decision-making systems. A unified Item/Pool architecture is introduced to represent cards and game containers through reusable abstractions, reducing duplicated logic among different scene types. The proposed design separates input handling, object management, and rule enforcement through a signal-driven architecture. A canvas-item shader pipeline demonstrates how perspective tilt and dynamic shadow effects can be achieved in a 2D environment without requiring a 3D rendering pipeline. Furthermore, a transform-aware drop detection method based on affine inverse transformation is presented to overcome interaction errors caused by rotated interfaces. For opponent behavior, a deterministic rule-based artificial intelligence model is developed using weighted suit evaluation, legal-card filtering, and context-dependent card selection strategies. The results show that Godot 4’s scene instancing, typed GDScript, shader materials, and signal system provide suitable mechanisms for building maintainable interactive applications. The discussed solutions and engineering lessons can be applied to a broader class of UI-driven 2D games beyond card games.
Funding Information
  • European Union (BG-RRP-2.013-0001)

This publication has 8 references indexed in Scilit: