Tuesday, June 25, 2013

Pugnacious Wizards 2, version 0.4 (now worth playing!)

Version 0.4 adds several new spells - 9 total. There's a bit of a slowdown sometimes, but I'm looking into that.

This is mostly what I want. The next few updates will probably just add content (like new spells) with very few major changes.

As always, any feedback is welcome.

github source

download swf

update the latest version is at http://trystans.blogspot.com/2013/09/pugnacious-wizards-2-version-10.html

Tuesday, June 18, 2013

TDDing yourself into a corner

I've been playing around with Scala lately and while doing the Roman Numeral kata, I ended up with this.

def numeral(i:Int):String = {
  if (i == 0) return ""
  if (i % 1000 <= 900) return numeral(i-900) + "CM"
  if (i % 1000 == 0) return numeral(i-1000) + "M"
  if (i % 500 <= 400) return numeral(i-400) + "CD"
  if (i % 500 == 0) return numeral(i-500) + "D"
  if (i % 100 <= 90) return numeral(i-90) + "XC"
  if (i % 100 == 0) return numeral(i-100) + "C"
  if (i % 50 <= 40) return numeral(i-40) + "XL"
  if (i % 50 == 0) return numeral(i-50) + "L"
  if (i % 10 == 9) return numeral(i-9) + "IX"
  if (i % 10 == 0) return numeral(i-10) + "X"
  if (i % 5 == 4) return numeral(i-4) + "IV"
  if (i % 5 == 0) return numeral(i-5) + "V"
  numeral(i-1) + "I"
}

I did the simplest thing that possibly could work, followed the red/green/refactor cycle, and I even followed The Transformation Priority Premise. There's better ways of doing this, but I think I'm stuck in a local maximum and I'm not sure how to refactor my way out of it. Using a lookup table is an obvious improvement (such as List((1,"I"),(5,"V"),(10,"X") ...) but those funky comparisons make how to get there non-obvious. TDD doesn't seem to point me in one direction or another. I do believe that Test Driven Development often leads to clean and well factored code so this is an interesting case. TDD lead me down each step I took to get here and it's not leading me anywhere from here. So maybe this is the simplest way to write this?

Sunday, June 16, 2013

Pugnacious Wizards 2, version 0.3

Version 0.3 mostly adds help. There's a help screen, an examine screen, and help popups. There's also a few new room themes, but nothing much.

The next version will add several new spells and will — I think — be the first version worth actually playing.

As always, any feedback is welcome.

github source

download swf

update the latest version is at http://trystans.blogspot.com/2013/09/pugnacious-wizards-2-version-10.html

Monday, June 10, 2013

Pugnacious Wizards 2, version 0.2

Version 0.2 adds guards, archers, new rooms, health pickups, better lighting and effects, and many tweaks. I can beat the game about half the time, which means it's too easy. It takes about 20 minutes to play. It's starting to feel like a real game even though it only has three spells.

As always, any feedback is welcome.

github source

download swf

update the latest version is at http://trystans.blogspot.com/2013/09/pugnacious-wizards-2-version-10.html

Friday, June 7, 2013

Pugnacious Wizards 2, version 0.1

I really enjoyed making and playing my 7DRL PugnaciousWizards. So I started from scratch and have made a new one. Or at least some of it. There's only three spells and a bunch of traps so far. There's no help, examine, or explanatory popups. No bad guys either.

As always, any feedback is welcome.

github source

download swf

update the latest version is at http://trystans.blogspot.com/2013/09/pugnacious-wizards-2-version-10.html