High Update – GUI Beginnings


Keeping in mind Quick Finger’s method of focusing on tasks I want to do but still need to be done at some point anyway, I’ve ignored collision detection today to focus on GUI.

I’m still a little bit stuck in trying to get sprite clipping to work as advertised (I’ve enlisted the help of unikron to aid with that) but my logic and chosen method should work really well assuming I can get clipping going. Basically I’ve set up my fuel gauge in four parts:

  • a base element – that which will be revealed once the tank is empty
  • a fill element – the sprite to be ‘clipped’ when depleting
  • an outline element – to neaten things up
  • a fire animation – to play when accelerating

These are looking pretty nice together though I may redo at least the outline in order to get cleaner lines.

I’ve also had a bit of a break through with scoring which was something I had a little trouble with in the proof of concept. I’ve discovered the InvokeRepeating method which made the task of scoring over time super easy. Just as easy was increasing score with multitasking elements. I am however yet to tackle combos which will be an interesting challenge.

I haven’t made a tonne of progress today but every little bit goes a long way.

UPDATE: I heard back from unikron and I’ve fixed my issue with the fuel gauge woo hoo! More pictures added below to demonstrate.

3 thoughts on “High Update – GUI Beginnings

  1. An alternative to the InvokeRepeating method would be the use of coroutines with endless loops. This gives you the option to have multiple “repeaters” running on the same MonoBehaviour and to stop them one at a time. I use something like this:

    IEnumerator SomeRepeater(float deltaT)
    yield return new WaitForSeconds(delatT);

      • I would usually make the coroutine private and write a public start and stop function like this:

        public void StartSomeRepeater(float deltaT)
        StartCoroutine(“SomeRepeater”, deltaT);

        public void StopSomeRepeater(float deltaT)

        You have to make sure to use this StartCoroutine variant with the string to be able to stop it like this.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s