That is some ugly UI code you got there…

My last post I talked about different UI designs that I could do for the tower defense game. I solicited feedback from a bunch of people and implemented what I think is a good touch system. Here are some screen shots of my efforts.

If the user selects a tile with no tower.User selects a tile with a towerUser doesn’t have enough money to build all the towers.User doesn’t have enough money to upgrade the tower

What I find interesting is how I started off refactoring code and feeling good about what I was doing. Then as time went on, my code got ugly really fast. I feel part of this is due to my misunderstanding of how to work with UIKit and SpriteKit, but maybe I am just trying to make excuses.

To appease my code design guilt, I kept telling myself that this is semi prototype code. That I can go back and change it, and that it is better to get something working then it being prefect. I once heard a game developer say, “if you code something quickly and ugly, and you never change it, then you coded it the right way”. I don’t know if I completely agree with that, but it rings true enough.

At this point I want to get feedback from play tester and let their feedback drive any improvements. My thinking is that when people only talk about the game play and not the touch system, that is when I know it is good enough. Or to put in a different way, if they don’t notice it, I did it right.