Part 24 - Refining the Game - Part 1.
So. We have a basic game now.
However it needs some refining.
You get all the coins you add.
It pushes everything to the front.
There are no coins on the game at the start
There's no 'dead' area where you don't get anything back like a real game
In this section let's fix those issues.
First the easiest - It pushes everything to the front.
It's the easiest to solve, as it's a modification of the animation of the
pusher and going to the "Animation" window. Then moving the current frame to the 1:00 mark…
The "pusher" is moved to the front at the time in the animation.
We can directly change the position.z coordinate. Checking at the time of 0:00, the position.z is 6, so a good halfway position for 1:00 would be 3, no?
Changing that and checking the animation we get…
However, it's not really enough to be anything.
The next thing that is relatively easy is to alter the geometry of the
floor object. A coin pusher generally has a raised lip at the end to make the coins pile up and stop them immediately falling out.
I'm going to hide everything but the 'floor' object to make this easier. Selecting them all and unticking the top-most checkbox in the inspector disables and hides them.
The current floor object is not quite fit-for-purpose. All of the faces are single faces. What we need from it is to 'sub-divide' the top face so we can manipulate it a little and create the lip we want.
With the face-tool selected, select the top-face…
Now click on "Subdivide Faces" in "ProBuilder"
It's possibly down the list somewhere or an icon.
It can be a little hard to see, but what was a single face is now 4 faces… If I select 2 alternative ones it may make it obvious
We don't really need four, just 2 long ones…
We can merge them back together… selecting two
And selecting "Merge Faces" in ProBuilder again, and do the same to the other two.
The main problem with this is that it creates vertices that aren't needed. We can remove them, but we have the shape we need now.
There are 3 vertices in the middle of the object, running along the width of it. Use the 'Vertex' tool and select all 3 of them
Now, my grid settings are set to 0.2, which is about right for this, and snap is turned on. With these 3 points selected , using the 'blue' 'Z' arrow, move those points to the right, towards what is the 'front' of the 'floor'. I end up with it about here…
Now. We need to add the lip itself. We need to move the front edge itself up. Selecting the 3 points that make the front top… (I adjusted the view slightly)
The grid was left on and using the 'Green' 'Y' arrow, I move the points up a single grid unit.
And that looks about right.
Play the game and you'll noticed coins actually get stuck now and with the slowly pusher, it's taking all the coins in the players wallet to actually get anywhere
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 26 - Refining the Game - Part 3
- Part 27 - More Refinements
- Part 28 - Slowing the user down
- Part 29 - Some more changes