Part 25 - Refining the Game - Part 2.

By Jamie Chatterton / 2018-06-12

So it's starting to play more like a real coin pusher. It's harder to get all your money back immediately now.

Still. There's a couple of things. There's no starting money in the system and there's none of the 'dead area' where you won't get anything back.

Again, let's start with the easiest, the "dead" area.

Adding a Dead area

Ultimately, the dead area is just the same as the existing collection area, just without it invoking the GameController to say you've collected something.

We can clone the existing 'collection' object and add it where we want.

First editing the Collection area to make it smaller…

Open this image in a new tabSmaller Collection area
Smaller Collection area

And then duplicating it, moving and reducing it to become the "dead-area-left"

Open this image in a new tabCreating dead-area-left
Creating dead-area-left

To make it not count towards you score, removing the call to the GameController.AddFunds in the "Delete Colliding Object" Component of the new "dead-area-left" object…

Open this image in a new tabRemoving GameController.AddFunds call 1
Removing GameController.AddFunds call 1
Open this image in a new tabRemoving GameController.AddFunds call 2
Removing GameController.AddFunds call 2

With that altered, it's just a case of duplicating this dead area, moving to the right, to become the right dead area.

And we have what looks like the original collection area again…

Open this image in a new tabFinished collection area
Finished collection area

And with that, you'll see that the coins don't always give you back your money now…

Git repository: https://bitbucket.org/hiveit/unity-tutorial-coin/src/021_AddingDeadArea/

More posts in this series.