Gw Temp

Menu

Tutorial - 'Parallax Backgrounds in Game Maker' by Lith

An item about RPGMaker 2000 posted on

Blurb

Teaches how to make scrolling backgrounds in Game Maker. Aimed at new users with a basic knowledge of GM.

Body

This tutorial will cover creating parallax backgrounds in Game Maker. It's not particularily advanced and is aimed at users with a basic understanding of GM. Rooms and such. Well, let's go ahead and get started. Normally parallax, also known as scrolling, backgrounds are most commonly used in games such as space shooters, or to display cloud effects, etc. With this tutorial we will be making a scrolling space background.

GM gameplay takes place in rooms. These rooms normally will have a background image to them, whether it is a sky, an ocean, a wall, or space, whatever fits the setting for the room. So, you will have to have an open room in which to work in. But first, we must create our background! Click the add a background button on the toolbar, the tan box, or press Ctrl + Alt + B. Click edit background and draw in a nice little blue background with a few stars. If you are completely without artistic talent, or just plain lazy, here's an example background I made that you can use.


Now save this background, and create another one. Make it transparent. Put in a few stars here and there. Again, I've included an example.


Save it, and create one more background, transparent, and with some stars. On this one I made my stars about one pixel and put quite a few in it. Here's an example.


Okay, now that we have our three backgrounds, we need a room to display them in. Click the add a room button at the top of the toolbar, it's the maze button, or press Ctrl + Alt + R. Once you have your room open, click the backgrounds tab. If draw background color is checked, uncheck it. Now you should see a list, Background 0 to Background 7. Click on Background 0. Check the box, visible when room starts, that way the player can see the background when they enter the room. Well, next thing we have to do is specify which background to display, next to click the little menu button. Select your first background (the non-transparent one).

Now here's where we make it parallax. There are two text boxes, Hor. Speed and Vert. Speed. Simply enter in a number for how fast your background scrolls (pixels per second). For the Hor. Speed, enter a positive number to scroll right, and a negative number to scroll left. Vert. Speed, positive number for down, negative number for up. For our space example, enter 2 for the Vert. Speed and leave Hor. Speed at 0. Now, in the list of backgrounds above, click Background 1. Make it visible at room start, and choose the second background from the drop-down menu. Set the Vert. Speed to 3. Finally, click Background 2, make visible, and choose the third background from the menu. Set the Vert. Speed to 6. Now run the program. If done correctly, you should see 3 layers of stars scrolling at various speeds. Experiment around with the Hor. Speed and Vert. Speed and transparent backgrounds, and I'm sure you'll discover some useful effects.

If you have any questions, feel free to E-mail me