Logo

Braindead.bzh

Game Dev Hobbyist

A blog about my game dev hobby and various stuff.

Menu
Logo

Braindead.bzh

Game Dev Hobbyist

A blog about my game dev hobby and various stuff.

How to use the CardEngine's demo

Screenshot

Why using the demo?

  1. You want to quickly evaluate that CardEngine is suitable for what you want to do.
  2. You need an example on how to use CardEngine.

Setup

The CardEngine's demo is quite simple to setup from any Godot project:

  1. Download and unzip it inside your Godot project
  2. Add "res://addons/card_engine/demo/interface.gd" in the AutoLoad project settings as a singleton named CEInterface
  3. Add "res://addons/card_engine/card_engine.gd" in the AutoLoad project settings as a singleton named CardEngine
  4. Add "res://addonst/card_engine/demo/game.gd" in the AutoLoad project settings as a singleton named DemoGame
  5. Activate the plugin in the project settings
  6. Create a new scene which inherit from "res://addons/card_engine/demo/main.tscn" and set it as the main scene in the project settings
  7. Run the project and you should arrive on the CardEngine Demo main menu screen

NOTE: CardEngine is only tested (and working) against the latest Godot version (3.0 at the time of writing).

Explore

The CardEngine demo covers a lot of ground and you will need some hint to properly explore it.

File structure

All the files for the demo resides inside the "res://addons/card_engine/demo/" folder:

  • folder cards: contains the resources associated with the cards
  • folder characters: contains the resources associated with the characters, player and enemy
  • folder screens: contains the resources associated with the different screen which compose the game (main menu, new game, ...)
  • folder widgets: contains the resources associated with reusable UI components
  • file cards.json: the card database
  • file custom_card.tscn: the custom card design scene
  • file game.gd: the demo logic (singleton)
  • file interface.gd: the interface between your code and CardEngine (singleton)
  • file main.gd: logic for managing screens
  • file main.tscn: scene for the screen management
  • file master.svg: the game's vector graphics

The entry point

The demo start with the main.tscn, and the associated script main.gd. It is very simple, it only takes in charge loading the initial screen (main menu) and changing screen (on a signal).

The interface

The interface is a singleton (interface.gd) which contains the custom code needed by CardEngine to properly work inside your game. It contains functions which helps CardEngine to get insight from your project, like the database path, the custom card scene, how to compute numerical values, ...

The game logic

The game logic is implemented as a singleton (game.gd). It defines how a game happens and the different interactions possible.