TUTORIALS

Want to post your very own tutorials? Create an account or log in, then come back to this page to get started!

Select from one of the many tags below. Have fun, and happy developing!

Top Tags



New Tutorials

Escape from Pixelvomit - Episode 1: The Importance of Good Color Choice

Posted by Sondrian on 03/12/17 2:52 PM


art

The Importance of Good Color Choice


When in the course of game development, we often come to an inevitable reality...we need some sort of art to put into our game, those of us that are serious about this craft anyway. Some may decide to simply commission the assets that they need from an artistic type person, also known as an asset creator or "artist" if you will. Others may purchase a library of premade artwork to use for their games. Yet others may convince an artist to work with them (absurd I know). Some others may simply make the art themselves. But, no matter what you do, I'm here to help you make your pixel vomit look better. FEAR NOT! (okay, fear a little...yes, that's it.)

Excellent.

Let us begin.

When it comes to pixel art, color probably the single most important aspect. You don't have enough resolution for any real detail so you have to create the illusion of detail. The way that pixelart achieves this is through causing the human brain-meat to hallucinate. Using the power of optical illusionary color relationships, we can make certain parts of a flat 2d grid of dots look like it is close up, far away, or between the distance of others things. We can create the illusion that there is light or shadow, We can even arrange our dots in such a way as to cause us to see colors that just aren't there. This sorcery is called color choice, and it is one of the most powerful tools in your arsenal.

Let's make a rock!

1. Getting Started

    Or a piece of poop, either way, we tried...

Read More
State Machines and Boss Fights

Posted by fariel on 03/12/17 3:31 PM


c#

Ever seen a really awesome boss fight and asked yourself "how did they do that?" Perhaps you've had a great idea for a boss and don't know where to begin programming it. Well, today I'm going to talk about how we use simple state machines in our enemies and boss fights to give believable and predictable behaviours to our favorite things to make. 

So, what is a state machine? Google defines it as "a device that can be in one of a set number of stable conditions depending on its previous condition and on the present values of its inputs." What this means is that a state machine has a series of states, or in our case behaviors, that it can switch between. For example, we might call our state machine "Boss" and its states will be "FirstAttack," "SecondAttack," and "Move."

Since this example is going to be based in Unity, we're going to use C# to show you how to write your own state machine behaviour for whatever you want. The first thing you need is an enumeration, which uses the enum type. Enumerations are, quite literally, just a list of data with names. You can find out more about enumerations in C# by clicking this sentence.

enum BossState {
    FirstAttack,
    SecondAttack,
    Move,
    COUNT
}

This creates an enum named BossState that can have values equal to FirstAttack, SecondAttack, and Move. You might notice that the last option in the enum is "COUNT." So long as COUNT is the last option in the enum, its value will be how long the enum is. This will let us select a random one later. The rest of these will be our states later on. The next piece of this puzzle is to add a variable to hold the current state of our state machine.

BossState currentState = BossState.Move;

Now we have everything we need to start and control our state machine...

Read More