Hello and welcome to another Feature Friday! Today, we’re looking at our starting stages, and what it takes to make a stage.

Pictured above, we have Arena. You’ll notice it’s three-platform layout is a familiar sight for fans of the Super Smash Bros series. Each of these platforms can be jumped through from the bottom, but you can still stand on them from the top.

And here we have our flat area, True Arena. This is a no-frills battleground, truly a test of skill! With no platforms to hide on, there’s nothing between you and your opponents but your own know-how.

There’s also a third stage, currently titled, simply, Arena(Moving Platform). This is meant to test the moving platform physics, and is simply Arena, but with the center platform moving up and down.

But what makes a stage? Thankfully, it’s very simple compared to a character. If you want to make a simple stage, with no fancy parts like a gigantic laser beam or a dragon hopping in to kill everyone, you’ll be able to make a stage with a few very simple steps!

First off, because these stages use a psuedo-3D look to them, the actual sprites of the stage are not quite what you see above. Here are the sprites that make up True Arena:

These two images, when placed directly next to eachother, look like a singe plane. But the bottom one, the foreground, is always drawn above the players, so that if you are in that location, you will show up behind the image. This means that, when hanging from ledges, or recovering low, you’ll be behind the stage, until you get back on top.

Here is the code for True Arena. Yup. That’s all of it. Above it is just some file paths for things like the music or the stage select icon. Right at the top, we define the size, camera maximum, and the blast line. The size is how big the stage is, pretty simple. The camera_maximum is how far out the camera will zoom. It is the biggest area that the camera will cover. The blast line is the zone that, when crossed, kills a character. Here it is the same as the size of the stage, but if you wanted to have a moving stage, or a stage with changing blast lines, or a stage with stuff drawn past the killzone, this would be different. All three of the rectangles will have the same center, and are defined in the form of (left, top, width, height) with positive being right and down, and negative being left and up. (0,0) is the topleft point on the screen, and should probably be where your size rectangle starts.

Next is the list of platforms. Platforms define the collision areas of the stage. Each one is basically a line between two points that makes a floor or wall. (Slopes are not working at the moment, but we’re working on them!) You give it a start point, an end point, and then define whether or not it’s sides are grabbable. Left side, then right side. In this case, we have a platform that starts 337 pixels left of center (337 is half the width of the stage sprites above, by the way) and ends 337 pixels right of center, and 102 pixels down, making a box for the collideable area of the platform. If you look at the code for Arena, you’ll see more entries in the list for Passthrough Platforms, another class provided in the stage module, and in Arena (Moving Platform), you can see an example of a custom-defines platform.

The next list is the spawn locations. This is where players 1, 2, 3, and 4 will spawn, in order. If you’d like it to be random, feel free to shuffle this list around to your liking after it’s defined.

The next two chunks actually draw the stage onto the screen. First, we define the foreground sprite (the code that runs off the edge of the image is just the filepath), move it to where it needs to be, and add it to the list of foreground objects. We repeat the process for the background sprite.

And finally, one last method call that will load the ledges from all platforms into memory, since we have added new ledges. Any time you add a grabbable platform to the screen, you should call this method again so the game knows where to find them.

And that’s all for this week! Now you know all you need to know about how to make your own stages! Give it a go if you’d like, and be sure to share them with us!