Little Hero post mortem
So, a couple of days have passed since I’ve uploaded my game: Little Hero. I’ve got quite some awesome feedback about my game.
What most people love about my game is the random generating component. That wasn’t even the hardest thing to make. I’ll sum up some things about what went right and wrong during my process.
What went right:
OB&OB – Programming the whole Objective and Obstacle component went surprisingly well. I created several different functions for the objectives and the obstacles. To manage the three objectives I use three different functions. Each of them are checking the game for different statusses: Has the player reached the end co-ordinates, has the princess reached the end co-ordinates and are their still more than zero demons.
Its all quite simple, using two Vectors for positions and one int counter for counting. At the beginning of each level the game will generate a random objective and obstacle and sets the level accordingly. When an obstacle is generated the game goes through a function with a couple of “if” statements to determine which obstacle is chosen and what needs to be done, resulting in the random generated component that works in my game.
Gravity, jumping and falling – Oh the pain of using the gravity component from Unity. It’s really well made for games that are made by people who arent into gameplay programming like I do. I find it quite clunky and annoying to use in my own games. It just doesnt feel right.
But I didn’t have enough time to create my own gravity component. So I created a jump and fall loop that are being changed by collisions and key input together with Unity’s gravity and rigidbody. It’s working quite nicely if you ask me.
What went wrong:
Animations – Unity animation is quite nice to use. Setting animation curves by using an objects rotation, position and scale you can create quite the animations. Problem is, Unity’s animations are set locally. If you animatie a object directly it will spawn to its animation co-ordinates.
To fix this you have to put the object in an empty gameobject and animate the empty gameobject to stop the object from going to its animation co-ordinates. It was really annoying to get this done as there was no easy way to see if I was animating from the parent or the object itself. Many a times I had to do animations over because it did use its animation co-ordinates. This problem did cost me precious time, resulting in removing some obstacles and objectives from the game. So sad.


Shader – The fog obstacle is one of my favorites. It makes you remember the level if you want to complete your objective. Using a shader to render lines from certain objects through a grey gameobject is really nice but annoying to make. But that wasn’t even the biggest problem. The “shader” was a Javascript document, while I programmed my whole game in C#.
It is possible to create a connection with C# and Javascript using Unity’s compile order. By locating the Javascript in a folder like “Standard Assets” or “Plugins” it will be compiled before the rest of the codes, making it possible for C# to make a connection with Javascript. This I knew, but it just wouldn’t work with the Javascript code. Whatever I tried it just wouldn’t work. +- an hour later I found a way to make it work.By making a private variable for the javascript I was able to communicate with it. Something so simple yet so difficult to find.
And that sums it all up, atleast the things that stood out the most. If you haven’t played my game yet you can play it here: http://www.ludumdare.com/compo/ludum-dare-28/?action=preview&uid=10963. If you did play it, please let me know what you think. I hope you enjoy my game as much as I enjoyed making it. Thanks for reading and good luck to all the ludum dare contesters. Cheers!

