Monthly Archives: March 2013

A New Wizard


Ok so the old wizard art was fine but unfortunately it was licensed under GPL 2.0 so it’s not ideal for this game. As I explained in one of my previous posts I’ve been trying my hand at some art of my own and I was able to make what I think is a pretty decent wizard.

I created it in .svg format using Inkscape and separated the parts into there own files. Then I used a tool called Spriter to create the animations by rotating and translating the pieces. This is called modular animation. Then I exported the frames as .png files so I could swap them for the old animations in Unity.


Leave a comment

Posted by on March 15, 2013 in Other Stuff


Tags: , ,

Developer Diary #6

Implementation Week

Yet another week purely dedicated to implementation of new stuff. Unless you count the few art side-projects I did as well.

Added Features:

Plant Enemy


Added static plant-like enemy that shoots spells that can affect the player. A red fire shooting one and a blue ice shooting one for now. I may later add one that shoots spikes or something. I scripted the enemy so that you can set the delay between shots and it loops through two frames of the animation for as many times as the delay number, then it shoots its projectile. This is useful to varying difficulty. The projectiles also have a modifiable range.



Added skeleton enemy. He can be effected by ice and fire and kills the player if touched. The skeleton has 3 animations idle, walking, and dying.

AI: For now the AI for the skeleton is fairly simple. There is a variable that dictates its vision range. It shoots out a raycast in the direction of the wizard with length equal to its vision range. If the ray hits the wizard then the skeleton walks in the direction of the wizard. If the wizard is in the other direction the image flips horizontally and walks in the other direction.

Dormant Skeleton: There is another object called dormant skeleton that appears still and lying on its back. When you hit it with lightning it destroys and is replaced by a walking skeleton who behaves normally.

Casting Fire and Ice On Yourself


This change resulted in the added code for allowing a fire monster projectile to kill you. When you are hit by an enemy fireball you catch on fire and die. This is implemented by calling the cast fire on self method when you are shot with it. The problem is there was no such method so I added it. Now as a result if you cast fire on yourself when you are not frozen you catch on fire and die. Additionally if you are on fire for any reason you can extinguish yourself by casting ice on yourself.

Menu Additions


Added the second world into the menu. The set of buttons is a child of a parent object called worldBar that contains the buttons and journalButtons for both world1 and world2. World 2 is located 10 units to the right on of world1. I’ve added an arrow to world1 which when pressed, animates the worldbar to shift to the left exposing world2. There is an arrow on world2 that does the same thing.

I’ve also added an option to the settings menu that unlocks all levels for testing purposes.

Audio Changes

Added an audio track for the cave levels. Edited the world1 and world2 audio so that it is much shorter and loops. I also compressed all of the audio tracks. The end result is about a 3mb reduction in the app size even after adding the new audio track for world2

Bug Fixes

The main bug that I fixed this week was a problem with the spell change not registering quickly enough. If the player for example used fire to melt himself and then immediately switched to air and jumped he would end up burning himself because the change did not register fast enough. To solve this I edited the tk2dButton class and made it so that sending the message to its target was the first thing that it does. I also moved the spell casting code into lateUpdate() so that it doesn’t execute until after all the code in the update method executes.

Not only does this prevent you from accidentally killing yourself by tapping to quickly, but also increases the speed at which you can switch between spells. All in all a very important fix.

Leave a comment

Posted by on March 10, 2013 in Developer Diary


Practicing Some Art

Throughout the course of this project it’s become very clear to me how advantageous it would be if I was capable of creating my own art. As a result I’ve started dedicating some of my time to practicing some digital art. At first I tried some pixel art but it soon became clear that this was not my thing. Then I tried a few things in Inkscape and the results were a bit better. Eventually I hope to be capable of producing the majority of the art for my games by myself. Below is a list of some of the early things I have worked on.

Electric Box:

This was actually for my game and is used in some of the cave levels. I couldn’t find anything suitable for what I wanted in the open source world so I went ahead and took a stab at it myself.



