My Glitch Garden (+Pause + Scrolling Text + Health Bar + Fast Play)

Hello everyone,

This is my version of Glitch Garden, I kept it pretty simple in order to advance in the course without delaying too much.

Glitch Garden by Johnny Dalvi

Added features:
*Life Bar;
*Damage Scrolling text;
*Option to speed up the game 4x;
*Pause and instantiated Menu.

Thank you !

ps: I will edit later showing some code regarding the Options menu.

2 Likes

Just had a few games on this Johnny, very nice… :slight_smile:

Noticed a couple of little things, did you want any feedback?

Of course @Rob, feedback is always welcome :slight_smile:

1 Like

Okey dokey :slight_smile:

Cool things;

  • I like the music, especially on round 2 for some reason, sounds festive :slight_smile:
  • I like the menu with the options for the game sound / music volumes
  • I like the life bars
  • I like that the “10” float slightly differently if more than one croc / fox is on top of the other
  • I like the pause option

Possible bugs; (sorry!)

  • I needed to full screen the game at the beginning because as there wasn’t the top bar which displays the items you can buy or the timer etc
  • The cactus / star are almost entirely blacked out at the start of the game, you have to click on them to light them up (I’ve just popped the screenshot in and they are more visible, I had to adjust the angle of the laptop screen to see these :slight_smile: )
  • I had a croc on the bottom left corner attacking the last cactus and it remained on full health constantly
  • pause option always seems to launch the volume control options overlay?
  • Pressing escape from full screen has given me a game screen size which isn’t the original small one, nor the maximised one, meaning that the play again button no longer works, nor can I scroll down far enough to click the maximse icon again (might just be itch.io’s interface?)

Possible improvements; (?)

  • The black text which says “you won” appears behind the main sprites rather than over the top
  • “you won” perhaps should say “level complete” or something which doesn’t suggest the end of the game
  • The game carries on in the background after a win scenario (was trying to see what would happen if a enemy made it across after a win but couldn’t time it well enough)
  • Initially I thought the “10” floating up from a defeated croc / fox would give me more money to spend
  • [balancing] It’s too hard! Seriously… there have been a few games where I didn’t get passed level one, and only once have I got passed level two. As soon as you get more than one fox standing next to a cactus you’ve had it!
  • [balancing?] The rate of damaged caused by melee for crocs / foxes is significantly greater than that of the cactus, with full health on a cactus I can defeat a croc, but if I’ve lost health I can’t ever defeat a fox and I don’t generate money fast enough to place more
  • Menu options have a different look / feel, rectangles on the start screen, rectangle for pause but different colour/font, different font/colours completely when I lose (scene has black background rather than fancy picture)

The only other thing I wasn’t too sure about was, if the floating yellow stars have to reach the top of the screen before I get my money to spend? But I just tested that and can see that isn’t the case, just felt like it might have been so was placing my stars at the top :slight_smile:

All of the above is meant to be constructive, hope it’s received in the way it’s intended - am enjoying playing and have been back for more on several occasions!

Updated Sat Oct 29 2016 17:19

  • Just had a cheeky croc hop through a tombstone after a fox made it wobble - by design?
1 Like

Thank you for your feedback @Rob, it is very important!

Tonight I will reply, fix those bugs that you pointed out and update it :slight_smile:

Thanks @Rob!

1 Like

Glad to be of help, and I’m already looking forward to playing the update :slight_smile:

Hey @Rob,

Thank you for trying my version of Glitch Garden! I’m glad that you liked the features that I’ve implemented!

Don’t have to be sorry for pointing bugs! This helps a lot!

Strange, I don’t know how to could be causing it, can you confirm if this still happens on the new build?

I’ve changed the color =) thanks for pointing it;

Strange behave, wasn’t able to see this glitch here, did it happened only once?

Yes, it does! I was about to work further on the options menu (such as adding a Main Menu and Quit Button), but I want to proceed with the course in order to learn new things;

I tried to replicate it but nothing happened, I don’t have nothing asking for an Escape Input in the application. it may be the interface of itch.io;

That’s true, and besides that the text was wrong too (it was saying You Win instead of You Won), I have changed it to Level Completed as you suggest, it makes more sense;

