Friday, March 29, 2013

Pollinator, Flower Defense - Enemy Spawning and Bee Movement

It's time for my weekly update on my Game Development Society game, Pollinator! I missed last week's update due to having nothing to report - Building Breakout took up all my time that week. Luckily I had some more time this week, and was able to complete two major features in the game.

Enemy Spawning

The first new feature I created was the enemy spawner. This object is responsible for creating the enemies which will then move toward the hive and perform any of their other behaviours. It's very simple for the designer to specify what enemies he wants: just type them in as a string, separated by semicolon. So to create a string of three ants, all at level 1, with a 2 second time between them, you'd simply specify:


I may add something in the future to allow a command to be repeated x number of times - this would make it easier to specifies large waves of the same enemy at the same level and interval. But for now, this system should work fine for our needs.

Bee Movement

Previously, the bee "towers" could be moved without restraint. This was definitely not what we wanted for the final game - the bees should only be allowed to be placed on flowers, and they should not attack while moving.

This week, I added this functionality in. Using the Orthello 2D framework, it was actually really easy to add callback functions that are triggered based on dragging events. I'm definitely happy I decided to try this 2D framework because it's been a huge help all along the way.

Now, when you move a bee, it immediately stops attacking and won't start again until it has been dropped. If it is dropped on a flower, it snaps to that flower's center location. If it is dropped outside a flower, it snaps back to it's previous location. We would like to add some fancy features in the future where the hex the bee is being dragged over lights up red or green depending on whether it's a valid location, but it works fine as it is now and is still fairly intuitive.

We do have a small bug in that a bee will sometimes get "stuck" after being dropped on a flower. I need to investigate this further, as it weirdly seems to have something to do with which bee it is specifically.


This week, I have a web based demo! It requires Unity web player, which is a free download.

Check it out here!

EDIT: Apparently the demo isn't currently working. Bother. I'll look into it in a bit.

No comments:

Post a Comment