Easter Egg Hunt – Carrot Powerups Added


I added the first powerup to the game, which is the carrot.  By default, the player runs with a velocity of 4f.  When a rabbit picks up a carrot, the speed is doubled to 8f for 5 seconds.  When the speed powerup is enabled, it will display the new particle system that I created around the rabbit.  I made a simple star in Gimp, and then created a particle system with it in Unity with color over time (yellow to blue) and random particle sizes.  This is a nice new mechanic, but it appears to have rendered the timer for the stage pointless, since all of the eggs will now be collected before it ever expires.  The levels seem to go by too fast now, so I may add some obstacles like snakes which bite you or bombs that make you dizzy.  It would also be neat to have a bomb make you drop all of your eggs (I’m thinking like Sonic dropping rings when hit) so it will give the other players a chance to steal eggs away.

I added a title screen, which is nothing out of the ordinary.  I still need to figure out a way to make the copyright text only instantiate on the first time the title screen is loaded, because it has DontDestroyOnLoad, so a new one gets created every time the title screen is loaded.  It isn’t a huge problem, but it becomes more opaque as more copyright texts are overlapped.

I created another overlay, which just outlines the four bunny cameras.  I created this with gimp, by just making a 256×256 image, and selecting all and shrinking by 8 pixels and filled with white.  Then I used the bevel decor filter, to make it look a little 3D.  The I used the Color option to make it blue, red, yellow, and purple for each of the rabbits.  Then I pasted those frames into the main overlay.  I used the grid tool in Gimp to position the squares, but I had to manually fix the y position of the bottom two frames.

After doing some testing, I’ve found that if an egg has a 5x modifier, then whoever picks it up will inevitably win (unless a human player throws the game on purpose after picking it up).  There are a few of things I could do to resolve this.  I could make more than 5x powerup (one for each side so all players have an opportunity to pick it up).  The other option is lower the multiplier.  Another idea is to put carrots on the side that doesn’t have the 5x egg.  However, if I had bombs and other obstacles as I previously mention, then there could be a chance of the rabbit who got the 5x egg to drop it, thus giving the other players a chance to win.  As it is right now, it needs to be fixed, because there really isn’t any point to continue playing after someone picks up the 5x egg.

I added sound effects for the egg pickups and carrot bonus pickup.  The bonus egg sounds just slightly different than the regular egg.  I’ve tweaked it a few times, but I think I need to change it again once more so it does sound more distinct than the regular egg.

Giving the human player the ability to select their rabbit color needs to be added.  I would also like to have multiplayer controls for multiple human players.  I don’t think it should be too hard to add that, because the human flag is just a bool in the Player class.  I just need to modify it so that it handles multiple control mechanisms.

Another thing on my to-do list to dynamically moving the camera so that it zooms in as close a possible, while ensuring that all four rabbits are in the frame.  I’m thinking this will be similar to how the camera in Smash Brothers works.  When the rabbits are spread far apart, then the camera will be zoomed out.  When the rabbits are close together, the camera will be moved in closer.  I also want to have a way for the eggs to stand out more, since they are still a little hard to see when the camera is zoomed all the way out.  I was thinking about adding a light source for each egg, but that will be a serious load for 10 eggs at the same time.  I’m thinking it could work if I set the lighting settings to the lowest possible quality for the light surrounding the eggs.  Alternatively, I could do some sort of particle system, which I think would definitely be appropriate for the bonus eggs to make them stand out.

Easter Egg Hunt – Multiple Cameras Added and Bonus Eggs Implemented


Four picture-in-picture cameras have been added, which display each of the rabbits and the eggs that each has collected.  Each camera is a child of the Player object, so that it stays locked at the same position in front of the rabbit.  This gives a good view of the eggs collected, but can be jarring when the player suddenly rotates a large amount, such as going directly left to directly right.  I figured out that I can specify the size of the camera on screen in pixels by setting the pixelRect property of the camera.  In the Unity inspector, I have only been able to set relative sizes and positions.

The method for placing eggs was updated, to ensure that eggs are evenly spread out over the gameplay area.  Previously, the lower left portion of the gameplay area had few eggs because of an error using 360 degrees instead of 2 Pi radians with the Sin and Cos functions.  To evenly distribute the eggs, I calculated the start of the radian range for an egg by dividing 2 Pi by the number of eggs, and then multiplied by the current egg number.  The end of the radian range is the same, except using the egg number plus 1.  Then I generated a random float from 10f to 19f for the radius length from the center of the gameplay area to the egg, which ensures that the eggs don’t clump up in the center and don’t lie on the oustide edge of the gameplay area.  The radius of the gameply area is 20f.  The x position of each egg is calculated by radius * Cos(2 * Mathf.Pi * radians) and the z position is radius * Sin(2 * Pi * radians).  This method divides the circle into even slices based on the total number of eggs.

A new Bonus class (different that the Quest class that I removed) was added to track the bonus color and multiplier.  I made a list of int, which currently just holds 2 and 5, and the multiplier is selected from that list.  I added additional code to ensure that if the 2 multiplier is selected, then exactly 3 bonus eggs will be generated.  If the multiplier is 5, then only one bonus egg is generated.  When the regular eggs are created, if the random color equals the bonus egg color, then it loops and keeps generating a random color for that egg, until it doesn’t equal the bonus color.  It seems like with the bonuses added, there are far fewer tie outcomes in the game.  Since there are just a few bonus eggs, I placed them at any valid location on the gameplay area.  If more bonus eggs were instantiated, then I would use a method to spread them out like I did with the other eggs.

Easter Egg Hunt – End game state conditions added, updated animations


In the latest update to Easter Egg Hunt, I added checks to see if all of the eggs are collected and if time has expired.  Then the player or players who have the most eggs are declared the winners.

Two animations were added for the rabbits for standing and walking, and animation transitions were applied based on the rabbit’s speed.  The camera zooms in on one of the winning players.

The game area was also changed to a circular shape, and the formula to distribute eggs on the game area was updated to use a random radius and angle.  Invisible walls were added to prevent the player from dropping off the gameplay area.

Fonts were updated for the text displaying the score, timer, and winner text.