top of page

Card Garden - Sprint 2

My Completed Tasks:

​

  • As a player, I would like to be able to draw cards on a timer so that I know when to expect a new card

​

This​ timer was a really simple addition. The main problem was figuring out where to place the timer. Originally it started on the PlayerStats script, but I decided it was better to have it on its own script, and modify the card draw time from the Card Manager.​

​

  • ​As a player, I would like to be able to use currency to play a card in the game so that I can use my gold

​​

  • As a player, I would like to be able to draw cards into my hand using the timer or paying a fee so that I have the freedom of more than one option

​

  • As a player, I would like my Tower buildings to projectile attack Enemies on tiles within their range

​

The currency additions were easy enough, I simply used the current player gold count from PlayerStats to see if it is above the cost of the card to allow you to buy it. Same thing for the button to pay for the next card in the deck.

The tower radius detecting enemies was a much more interesting challenge, as I wanted to avoid having to do a findAllWithTag in Update(), which would be quite expensive. To solve this, I created a sphere with an isTrigger collider which scales up from the center of a tower to match the attack range of its card. Whenever an enemy enters the sphere (OnTriggerEnter), I add that enemy to a private list of the tower, and from Update() the tower only fires a projectile on a timer if there is at least one enemy in the list. If the enemy leaves the range of the tower (OnTriggerExit), then it is removed from the list. Very clever if I do say so :)

​

  • As a level designer, I would like a version of the project that I can create assets in so that I can do work and avoid impeding other teammates

​

I then took the work that I and others had done and packaged up the stable version for the level designers to work with.

  • As a player, I would like my buildings to take a certain amount of time to be built so that I feel pressure and danger as enemies march my way

  • As a player, I would like my Generator Building to generate a set amount of income over a length of time so that I can have a passive form of income

 

  • As a player, I would like to collect money from enemies that I kill so that I have a direct source of income

​

These tasks were also relatively simple, but I did find a potential problem and was able to design around it. Initially, I had each generator start an InvokeRepeating call to generate money once per second, however it quickly began to look strange because with 2 generators I might generate a gold, then a quarter of a second generate another gold, and then three quarters of a second later I'd generate another gold, and on and on like that. So, I set it up so that there's only one gold income function on PlayerStats that is called using an InvokeRepeating, and the only job of a generator is to increase the income amount when it's built. This means less things running in the background, and a clean and consistent looking gold income timer.

Finally, I was tasked with coming up with a plan for a level up system that allowed for 20 level ups with publicly modifiable variables for all of the stats a card could have.

​

  • As a producer, I would like a Level Up System class map to improve workflow in production

Level Up Class Map.jpg

This Class Map proved challenging, as it meant fundamentally changing how card stats work across all the scripts, and allowing for lots of flexibility while also being easy on the eyes.

​

  • As a player, I would like my buildings to gain EXP points for every enemy they kill and level up so that I can get a sense of progression

​

It took me some time to figure out how to implement certain things (like creating a foldout menu float array in the CardEditor custom inspector), but I eventually got the level up system working. Here's what the new Card scriptable object and CardManager look like:

ScriptableCardUpdate.PNG
CardManagerUpdate.PNG

And here's the functionality of the buildings leveling up and playing a high level card:

My next task starting in Sprint 3 will be:

​​

  • As a player, I would like spells to modify specific types of other cards and their respective buildings/minions temporarily or permanently

​

And my other tasks following that will be:

​

  • As a player, I would like for my units to be able to have typed levels so that they can specialize in different kinds of damage and give me options

 

  • As a player, I would something that tracks the game state and progresses me from one battle to the next

 

  • As a player, I would like tiles that have been targeted by a fire spell to deal major damage to enemies that walk through it so they have a lasting effect

 

  • As a player, I would like tiles that have been targeted by bees to give damage over time to enemies that cross through it so that they have a lasting effect

 

  • As a player, I would like tiles that have been targeted by an ice spell to slow down enemies that walk through it for a certain amount of time so that they have a lasting effect

Doing the Multi-class leveling system and Spell cards in Sprint 3 will be quite the challenge, but I look forward to it!

bottom of page