Chapter 4. Advanced World Design – Ramblin' Rover, Part 2

That was a lot of work in the last chapter, wasn't it? This chapter is going to take all of that up a notch. We're going to complete our Mars world, and even knock out two more worlds! If you're unsure of anything we covered previously, please take a moment to review it before we move forward. Ready? Ok, let's do this!

Making the rover jump

As we've mentioned before, we're making a hybrid game. That is, it's a combination of a motocross game, a platformer, and a side-scrolling shooter game. Our initial rover will not be able to shoot at anything (we'll save that feature for the next upgraded rover that anyone can buy with in-game currency). But this rover will need to jump in order to make the game more fun.

As we know, NASA has never made a rover for Mars that jumps. But if they did do that, how would they do it? The surface of Mars is a combination of dust and rocks, so the surface conditions vary greatly in both traction and softness. One viable way is to make the rover move in the same way a spacecraft maneuvers (using little gas jets). And since the gravity on Mars is lower than that on Earth, this seems legit enough to include it in our game.

While in our Mars Training Ground world, open the character properties for our Training Rover. Drag the animated PNG sequence located in our Projects/RamblinRover/Characters/Rover001-Jump folder (a small four-frame animation) into the JumpAnimation field. Now we have an animation of a jump-jet firing when we jump. We just need to make our rover actually jump. Your Properties window should look like the following screenshot:

Making the rover jump

The image above shows the relevant sections of the character's properties window

As promised in the previous chapter, we're now going to revisit the Character Gameplay Settings section. Scroll the Properties window all the way down to this section. Here's where we actually configure a few settings in order to make the rover jump. The preceding screenshot shows the section as we're going to set it up. You can configure your settings similarly.

The first setting we are considering is Jump Force. You may notice that the vertical force is set to 55. Since our gravity is -20 in this world, we need enough force to not only counteract the gravity, but also to give us a decent height (about half the screen). A good rule is to just make our Jump Force 2x our Gravity.

Next is our Jump Counter. We've set it to 1. By default, it's set to 0. This actually means infinity. When the JumpCounter is set to 0, there is no limit to how many times a player can use the jump boost...they could effectively ride the top of the screen using the jump boost like a flappy bird control. So, we set it to 1 in order to limit the jumps to one at a time.

Note

There is also a strange oddity with Buildbox that we can exploit with this. The jump counter resets only after the rover hits the ground. But, there's a funny thing... the rover itself never actually touches the ground (unless it crashes), only the wheels do. There is one other way the jump counter can reset: by doing a flip. What this means is that once a player uses their jump up, the only way to reset it is to do a flip-trick off a ramp. An added level of difficulty and excitement to the game by using a quirk of the development software!

We could trick the software into believing that the character is simply close enough to the ground to reset the counter by increasing the Ground Threshold to the distance that the body is from the ground when the wheels have landed. But why? It's kind of cool that a player has to do a trick to reset the jump jets.

Finally, let's untick the Jump From Ground checkbox. Since we're using jets for our boost, it makes sense that the driver could activate them while in the air. Plus, as we've already said, the body never meets the ground. Again, we could raise the ground threshold, but let's not (for the reasons stated previously).

Awesome! Go ahead and give it a try by previewing the level. Try jumping on the small ramp we created that's used to get on top of our cave. Now, instead of barely clearing it, the rover will easily clear it, and the player can then reset the counter by doing a flip off the big ramp on top.

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

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