Follow my quest to learn Unity. I decided to create yet another clone of a well known game. The idea was inspired by Minimal NES on Flickr. Blocky graphics are part of the experience and not caused by my lack of sprite artistry :)
The player controls are now set and it's time to move on. Time for some more sprites. Aside from the castle I now should have all the static sprites ready needed to create level 1-1:
Next step ahead is a controllable player character. Part three of Tims tutorial explains how to add an animated sprite to Unity using the Orthello 2D framework. So it's once again time to start with some graphics. Hours later I ended up with a sophisticated walk animation cycle:
Mother of all walk animations
Now it's finally time for some coding. Unfortunately I did not manage to get the tutorial script running for my level design. I do not use one dedicated block as bottom border but instead wanted to build my level using many sprite blocks put in line with each other like this:
Player standing on two layers of blocks
What the tutorial script does is the following: Cast two short rays downwards, one on each edge of the sprite, and check if a ground block was hit. If yes then the falling state is set to false and player is positioned on the ground:
But as there are two layers of ground in my level the sprite kept falling after being positioned on the ground and ended up walking underground.
I spent some frustrating hours trying to figure out a solution using the distance to the ground below or above (if already underground), and finally had to give up for the night.
The next evening I tried something different. Why should I even bother casting rays if Unity already offers a full blown collision system. Yes maybe this is overkill for 2D gaming, but I desperately need some success.
Once I got the initial setup ready, I reached part two and realized that I needed some sprites to get started. As I am not on my way to get a pixel artist I put some constraints on this part of game development:
Sprite resolution for basic building blocks 64x64 pixels
Gimp brush sizes allowed 16x16, 24x24, 32x32, and 64x64
Basic animations only
I produced the first batch of sprites using my beloved Gimp in no time :)