Part 25 - Refining the Game - Part 2.
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…
And then duplicating it, moving and reducing it to become the "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…
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…
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.
- Part 01 - Installation
- Part 02 - Concepts
- Part 03 - Navigation
- Part 04 - Git and Unity
- Part 05 - Building a project
- Part 06 - Adding some plugins
- Part 07 - Creating some objects
- Part 08 - Physics
- Part 09 - Pushing things & animation
- Part 10 - Pushing coins
- Part 11 - Custom Scripting
- Part 12 - Spawning things
- Part 13 - It is still too fast
- Part 14 - Coins are piling up
- Part 15 - Materials
- Part 16 - User control
- Part 17 - Keyboard input - Fire
- Part 18 - Keyboard input - Movement
- Part 19 - Deleting Coins
- Part 20 - Walls
- Part 21 - Adding a GUI
- Part 22 - Adding the GameController
- Part 23 - Scoring links with events
- Part 27 - More refinements
- Part 28 - Slowing the user down
- Part 29 - Some more changes