HOW TO?
about brushes...


How to hide or show a brush?

Static brushes don't take advantage of the disable property, like the dynamic ones.

To hide a static brush you simply set it's B_DRAW property to 0. To show it again set it back to 1, if you want it only to be displayed on screen, to 2 if you want it only in the material map and to 3 to have it both on the screen and in the material map.

Use BrushSet(BrushFind(ID),B_DRAW,0) to set the draw property of a brush.

Remember that when affecting a brush that writes in the material map and is situated in the current room, you should request the material map to be refreshed, or the changes will not apply until you reenter the room. Use the GameCommand(CMD_REFRESH)

For more info, read the Static brushes chapter from the DizzyAGE book.


How to break a wall?

A wall that is ment to block your path, should be made from a static brush.
Give an unique id to this brush, and when you must break it, access and hide it.
Use BrushSet(BrushFind(ID),B_DRAW,0) and then, if you are in the same room with the wall,
refresh the material map with GameCommand(CMD_REFRESH)

Of course you can have your wall build from more than one static brushes, and then you should access and hide all of them, using their unique ids.

If you want to use an item near the wall, to break it, you must also use an invisible dynamic brush, as an action trigger, because the static brushes can't be interacted with.

For more info, read the Static brushes chapter from the DizzyAGE book or check how the cave entrance is unblocked in the demo game, Dizzy and the Mushroom Pie


How to open a door?

This is very similar with the article above, How to break a wall?.
Instead of a wall, you have a door. It's a static brush that blocks your path, with an invisible dynamic brush, as a trigger, next to it, so you can be able to interact when you press action key there.

To simulate opening, you can adjust it's properties, like the tile and the material (from block to air), or you can use two brushes, one representing the closed door and the other representing the opened door. As you open and close the door, you can hide or show them.

The puzzle can be extended by using a key item on the door trigger.

For more info, read the Static brushes chapter from the DizzyAGE book.