Wednesday, September 23, 2015

Day 31: In Space, Everyone Can Hear You Breathe

Today was a large and busy day in getting things implemented. With the story portion still in initial phases, we decided to go and create a suitable setting for the action.

Being tasked with debris, I took my previous work with particle systems in Unity and created a set of reusable objects. Thankfully, I'm no longer part of an animation class that keeps us from using Rigidbodies, so I was able to apply such aspects to the debris itself. To keep it spinning and moving, each debris has its own direction (taken from a random vector value in the unit sphere) and a bearing towards a general orbit.

The main thing to focus on was the timing; at first I was implementing a constant stream of debris, but the rising action of the game could be split into an initial segment and a much faster stream of debris later. Unfortunately, deltaTime in Unity isn't as comfortable with seconds, so I used the System.TimeSpan and System.DateTime objects to get the total seconds between saved times. This ensures that things such as intervals between debris streams are measured in seconds, which does great for production planning.

As for the overlay, a main aspect of this game is going to be options that appear directly on the screen. It's been awhile since I've worked with Unity, so the UI options have changed a decent bit. Luckily I was able to program it from scratch to keep it from the main scene by way of two objects; the canvas to overlay the text in various positions and the text object to attach to the canvas. Mistakenly I thought to add the text object without the canvas, but it is necessary to render it on a canvas for it to show up. This can also be applied to other pieces of the UI, producing the scene below:

Not shown in the picture is the SoundManager I implemented for this project. I took a similar approach, except passing as a parameter might not work in a complex project like this one. I'll stick with parameterization for now until something like a Singleton is necessary for comfortable coding. (Also not shown: Intense breathing)

From my programming partner's suggestion, my next challenge is to implement a fish-eye view (curvilinear perspective!) for the scene and hopefully the UI for a more interesting looking experience. That, and oxygen.

No comments:

Post a Comment