Thursday, April 30, 2009
I implemented most of the finger/touch tool that moves worms to the tapped location. It starts with a short random delay on each worm before moving to the destination point within a random tolerance using the usual swimming circular motion. The overall effect is pretty realistic, though it gets slightly jumpy with the max number of worms on screen. I also removed the menu bar using the Info.plist file, which happens much faster than removing it through code (which I was doing before).
Tuesday, April 28, 2009
Through the magic of public domain images, I've found a few good background photos for the game (better than my horrible programmer art). It seems like a small change, but it makes the game look much nicer. I've also been improving the mating probability calculations. Each worm has a mating delay, set after birth or mating, that needs to count down to zero before another mating chance is available. Tuning the probability of mating to be balanced for small populations of ugly worms and large populations of charming worms is difficult. Here is a screenshot with a fancy background image (credit: National Oceanic and Atmospheric Administration/Department of Commerce):
Saturday, April 25, 2009
I made it so worm children take on attributes at least as strong as the weakest parent (plus some random chance at becoming stronger). Size increases as worms get larger, and the color tints greener as they get speedier. Once 75 or more worms exist (I might change this count later), an overpopulation situation occurs and no more mating happens until the death tool is used to weed out the gene pool. Screenshot:
I now have basic mating implemented in the game. Whenever there is a collision, there is a chance for two worms to mate (which will eventually be based on their "fitness" through strength, speed, and charm). A mating dance occurs (a 720 degree spin of each worm), then offspring are produced. Pretty neat to watch the worms populate the screen. Next step is to implement a few more things with mating probability, and using parent information for children genetic attributes.
I worked on the HUD a bit, creating a fancy way of selecting tool icons. Initially only one icon is in the lower right corner of the screen. When it is clicked, all the icons expand out horizontally, awaiting user selection. When one is selected, other icons are hidden, and the selected icon rotates while moving back to the lower right corner. Spiffy.
Friday, April 24, 2009
I've finally finished the algorithm for basic circle movement. A worm starts out at a random position and orientation, then "swims" to a random point using this algorithm, at which point it swims to another random point, etc. This took me far too long, and I'm sure there was an easier way, but at least it's usable. I tried spawning lots of worms and watching them swim around... it's pretty neat overall. Here is a screenshot of the current version (with some much-improved icons I created):
Thursday, April 23, 2009
Trying to get my worms to turn on a circular path has been quite frustrating. I want them to traverse a circle of given radius until pointing at the destination, at which time they just move straight there. I ended up creating an equation with variables for an angle, the radius, and the destination x and y, then solved for the angle in Mathematica. This seems to work, but produces odd singularities around x=0, and is generally being a pain in the ass. Now it's about time for sleep... it's hard programming all day at work then doing this all evening.
Sunday, April 19, 2009
Now the game has a few horribly-drawn buttons for selecting various user interaction tools. I'll make some better-looking icons later. There are also some more worms (which are actually animated now). I've implemented the leftmost button that scatters worms away when the screen is pressed (eventually useful for dodging predators). Through the magic of congruent triangles, worms move to a set radius away from the tap location, without any trig calculations involved. It even uses the cool 3D ripple effect in cocos2D. Screenshot:
Just had a hell of a time getting subversion working with Xcode. It ends up that I had accidentally imported my build directory, which was throwing off the whole process. After sorting this out, I finally have a nice repository with directories for trunk, tags, and branches, and a local checkout of the trunk.
Saturday, April 18, 2009
I just spent about 30 minutes trying to find out why touch events were not being handled properly in my main game layer. It ends up that I was just retarded and forgot to add the statement: "isTouchEnabled = YES;" to my layer initialization. Now onwards to moving worms and HUD icons.
Wormies will be a game involving lots of worm sprites, with the ability to grow, breed, and evolve based on user input. The worms will start out small and bland, then gradually change colors and shape based on evolutionary traits. I will use the great cocos2d iPhone library to manage graphics and hopefully sound.