FR

Réalités Parallèles

Ergonomie et conception de jeu vidéo

Gamemaker Studio Horizontal Shooter - Basics - Scrolling backgrounds

Creating backgrounds

Right click on backgrounds and create a new one.

Screenshot

Name your background

Screenshot

Edit Background and draw the art you want for it.

Screenshot

I’m doing a starry sky. It looks bigger in the screenshot because I zoomed in (mouse wheel) to draw more precisely.

Screenshot

Check the green checkbox to confirm.

Screenshot

Click Ok to save this background.

Displaying a background in a room

Now let’s assign this background to a room.

Double click your room to edit it, then select the backgrounds tab. In this example, I had previously set the background color to be black to fit my asteroids theme.

Screenshot

With background0 selected, I assign a background image from the list that appears when I click “

Screenshot

Make sure to check “visible when room starts”.

Screenshot

Then click the green check icon at the top to save.

Basic animated background

Now let’s make the background scroll vertically downwards.

In the room properties, go to the settings tab. Then click on “Creation code”.

To move the background, I used the code:

background_vspeed[0] = 0.5;

Note: having values below 1 can cause flickering as the game is unable to draw half pixels properly. 0.5 worked for me, but 0.2 looked awful. If you want to be safe, keeping speed values above 1 should always work smoothly.

Screenshot

Practice

Add a second layer of background stars above the one we just made to give the illusion of depth.

Tips:

Example results

Art:

Screenshot

Room background 2:

Screenshot

Room creation code:

Screenshot

Practice

Now try to create the same effect with a horizontal scroll instead of a vertical one.

Tips:

Example result

Screenshot

Posted by Cornelia on 2021-04-03. Last updated on 2021-03-05

Articles on similar topics

Game Maker Studio tutorials

Game development tutorial, Gamemaker development tutorials, Game Maker studio programming, Programming video games for beginners,

Gamemaker Studio Horizontal Shooter - Basics - Creating sprites

Game development tutorial, Gamemaker development tutorials, Game Maker studio programming, Programming video games for beginners,

Gamemaker Studio Horizontal Shooter - Basics - Creating a room

Game development tutorial, Gamemaker development tutorials, Game Maker studio programming, Programming video games for beginners,

Gamemaker Studio Horizontal Shooter - Basics - Creating a player character

Game development tutorial, Gamemaker development tutorials, Game Maker studio programming, Programming video games for beginners,

Gamemaker Studio Horizontal Shooter - Basics - Prevent the player from leaving the screen

Game development tutorial, Gamemaker development tutorials, Game Maker studio programming, Programming video games for beginners,

Game Maker Studio tutorials

Game development tutorial, Gamemaker development tutorials, Game Maker studio programming, Programming video games for beginners,