Kyle Banks

Filed Under #unity3d

A common requirement for 2D games is to have some sort of fullscreen background, be it a color, sprite, particle system, or anything else, to provide mood and aesthetic to the contents of your game. While a static color can be used to great effect, this post will go over the technique that I use for fullscreen background images in Unity using a standard SpriteRenderer and just a little touch of code to retain the original image's aspect ratio.
Frequently in Unity you'll see OnMouseDown used to detect clicks on GameObjects. This works fine but it requires a script on the GameObject itself, and may require synchronization within the game when there are many clickable objects.
While developing Byter for GitHub Game Off 2016, I wanted to allow players to pan and zoom the camera on both touch (tap and drag to pan, pinch to zoom) devices including Android and iOS, as well as using the mouse (click and drag to pan, mouse-wheel scroll to zoom) on the desktop and WebGL versions of the game. The camera for Byter has a fixed angle, meaning players cannot rotate it, but zooming and panning are important for collecting the *Lost Packets* in the game, and are a nice addition to allow interaction in a mostly static clicker style game.
GitHub's Game Off 2016 continues and it's now day 23 of the *Game Off*, and if you've been following along with my progress you'll know that a few days ago I published the first playable build of **Byter** at kylewbanks.com/byter! From here on out it's all tweaking, tuning, and polishing.
It's Day 19 of GitHub's Game Off 2016 and it's time for the final stretch! I've actually published the first playable version of the game, available in the browser using WebGL, so please head over to kylewbanks.com/byter and try it out!
It's just over the halfway point of GitHub's Game Off 2016, and I'm just an hour or so away from being *gameplay complete*, meaning there will only be polish and tuning remaining. I haven't made quite as much progress in the last few days as I had hoped (originally I had planned to be gameplay complete by now), however I'm still happy to be on track to complete the game jam in time.
Progress on my GitHub Game Off 2016 game continues, and with the halfway point of the competition approaching I've gotten to the point where the core gameplay is complete. Here's a look at some of the progress I've made over the last few days!
As mentioned in my previous posts, I've been developing a clicker game for GitHub's Game Off 2016. Today marks Day 9 of the Game Off, and I've managed to make quite a bit of progress.
At this point I've got the camera controls and core UI elements complete, as well as a JSON formatted game configuration file where I've defined some of the devices, storage units, and upgrades you'll be able to collect throughout the game. I've also got the bits spawning and moving along a path to the storage unit when you click or hold the main clicker button.
Yesterday the theme of GitHub's Game Off 2016 was announced, and the ideas is to build a game over the course of a month related to hacking, modding and/or augmenting. The announcement states that your game must be *loosely* based on one or more of these themes, but I've decided to go head first into the hacking theme. Considering how busy this month is for me (I would have loved for this to be a month or two ago) I'm going to have to keep it simple and try to get a playable prototype as quickly as possible before using any spare time to polish and improve the game.
Android Intents allow developers to share data such as text, images and URLs with other apps. This is handy for Share buttons, allowing users to tweet, post, email or message their friends from within your app or game.
Particle systems are fantastic for all kinds of effects in games, including fire, explosions, smoke, water, lighting, galaxy simulations, and much more. Unity comes with a built-in ParticleSystem library that can be used to implement these effects in your 2D or 3D Unity game.
When discussing performance optimization of Unity games, be it 2D or 3D, object pooling is a commonly referred to technique to gain significant improvements. An object pool is essentially a set of pre-instantiated objects that can be recycled when they are no longer in use, and eventually reused as required.
Unimation is an open source project I've been developing that aims to make animations in Unity 2D and 3D projects simpler.
Having the Camera follow the player character is a common requirement for many types of games, so I thought I'd share a helpful trick to ensure the camera follows the player smoothly and fluidly.
Unity with Git and GitHub seems to be a little mysterious to some game developers, so I thought I'd share a video demonstrating how to use Unity with Git and GitHub.
A game that takes place in space may want to disable gravity for instance, while a platforming game may want to inverse gravity for a particular level or even on-the-fly with a power-up to walk on the ceiling. However you need gravity to behave in your 2D or 3D game, its as easy as a single line of code to make it happen.
It's a pretty common requirement in game development to need to know if a particular character or object is on the ground. For instance, your player may only be able to jump, attack, or interact while they are on the ground. A common way to check this is to use a Raycast, which essentially allows you to detect the distance between to physics bodies.