Spawning Random Objects

Spawning Random Objects

Playing around with spawning random objects to go with my new scrolling background technique. I have a collection of different objects the player is going to have to jump over while they try to escape from the zombies. As you can see I have each object randomly picking from an array of sprites, scrolling in sync with the floor texture and disappearing when going out of the camera’s view. Here you can see how the layers are working (I exaggerated the Z index of the ground to make it easier to see. Basically, I have a spawner offscreen and it’s aligned with the ground. Each of the objects has a Rigidbody2D and when it’s created I simply apply a constant force to it so it move in sync with the ground animation. One last thing, I noticed some bad stuttering when the objects scrolled across the screen. To fix this I set the Interpolate setting on the prefab’s Rigidbody2D component in the...
Playing Around With Quads And Repeating Textures

Playing Around With Quads And Repeating Textures

I’m working on a new endless runner example in Unity. Going for as simple of an engine as possible. The solution is to use quads for the foreground and background with repeating textures: I created a little script that will take the quad and stretch it out to fill the screen and I can also control if it repeats horizontally or vertically which is how I did the floor. Then I have another script which manages the speed at which I scroll the texture’s offset so it looks like the background is moving. I can also set the speed of the background and foreground to get a parallax scrolling effect like this: With only a few lines of code and primitive 3d objects I’m able to achieve some impressive...
New Slide Behavior In Unity

New Slide Behavior In Unity

I have been going through and completely abstracting the entire input manager in my game. As you can see, it keeps track of button states, velocity of the attached GameObject as well as if it’s standing or not on a flat surface: Now with a cleaner way of managing input I am able to add even more behaviors such as the Mega Man slide: I still need to create artwork for it, but it’s working great. Plus, I have a way of referencing other behaviors such as walk and jump to be disabled when you slide. This is critical since the behaviors don’t know anything about each out outside of being able to use Unity’s built-in enable/disable option on MonoBehavoir...
Working On Some New Animations

Working On Some New Animations

Going back over all the missing artwork from my Zombie Art Pack and adding in some new animations. In addition to supporting the body animations from the legs so I can do running and shooting, along with more interesting stuff like jumping, ducking and eventually sliding, I’m also fleshing out more attack animations. Here I am working on a punch animation. I have a no weapon animation set, but I never had a way for the play to attack without a weapon. Should be fun to connect this up in Unity and it could be the base for a double dragon style fighting game in the...
Adding Behaviors To My Player In Unity

Adding Behaviors To My Player In Unity

I have been reworking a lot of the logic that runs my player. In the past I had one master class that managed everything, with maybe a controller class to abstract input. Now I am breaking out each type of behavior in its own script and making them completely independent. It looks something like this: Now I can simply enable or disable behaviors on the fly. An example would be if the player picks up a jet pack, I can turn off the jump and let that new behavior completely change the way the player is controlled on the fly. Here is a sample of how this is working now with walk, jump, shooting and duck. I still have a lot of work but I am really happy with the way this is coming...

Subscribe To My Mailing List

Want to learn how to make a game? Not sure where to start? Even if you are a seasoned game maker there is still a lot you can learn from my mailing list. I'll be covering tips and tricks for how to build, release and market games each month.

Simply sign up for my mailing list and also get access to a 50% off discount code for my eBooks and other content. I promise to not spam your inbox!

Join Now