How to Create Multi-Room Layouts For a 2D Game Using Arrays

4

Index

Stats

2,071 visits, 5,389 views

Tools

Translations

This tutorial hasn't been translated.

License

This tutorial is licensed under CC BY-NC 4.0. Please refer to the license text if you wish to reuse, share or remix the content contained within this tutorial.

Published on 16 Nov, 2022.

To get started, you will obviously need an Array. This will be where you will store each room so the game can reference it later.

To create an Array, open your project bar and scroll down to the Files folder. Right click on the folder, hover over the "+ Add" option, and click on Array.

This will create your array. Name it something like "rooms," and now you've got a ready-made array! Yay!

Next, create a Player object. This can just be a Sprite object with the Tile Movement behavior or some other motion behavior.

In Player's object properties, turn on Global. This makes it so your player object is present in all layouts without having a separate player for each one. This is important because there are going to be a lot of layouts and it will be a pain to delete the player from each one if you miss this step.

  • 0 Comments

Want to leave a comment? Login or Register an account!