Skip to main content


Showing posts from 2013

Clean up in GIMP

Some of you may think, "Dang, that's a clean looking tree."  And in fact, like this, it looks pretty clean. And some of you if you drew a tree like this would sign it off as done and ready for some game action.  However, if you take a closer look (About 200%)
Oh wait, those colors are still inside the lines!  I guess it really is read- WAIT.  LOOK CLOSER.  (In other words, add a black background)

Filthy, filthy tree.  Tree is not ready for the game.  So, now that you can see where all your little pesky errors are, you can whip that tree into shape Which means you need your handy dandy eraser.
HOWEVER! Before we start erasing, we are first going to select the black outline and copy it, and for those who don't know how to do so, this is how: That is your magic wand, you want to select it. Then you click on the black outline (note: this is for if your outline and and colors are on the same layer, if they are not (e.g. your outline is on one layer) then you go to that l…

Creating 2D Animation For A Side Scroller In Unity3D

Update 3-13-14
Unity kinda released some really nice 2D tools, I really don't know how relevant or helpful this is now.

I've been working on a 2D side scroller. Being my cheap self I'm not going to bother buying some helpful tool that would probably speed up everything a substantial amount, and created my own method of 2D animation for things in Unity3D. This code does not work with a sprite sheet, but I hope it makes it easy enough for you to incorporate one if you wanted to.

 The animation is displayed by updating the meshes material's texture each frame (this can mess up at high frame speeds).
This code is assuming the 2D sprites are moving along the X and Y axis.
When changing directions, it is scaling the transform negatively across it's x axis.
Its assuming default direction facing is right.

using UnityEngine; using System.Collections; public enum Directions{left,right} public class FlatCharacterAnimation : MonoBehaviour { …

2D Level Visual (De)compisition and Preparing for a 2D Game

Alrighty you guys, I haven't been on in a while, as you can see with the massive delay between the Making Images in GIMP Part 2 and the to-be Making Images in GIMP Part 3, school has been piling on the projects and I can only work the video games during the slim slots of free time I have, so in order to keep from going completely off the map with blog posts, this will be a tipper in the composition of 2D game levels.

A Few Pointers On Switching From JavaScript To C#

One does not simply add to an array. In JavaScript you might have familiarity with using arrays.
You might also be familiar with "adding" to arrays.
Well Unity sugarcoated that for you.
Arrays are not really re-sizable.
When you declare an array in c#,  you have to define it right there.

If your looking for something similar to re-sizable arrays, use lists.
To use Lists in Unity c#, you must add the line
"using System.Collections.Generic;" At the top of your code.

Declaring a list of Game Objects would go something like this
List<GameObject> myGameObjectList = new List<GameObject>();

Then adding to the list would is as simple as

Then if you really just want an array you would say something like
GameObject[] gameObjectArray = myGameObjectList.ToArray();

The API is not what it always seems. Unity has also sugar coated some of its API, some parts to the point where its practically lying to you in the provided documen…

Making Multiple Instances of Windows With Same Window Method

So when developing a small little web-player, I ran into the problem of trying to render multiple instances of the same window function.

My plan was for my user interface component to iterate through all the thought components and for each thought, render its contents in a new window. The windows need to be draggable also.

My first attempt of this implementation failed.

Rect thoughtRect = new Rect(20, 20, 200, 100); void OnGUI(){ for (int i = 0; i < allthoughts.Length; i++){ thoughtRect = GUI.Window(0+i, thoughtRect, DoThoughtWindow, ""+allthoughts[i].GetContent()); } } void DoThoughtWindow(int windowID) { GUI.DragWindow(new Rect(0, 0, 10000, 10000)); }
For those who don't see the problem with this, I'll explain.

All three windows are using the same Rect thoughtRect so all the windows are drawn on top of eachother. You might think this won't pose a problem due to the windows being draggable, you can just move o…

Fixing Sketch Up blank window (white box) problem

When downgrading my OS over Christmas, I was faced with many problems, one of which is getting my Google sketch-up working.

Almost everything was working perfectly, except one little thing, The 3D Warehouse.

It was just displaying a blank screen. At first I thought I had blocked permissions for giving it internet access.  Though my computer said it was allowing it to go over the network. I tried turning off my firewall and still nothing happened. I don't have any anti-virus software so I didn't worry about that.

Guess what fixed it this annoying problem?

Just check for updates, and updates for what ever you computers default browser is also.

Now everything's back in harmony

Choose Binding Time Consciously, Awake and Start functions for Initialization

So I ran into a simple but annoying problem when I was trying to hurry up and finish a game I have been working on for a while so I could move on to start a new idea. I was being stupid an hard coding the last features I wanted to include in the game, and of course came across a problem that I spent 30 minutes on that I could of easily avoided if I was thinking.

Here is how the problem began. I needed a way to keep up with all the Light projectors in my scene and figure out which ones are close to me. This sounded easy enough, but alas I managed to screw it up.

The code I wrote  used an array that was set on the awake method using GameObject.FindGameObjectsWithTag("TagName"); In my scene, the player is already in my scene, and the lights are not. When my scene is played, a script called GameInit calls the city generator which in turn calls the multiple factories, one being the factory that generates all the lights in my game. Although it looks like when my scene starts up e…