Lesson: How to make a door

Note: this tutorial is out of date. You can use the concepts from this tutorial combined with Picking Up Objects using Collision detection to recreate this.

 

Let’s learn how to make a door using the awesome power of the Advanced Behaviors Editor!

Before we open the Gamefroot game creator, let’s get some door tiles.

 

To download these tiles, right-click the images, and choose “Save link as”.

Open the game creator, and draw up a level similar to this with a room that has an entrance two tiles high.

Now upload the door tiles to your custom items list. To do this, click the Items tab, and click the + button.

Then find and select the door images that you have just downloaded. Once they are added to your custom items, place them down where you want your door to be. Also place a key somewhere in the level where the player can collect it.

Let’s make the door open only when the player walks up to it with the key collected. Click on the Properties tool, and click one of the door tiles.

Then click Advanced, and click “Add Advanced Behavior”

Now that you are inside the Advanced Behavior Editor, find the block that says “When touch by \  /  starts”, and drag it into the blank working space.

Then grab the \Player/ token from the Sensing tab, and put it in the empty slot. After that, drag out the “If < > then” block (in the Control tab), and snap it underneath the first block.

 

Then find the rest of the blocks and tokens to create a stack of blocks that looks like this:

This door item will now flip and become not solid when it is touched by the player, but only after the player has collected the key (which increases the door’s health by 100).

Make sure you go and apply the same behaviors to the other door tile as well.

We want to make sure the message “Key collected” actually gets sent out once the key is collected, so open the Advanced Behaviors for the key item, and replicate this:

Great! Now let’s test it out:

http://gamefroot.com/games/door-and-key-2/

 

To learn more about making cool interactive items by using the Advanced Behavior’s Editor, check out these resources:

https://gamefroot.zendesk.com/forums/20759342-using-advanced-behaviours 

4 Replies to “Lesson: How to make a door”

Leave a Reply