Wednesday, February 18, 2015

Developer Fitness Challenge: Day 12




Back on track today after some troubles on day 11 causied me to miss my goals. Nothing hugely exciting for day 12, but I managed to get close to making my two systems work together (both the random selector and my spinner).

For the game to work, each player has to make a decision on their turn. This is a choice between two actions. One action brings up the spinner, and the other action activates the random selector; both can not happen at the same time.

Since I built the systems separately, you could easily just hit both buttons and have everything go off all at once. So I built in a simple "global" switch system that tells the game if an action has already been taken. If it has, it won't allow another action to take place until the previous one was completed. Although I haven't quite perfected it yet, I'm well on my way and think I know the last few tweaks I have to make to get things working properly.

This is one of my classic moments of just kind of diving in to code without any real planning. Not a great idea. I'm sure if I had attacked this on paper first, I would have definitely gotten things totally up and running, but instead I'll have to spend two days on what should have taken me one. Hopefully I can knock it out quickly tomorrow and make up some time.

The next big step is figuring out arrays and drawing the text in to specifically bound areas. I've read about them but never actually used them so hopefully it's as simple as it sounds! (famous last words)


Day 12 Fitness Stats
Exercise: Weight Lifting
Weight: 223
Calories: 2022

No comments:

Post a Comment