2

I am creating a simple card game and have decided to implement all the individual cards (+ their effects) using scriptcs.

My idea is that the game engine will check what cards are included in the deck, and load the respective script file, which contains the implementation of the specific creature class. Something like the following :

>>>CARD_NAME.csx

public class CARD_NAME : Creature
{
    private const int MANA_COST = 1;
    private const int ATTACK = 1;
    private const int HEALTH = 1;

    public CARD_NAME()
    {
        BaseAttack = ATTACK;
        BaseHealth = HEALTH;
        BaseCost = MANA_COST;
    }
}

where CARD_NAME is the specific creature, and the Creature parent class is a class defined within the game engine.

My question is, is there a way, using scriptcs, to dynamically create an object of this class from my host application (i.e. the game engine)?

user104
  • 113
  • 1
  • 11

0 Answers0