Open source repositories generated during game development
Last week I released a game called Friendsheep, and open source repositories generated during game development. It’s a project I’ve been working on from 2015 until now. It is a mobile game for iOS- and Android phones. When this post is being written the game has got around 300 installs (rounded down). I got help releasing this game from Science Park here in Jönköping. Thank you very much!
"A deranged professor and farmer wanted to grow his two pigs, Baconesse and Porky, larger because of his unstoppable food cravings. But in his lab, the professor accidentaly spilled the bottle of toxic waste into the pigs' food supply. The pigs mutated into Supersheeps with the amazing ability to fly. At first everything seemed alright, except for the pigs being mutated into Supersheeps. As time went on the Supersheeps needed constant feeding to stay alive and the professors food was running out. It was in this time of chaos the sheeps bond and friendship grew stronger. When the food was completely gone they decided to fly away to find food elsewhere. Now you must help them survive for as long as you can! That is where you, as a player, comes in. The two supersheeps are out hunting for superfood in the form of clovers. They can only be gathered up in the air since they are very light weight. The mission is to keep both sheeps in the air at the same time, if you miss a clover the sheep will loose energy and loose their ability to fly. The clover is also color coded so the sheep with the red cape can only eat red clovers, and the sheep with the blue cape can only eat blue clovers. They are allergic to each others clovers." Friendsheep presskit
Although not all of the code from Friendsheep is open source, some components from the game has been released into the wild. You can check out the Object pooler and an example project (containing three tutorials now but more to come) on Github.
Object pooling is used to tuck away already instantiated game objects instead of destroying them.instantiating and destroying objects cost a lot of resources for the device running them, this i specially important on phones. So instead of instantiating a game object you as the object pooler to do it for you. When you are done using the object all you need to do is deactivate it. An example where this is used could be when firing bullets from a gun. When the bullet has hit its target(or not), the bullet is disabled and put into the object pool until the player fires again.
The unity examples repository currently contains three different examples: Saving and loading data in unity tutorial, Toggling sound on and off tutorial, DontDestroyOnLoad tutorial - Keep music playing when reloading scene.