These I also drew up with the intention of using in my game. For the cave levels I’m using a tile-set found here but I really needed a boulder so I followed the color scheme and the style (somewhat) and made my own boulder. The second one is the one I ended up using so I scaled it up a bit.


Boulder Animation:

I did this just for fun/experimentation. If I had decided to make a rock spell of some kind it would have been cool to have an animation of the boulder being created so I decided to try and make one. It turned out decent.

boulderCreation boulderCreationSheet

Skeleton Vector Version:

For one of the enemies in my game I am using this and as a way to experiment more with vector drawing I decided to make a vector version of the skeleton. I figured it might be useful in the future for a different game or if I decide to modify this game to a vector art style.

skeleton skeletonPieces

Crusader Knight:

This is another vector character I made. This one was completely from scratch. It was good for practice and possibly could be used in a future game.

knight KnightPieces

I have released all of these assets to the open source community and they can be downloaded from my profile


Posted by on March 10, 2013 in Other Stuff


Tags: , , ,

Developer Diary #5

Scripting – Lessons from the text

The subject for this week in the text was all about how to script in Unity. It started with a description of the 3 different languages that you can use in Unity Boo, Javascript, and C#. I personally prefer C# but the text pointed out that based on Unity’s implementation of these languages they are all equally efficient which is very cool. Furthermore you can use multiple languages in a single game. This is very useful because occasionally I use publicly available scripts made by other people that are written in javascript.

Much of the text was covering the basics of how to make a character, state, and camera controller. Much of the facts of this I was already aware of but it was great to get a nice clean and simple solution to all of these problems. Since this game uses unconventional controls not all of this will be useful to me but I will certainly reference this part of the text for future games that use more standard controls. One such thing was the Input manager which allows you to assign keys to certain input axis and makes scripting a whole lot more intuitive and quick.

The most useful thing about this section of the book was the description of the built in functions that control when code is executed. These include Update, LateUpdate, FixedUpdate, Awake, and Start. For example Update runs once each frame and therefore can be at an inconsistent rate. FixedUpdate uses the physics time-step that you can set and therefore runs at a fixed rate as the name would suggest. This makes it ideal for programming movement and things that you want to happen consistently.

Implementation Added Features

Since I’ve completed world 1 I have started on world 2 which has a cave theme. Previously I had assembled much of the needed assets and built a sample level but now I’m starting to code the actual puzzle functionality.

Lightning Spell:

The first new feature is a new spell. If you cast it on yourself you will speed up for a set time. If you cast it as a projectile it will shoot a beam of lightning. This was difficult to implement. I found a public domain prefab of an awesome lightning bolt that could be set at a starting point and draw to the point of a transform set as a target. I used this to my advantage and made it act just like any other spell even though it’s fundamentally a line renderer rather than a rigidbody. I assigned the lightning prefab as a child of the wizard and turned it’s rendering off. I added an invisible rigidbody to the wizard’s spell array which is what actually get shot when you cast the spell. When you cast the spell the lightning bolt finds the projectile, Assigns it as its target and draws a line to it. When the target is destroyed the lightning turns rendering off again. This results in a very cool and unique looking spell while keeping the way spells interact with the world fundamentally the same.

Lightning Prefab found at Muse Games

Electric Box:

For this object I had to work some of my limited artistic ability and draw it myself. It’s meant to be shot with the lightning bolt to activate some kind of machinery. Most of the time this will be some sort of door or platform animated with an iTween Event. I’ve coded it so that each box has a target with an iTween Event. When you hit the box with a lightning bolt it starts up some cool effects and then calls the play function on the targets animation. This is a very simple and flexible solution that will allow for a large variety of puzzles with no additional coding.



Again for this I had to draw it myself and I must say it turned out pretty decent. The boulder can supply two kinds of puzzles.

A: the boulder can kill the wizard if it hits him at a high enough speed.

B: the boulder can break certain walls

Sometimes the player will have to run away or dodge the boulder and other times they must use it to get past certain obstacles. I’ve also added some nice looking particle system effects for when the boulder destroys a wall.


Leave a comment

Posted by on March 4, 2013 in Developer Diary