Coming in with a bang!


It was just the ice theme deck. It'll be easy, they said. Just 12 cards, they said.

I started from the easy ones at the back and worked my way up, so things like the Aura and Terra were pretty straightforward. I already had a Bookmark page (very easy) and a Chaos Crystal page (less easy) so how hard could it be?

The code for the Bookmark page
ezez

Well I was riding high when I hit the next page, Slow. Hoo boy, Slow.

The Page for the Slow spell
That's a lot of text.

It's a pretty simple concept: it enters the Arena and captures the Spell on the stack and releases it in two turns, delaying the spell. But code relies on breaking it down into simple steps that we can code so that actually means:

  • Interrupting other Pages
    • Specifically other Spells
    • Turn order and priority are paramount here
    • Requires an opposing Caster to play with you
  • This Spell needs to be placed and stay in the Arena
  • It also needs to place the other Spell under it
    • The other Spell needs to not resolve yet
  • That Spell needs to recast when Slow leaves the Arena
  • Slow needs to remove itself at the start of the active Caster's next turn
Slow effect's code
There's a lot going on under the hood here

At some point I'll write up each one of those points because each one of those is a new feature that needs to be created from the ground up. Eventually it'll get easier as card effects overlap but it was a bit much for the first "real" Spell. It's certainly a lot more than "Bookmark 2". Here's to the next Page! 🍻


(...after I finish this page. so close!)

Leave a comment

Log in with itch.io to leave a comment.