Pause menu appears when you press the pause button mid game. Animations added include the guy, lava and demon hand. Also 3 of the 5 demons are animated as well; featured is the demon spirit. What’s next: I’m starting to … Continue reading

Similar to the Fade Function, here’s the Move one: public IEnumerator move(GameObject obj,Vector2 targetPos, float speed = 1){         Vector2 startingPos = obj.transform.position;         while(startingPos.x != targetPos.x || startingPos.y != targetPos.y){             Vector2 curPos = obj.transform.position;             if(curPos == targetPos){                 yield break;                 }             obj.transform.position = Vector2.MoveTowards(curPos, targetPos, speed*Time.deltaTime);             print (“moving “+curPos +” – “+targetPos );             yield return null;         }     } This function assumes you’re moving a game object from it’s current position to another. It’s parameters are the GameObject, … Continue reading

This is the function I use: public IEnumerator fade(GameObject obj,float fadeSpeed = -0.1f){         for (float f = obj.GetComponent<Renderer>().material.color.a; f <= 1 && f>=0; f += fadeSpeed) {             Color c = obj.GetComponent<Renderer>().material.color;             c.a = c.a + fadeSpeed;             if(c.a <0){                 c.a = 0;             }             if(c.a >1){                 c.a = 1;             }             obj.GetComponent<Renderer>().material.color = c;             yield return null;         }     } This function has 2 parameters: 1) the game object that’s to be faded and 2) the fade amount. By default … Continue reading

Content types are like a custom type of page that also be used to sort other pages. In this example we’re making a destination content type and then allowing another page to select what destination that page belongs to. To … Continue reading

I’m happy to say I got all the demon’s attacks working :) This includes the warnings, gradually stronger attacks and how it affects the player if they get hit. I’ve changed one of the demon’s effects from the original game … Continue reading

I use MAMP to manage different sites. Also download Canvas which provides the installation files. Unzip the Canvas file and put the files somewhere on your computer. Open MAMP, go to the ‘Hosts’ tab and click the + button on the … Continue reading

This example is to make a constant animation loop endlessly (say a shining sun animation). The first thing you need is a spritesheet which is basically all the animation frames in 1 image. I usually do this in Flash. When … Continue reading

Decided to leave the tutorial levels till later and do something more fun – adding the demon levels. The first demon’s lightning attack is fully functional. Lightning randomly appears on the screen and it’s size,number and frequency gradually increase as … Continue reading

What is a singleton? Basically, it’s code that can be used by everything else. This means you can share code between scenes in Unity. I usually use this to make sharable GUI styles. This is the basic set up: public class singleton : MonoBehaviour { … Continue reading

In this example I’m using Font Awesome. First you download it and then drag the .ttf font file into your Resources folder. Now, there are 2 ways to add text: in the UI and in code. Let’s go through both. … Continue reading