Making a loop

Ah, my favorite thing about motocross-type games...the loop. I don't know about you, but I've been looking forward to this section from the moment the book started. Before we start, let's explain the principle to you.

To complete a loop, the rover must be moving at high velocity so that its centrifugal force lets it defy gravity and keeps it on the ground even though the ground is upturned. So, we're going to need to build a long incline, and a steep downward ramp leading into the loop so that it can make it all the way around the loop without crashing down on its roof. But it still needs to be challenging, so it can't work just blindly. Firstly, what we're going to have to do is build the ramp so that in order to take it properly, the player will have to lean the vehicle so that after it comes off the top of the hump, it's airborne and needs to touch down in a way to help the velocity be high enough to carry it through the loop.

Secondly, as Buildbox is 2-dimensional, we'll have to build gaps in the ramp so that it can enter and exit the circle. But those gaps will need to be placed strategically, in such a way that it doesn't affect the rover's ability to traverse the loop.

Sound difficult? It isn't really...it just requires testing and adjusting to get it right.

First, let's build the ground. Go ahead and create a new scene called Loop, and make it look like this:

Making a loop

There we go...a nice smooth hump with a steep drop, and a ski-jump style ramp. Now we'll move on to the loop itself.

There's a strategy for making a loop. If you've ever looked closely at a roller coaster, only the highest-speed loops are actually circular. A loop that threatens to let you drop off at the top (low speed) needs to gradually get smaller. We're going to use the take-off ramp we've made to both take off (the top of it) the rover, and land the rover back safely (on the back side).

We could give you the settings for each individual piece of this loop. However, it's important to remember that this book is supposed to teach you how to use Buildbox, not just how to create Ramblin' Rover.

So, there is a PNG file in Projects/RamblinRover/Ground called RawGroundBlock-Mars.png. We'll use this to construct the platform for our loop. Drag this in as an object that destroys our character on collision (but not a Physics Object), duplicate it, and use scaling, rotation, and position to make the loop. Remember, test it using the soloing method and tweak it until you can (reliably) make it through the loop.

It should look something like the following screenshot:

Making a loop

Even Mars has gravity, and there's no way that loop is just going to sit there in mid-air. So let's build a framework as a decoration for it.

First, let's bring in two-more steel objects from our asset library. But change the Collision Type to NoCollide for both, and using the Layers window, place them under all other objects in the GamePlayLayer folder. Remember, we don't want to hit these supports as if they're obstacles. Position them as shown in the following screenshot:

Making a loop

Great! So now we've got our ground anchors for our structure, but we have no support structure. We want it to look kind of rickety, to add a bit more subconscious adrenaline for players...but this structure looks just downright unfeasible. Use the same technique to add some crossbeams to make it look like the following screenshot:

Making a loop

There we go!

Tip

As a side note, I had to do this twice because on the first try I inadvertently made it look like a pentacle. These things can happen sometimes, but it's important to note that we're not making the game Doom here. We also want to keep our potential user-base as wide as possible. For marketing purposes, know your audience. As we're dealing with geometry here, you may accidentally create a geometric shape that alienates a segment of your audience. Pay attention to these details; although sometimes controversy can be good free marketing, you also risk a boycott in this day and age.

So, now that the PC speech is over with...AWESOME! We have a really cool loop that looks kind of rickety, and everything works as expected in our easy level. "Too easy," you might say. Yes...if the whole goal is only to drive the rover around. But we have still to add our pickup coins (some of which will be pure death-bait), and our secret level portal!

Let's start with our secret level...

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.142.249.42