Good observation! I have just added a code that will disable the Lose Controller’s Box Collider when the winning condition is fulfilled;

I’have tweaked some values in order to balance it, can you test it again? (I’ve decreased the croc and fox damage while increasing the Cactus Health a bit);

Thanks for pointing, I have just added some images and rectangles/buttons :slight_smile:

Whaaat? what a crazy lizard xD it shouldn’t be happening, I’m checking the code here by so far I haven’t found something that could be causing it.

I have decrease the distance that the star have to travel before vanishing and increasing the star amount, I have also changed it’s animation

And it was taken as constructive commentaries @Rob! Please feel free to give feedback whenever I share something, it is very welcome! I’m glad you liked it!

Thank you again my friend!!
:grinning:

1 Like

By the way, I’ll be proceeding to the blender course now, before proceeding to the bowling game. I have some ideas regarding the changes that I want to do, if everything comes out as expected, it will be a very nice game =) (considering that… it will be made by me :joy:)

I do have some experience with 3d (mostly with Sketchup and a bit with blender too), but there has been a while since I don’t do anything with Blender.

1 Like

@guivho,

Sorry about the delay, this is how my Options structure works:

So, I use an Pause Button to instantiate the Options and to pause the time (Script name is InstantiateOptions), and within the Options I have one script (The Script name is SoundController) that is responsible for restoring the timescale to 0 once I click on the Back Button, it also changes the player audio preferences:

Pause Button Inspector:

Code inside the Pause Button (the button calling the options Panel and pausing the game):

using UnityEngine;
using System.Collections;

public class InstantiateOptions : MonoBehaviour {
	public GameObject OptionsPanel;
	public bool IsStart = false;
	Persistent persistent;
	void Start()
	{
		persistent = FindObjectOfType<Persistent>().GetComponent<Persistent>();
	}
	public void InstantiateOptAsChild()
	{
		TurningButtonsInvisible(true);
		GameObject Panel = Instantiate(OptionsPanel,Vector3.zero,Quaternion.identity) as GameObject;
		Panel.transform.SetParent(gameObject.transform);
		Panel.transform.position = transform.position;
		if (IsStart == false)
		{
			Panel.transform.localScale = new Vector3(1,1,1);

		}
		persistent.CanPause = false;
		Time.timeScale = 0;

	}
}

The bool isStart I use to know which instance of the options it is, since the canvas and world scale is different on the Start Menu to the Levels canvas;
InstantiateOptAsChild() Instantiates the Panel (Which I declared as public in order to drag the Options Panel to the inspector) and it also set the bool CanPause within the persistent gameObject, I use this bool to know if I can interact with the game or not, Since this method changes the timeScale to zero, I had to make an mechanism in order to avoid players using the pause to their advantage in the wrong way.

Options Panel Inspector:

Inside the Panel that I instantiate, there is a script that I use to change the player preferences regarding the Audio:

using UnityEngine;
using System.Collections;
using UnityEngine.UI;

public class SoundController : MonoBehaviour {
	public Slider MusicSlider;
	public Slider MasterSoundSlider;
	Persistent Persistente;
	void Awake () 
	{
		Persistente = FindObjectOfType<Persistent>().GetComponent<Persistent>();
		Persistente.CanPause = false;
		MusicSlider.value = Persistente.MusicVolume;
		MasterSoundSlider.value = Persistente.MasterVolume;
	}
	
	void Update () 
	{
		Persistente.MusicVolume = MusicSlider.value;
		Persistente.MasterVolume = MasterSoundSlider.value;
		Persistente.VolumeChanged();
	}
	public void Destroying()
	{
		PlayerPreferencesManager.SetMasterVolume(MasterSoundSlider.value);
		PlayerPreferencesManager.SetMusicVolume(MusicSlider.value);
		Persistente.CanPause = true;
		Time.timeScale = 1;
		Destroy(gameObject);
	}
}

Besides the function of controlling the Player audio preferences, this script is also responsible for Destroying the Options and for setting the timescale to 1 again (so the game can continue).

So, this is how my option menu works. It is important to note that messing with timescale can bring some strange behaviors that we will need to fix.

2 Likes

Thanks for sharing!

2 Likes

Privacy & Terms