Using the Stencil Buffer for Sprite Occlusion
Back in the post on SpriteLightKit, we talked about the stencil buffer and we left things off with a homework assignment. I also did the homework assignment and will be sharing the result that I came up with.
Pixel Perfect Camera
This post is going to be a little bit different. It will mainly consist of a video with a small amount of accompanying text. Hit me up on Twitter (@prime_31) to let me know if you prefer text or video posts. This particular post is very visual seeing as how it is demonstrating a pixel perfect camera.
SpriteLightKit and Stencil Buffer Introduction
SpriteLightKit brings back the old two buffered blend trick to get pseudo lighting with just sprites. It handles the setup process of getting that second buffer blended with your normal scene. This post will delve into how it works and along the way it will explain the shader techniques used to pull it off.
A Method for Working with Shared Code with Unity and Git
Out of the box Unity doesn’t provide any good way to have a shared codebase that is used amongst multiple Unity projects. Any code that you drag into a Unity project is automatically copied into it. If you make changes to your shared code you have to remember to change it in every project that uses it. This is obviously not a sustainable approach.
Making Xamarin/MonoDevelop Work for You
One of the biggest pain points with using Unity for game development is the absolutely ancient version of MonoDevelop that ships with it. Anyone who writes code for Unity will spend a vast majority of their time in MonoDevelop as opposed to in Unity itself. This post aims to make that time more enjoyable and less angst filled. As of Unity 5 MonoDevelop 4.0.1 is included with the installer. MonoDevelop 4.0.1 was released on March 5th, 2013. Yes, you read that correctly. Over 2 years ago. MonoDevelop is currenctly on version 5.9 which has 2+ years of development time, 2+ years of improvements, 2+ years of bug fixes compared to the Unity fork.
Making a Sprite Blink
This is the first post in response to a reader-suggested topic and probably not the last. If there is a specific topic that you would like to see covered feel free to send over a question/request. Quite often when dealing with sprites you may want to have the sprite blink in a solid color to indicate various different states such as taking damage, build up before attack, etc. Unity’s default sprite shader has only a tint color property so out of the box it isn’t possible to do.
Anatomy of a Tween Library
Every game engine seems to have dozens of tween libs available. In this post we will dive head first into what a tween lib really is and eventually end up with the design decisions that went into GoKit, GoKitLite and the soon to be released ZestKit (yes, that will be the third open source tween lib that I release for Unity. Shoot me).
I often use StateKit (a simple, object-based finite state machine implementation) for all kinds of state management. It gets used for enemy AI, player controllers, menus and just about everywhere else. In a recent project that was not very well defined (to be honest, it was made almsot completely on the fly) I needed a super flexible way to deal with a hierarchial state machine. The solution presented in this post is what I ended up using and it has been dubbed the PropEnumEvent system.
Making PlayerPrefs Sane
In past posts (mainly this one), we talked about reducing or removing all “naked strings”. We do this to reduce coding errors and maintain sanity as projects grow in size. The post provided a solution for tags, layers, scenes and resources. It did not, however, help clean up the much used-and-abused PlayerPrefs.
Persisting Strongly Typed Data With JSON
JSON is often thought of as a data transport format for hipsters who use Node.js or Ruby or whatever the new language/platform for cool kids is this week. JSON also happens to be a fantastic way for us nerds to store data in a human-readable format that is well suited for game dev.