Time for a game progress update!
Things I’ve gotten done
- The game now detects the angle you are holding your device when you start playing and sets that as the starting point for accelerometer updates. Previously I had hard-coded some neutral orientation values.
- Game states! Now the game is more gamey and less proof-of-concepty. You can tap to start the game, pause and resume it, and start a new game after a “game over” message is displayed. It’s all pretty bare bones but it works.
- Animations. I’ve never animated anything before so they’re kinda rough, but the corgi now “runs” and the sheep blink at random times when idle.
- Sound effects. I edited some sheep sounds from freesound.org and put them in the game. Personally, I think they’re hilarious. I also learned how to convert audio files to Apple’s Core Audio Format via the command line.
Things I decided not to do
- Add “flocking” behavior to the sheep. I tried adding some separation, cohesion, and alignment goals to the sheep and I actually didn’t like how it made them behave. There’s nothing wrong with the goals themselves, but when combined with the “wandering” and “fleeing” goals, they just don’t function well enough. It’s also kind of funnier to have the sheep running every which way without any concern for one another.
- Animate a “+1” when a sheep enters the pen. I decided to animate the score label instead; it quickly scales up and down when the score increases. The sheep also “baaa” when they enter the pen, which I think is much more satisfying.
Things I plan to work on next
The game is now to a point where I have to start working on its overall structure. In other words, it’s going to have to be more than just one scene file and a “LevelScene.swift” class. I need to set it up to accommodate multiple levels and multiple scenes (such as “Menu” and “Options”).
I think I need to make some sort of “level configurator” that loads the details for each level from a .plist. Then I need to create some kind of “scene manager” that can switch between the menu, options, level selection, and also load the correct level. This is all incredibly new to me so I imagine it will take quite awhile to figure out. In fact, this is the part I’ve been dreading because I hardly know where to start. I think I’ll spend time examining Apple’s “DemoBots” sample code (which just came out, so it’s written in Swift and includes the latest APIs) to see how they set up the level loading and switching.
I’ll let you know what I come up with! :)