New Game

I decided to have a short break from game making after my last attempt. I wanted to spend time thinking of a puzzle type game (that I think would appeal to more people than a simple endless shooter), plus learn how to release the game on both Android and iOS. I’ve managed to purchase a cheap iPhone 5s and a generous friend has lent me his Mac Book Air. Which is a great help as I really didn’t like the idea of investing so much on just my second game.

So far I’ve decided to make a game loosely based on pinball, but with (hopefully) less luck involved. At the moment I’m still in the test phase. I really need to be sure that the physics in Unity are the same across all platforms and that the game is fun.

Cheers, J

Finally released my first game :-)

Actually I released it last week but didn’t get around to posting the news here. So far it’s not had many downloads (just 9) so I’ll need to find better ways to market the game. TBF it’s mostly been a learning exercise so I don’t mind (too much) if it isn’t seen or received too well by players. It is, after all, a very simple endless shooter. Below is the gameplay video that can be seen on the Play Store.

If any readers would like to give it a go, here is the link to the download on the Play Store. C & C’s are welcome (either here or on the store page itself).

Overall I’ve enjoyed the experience of putting my first game together. Learning about Unity, Blender, C#, procedural generation, etc. Plus all the other knowledge required to actually publish. Now to think of a new project 🙂

Cheers, J

Posting to Facebook from an app

I figured this might come in handy for others out there as it took me a while to sort out the various bugs (mostly because I skimmed the documentation).

What I wanted to achieve was the ability for a game player to post his/her score to their timeline. Although it took me a while to figure out it’s really not as hard as some other blogs/forums make out. First download the Facebook plugin from the Unity Asset Store and import it into your game.

One gotcha that didn’t seem to get mentioned was the necessity to include a “using System;”. This ensures the Uri identifier is recognized. The following code is all that is necessary (some may be specific to my app but I’m sure you’ll get the idea).

using System;
using UnityEngine;
using UnityEngine.UI;
using Facebook.Unity;

public class Facebook : MonoBehaviour {
    void Awake() {
        if (!FB.IsInitialized) {
            // Initialize the Facebook SDK
            FB.Init(InitCallback, OnHideUnity);
        }
        else {
            // Already initialized, signal an app activation App Event
            FB.ActivateApp();
        }
    }

    private void InitCallback() {
        if (FB.IsInitialized) {
            // Signal an app activation App Event
            FB.ActivateApp();
            // Continue with Facebook SDK
            // ...
        }
        else {
            Debug.Log("Failed to Initialize the Facebook SDK");
        }
    }

    private void OnHideUnity(bool isGameShown) {
        if (!isGameShown) {
            // Pause the game - we will need to hide
            Time.timeScale = 0;
        }
        else {
            // Resume the game - we're getting focus again
            Time.timeScale = 1;
        }
    }

    public void ButtonFacebook() {
        FB.ShareLink(
            contentURL: new Uri("PUT LINK TO THE PAGE/STORE PAGE YOU WISH TO LINK TO"),
            contentTitle: "TITLE",
            contentDescription: "DESCRIPTION",
            photoURL: new Uri("LINK TO A PICTURE"),
            callback: ShareCallback
        );
    }

    private void ShareCallback(IShareResult result) {
        if (result.Cancelled || !String.IsNullOrEmpty(result.Error)) {
            Debug.Log("ShareLink Error: " + result.Error);
        }
        else if (!String.IsNullOrEmpty(result.PostId)) {
            // Print post identifier of the shared content
            Debug.Log(result.PostId);
        }
        else {
            // Share succeeded without postID
            Debug.Log("ShareLink success!");
        }
    }
}

After that create a button in your scene and point it to ButtonFaceBook() method.

Hope that helps someone.
Cheers, J

Learning Thai Language

Many years ago (1996) while living in Bangkok I wanted to learn Thai. One particular book that was recommended to me was called “The Fundamentals of the Thai Language”. I found it to be a fantastic resource. So much so that when I wanted to continue to learn some years later (having previously not completed it) I tried unsuccessfully to find the book again. As such, I took my hunt online and discovered a useful windows help file from which I could easily print the chapters from the book. A link to the zipped .hlp file is below.

LearnThai

Included in the zip is a folder containing the instructions and necessary applications to allow .hlp files to be viewed on any Windows OS since 7 as Microsoft decided to end support for the format.

If you would rather read the book online a kind person by the name of Lyndon Hill converted the book to html back in 2006. It can be found here.

..:: EDIT ::..

It appears that the above resources no longer function. As of Windows 11 (perhaps earlier) the winhelp32.exe file will no longer install thus rendering the help file entirely useless 🙁 I did try some other hlp readers, like HelpExplorer3.0 but for some reason that only appeared to open a part of each chapter. Add that Lyndon Hill no longer has the html version on his current website and it would – at first glace – appear that we reached a bit of an impasse.

Wayback Machine to the rescue.
https://web.archive.org/web/20180821202823/http://www.lyndonhill.com/FunThai/CONTENTS.html

It is also possible to get a pdf version of the book, although I’m not sure of the legality of posting those here. Contact me if you’d like me to dig up the file for you 🙂

Save The Cows

After a (probably too long) Christmas break I’ve been going through the process of implementing In Game Purchases (IAP), and setting up the Play Store page in preparation for testing and eventual release. This was not nearly as easy as adding the Unity Ads system, mostly because they required the store page to be fully completed with all the products added and a different phone – the developers (my) phone isn’t allowed to fully test if the purchase finalizes for some reason (?!). I’ve also managed to scrounge up an old iPhone 5 and borrow a Mac Book Air from a friend so I’m looking forward to repeating this process again for the iTunes Store… Along with any other hiccups the porting process will throw at me.

With all the above completed and the menus fully functioning I only need to create a demo/tutorial video for the store page (time to learn Adobe Premier) and perhaps create a few more models :-/ I should also consider adding one or two more levels to make the game feel more complete.