Thursday, November 24, 2016

Rocket Santa 2016: Season's Greetings!

We have been creating Christmas themed game for last couple years. For 2014 it was "Turbomole Xmas run" (flash), and for 2015 "Rocket Santa" (android).

This year WestSloth Games proudly presents: "Rocket Santa 2016" (android).

The story in the game is simple: mischievous aliens have stolen gift boxes from Santa, and he is trying to get back as many as he can. Santa can fly by using mysterious gas powered butt rocket. The amount of "rocket fuel" is limited and it can be gathered up more by catching ginger breads or gift boxes. So you have to help Santa to collect stuff and at the same time dodge nasty aliens!

For this game we took base mechanics from "Flying Dachshund" Android-game, where player controlled little sausage dog by tapping the screen.

Dachshund graphics were replaced with the graphics from original Rocket Santa. Also, some new graphics was introduced. So in priciple this game is kind of a "asset flip". :)

Check game introduction from Youtube:

In any case, this is our (WestSloth Games) way to wish You happy holidays!

Get game from Google Play and get into the mood!


Tuesday, November 15, 2016

My first Unity3D app is ready!

After long period of hesitating I started to work on my first Unity3D app. To get things going, I selected very small and simple concept to work with.  

Basically, Task Timer is a simple tool to track time used for different tasks. Main features:
  • 3 independent timers that will run also on background and when display is turned off
  • Minimal design: no bells and whistles included. Just the necessary functions!
  • Fully-customizable task names (no limitations)
  • Possibility to export timer data to email template (in csv format)
  • Measurement accuracy: 1 second
You can use Littlest Helper: Task Timer for your everyday time tracking tasks. And it is fully up to you how to use the data generated by the tool: Exported csv data can be taken directly e.g. to Excel (or equivalent) and processed as you wish.

I think this app would be a good tool for everyone who is should measure time used for different tasks (project workers, consultants, etc.). 


Wednesday, November 2, 2016

Unity3D: Convert Seconds to hh:mm:ss Format

I have gradually started to use Unity3D for game development. So far I have been doing very small and simple test codes just to learn how certain things should be done with Unity.

But now I have an example that might be of interest for other wannabe-Unity3D users, at least those who are struggling with converting seconds to HH:MM:SS format. :) So lets begin with this example.

First of all, start Unity3D and create new project. This example uses the console only for outputting result, so project can be either 2D or 3D. Whichever you prefer.

Create empty object to your scene (ctrl+shift+N), or use pulldown menu (GameObject->Create Empty).

Select empty object and rename it e.g. to "Timer". Add new C# script component to empty object and name it as "TimerActions" (Add Component->New Script->write name and select Csharp as script type):

Open TimerActions script to your favorite editor (double click "TimerActions" thumbnail in Assets folder). I am using Monodevelop for editing Unity scripts, but I guess any other decent editor will also do fine.

Write C# script as follows (or get it from GitHub):

The basic idea of script is to measure time using so called deltaTime, that is time taken to complete the last frame. Execution time between consecutive frames may differ significanty depending on what kind of processing your app is doing. So using deltaTime makes ýour app to run precisely, no matter what framerate is.

TimeCounter variable contains the time in seconds. To extract hours, minutes and seconds information from that we have to do some calculations:

  • Hours are calculated by dividing seconds with 3600, and then rounding the result down to the closest integer. 
  • Minutes are basically the remainder of TimeCounter / 3600 divided by 60 (also, round down)
  • Seconds are simply the remainder of TimeCounter / 60 (also, round down)
After calculations we still have to do some formatting for the output. This is done with string.format() function, as seen in the C# example script. Formatted string is written out to console using Debug.Log() function. 

After writing (or copying) the script you can go back to Unity. Select "Console" tab, hit "Clear" and "Collapse" buttons, and then run your scene. Now you should see Debug.Log messages showing the content of TimeCounter, formatted to HH:MM:SS.

If you want to speed up testing, you can go back to Monodevelop and tweak line containing "Time.deltaTime" a bit:

TimeCounter += Time.deltaTime * 30;

This makes counter to run 30 times faster and you should still to be able to get 1 second increments to your Debug.Log messages.

Although this very simple and short example, I am sure someone might find this useful.