Pixel Movement - This creates the movement system. It handles the movement, collision detection, and keyboard input.
Keyboard - The Pixel Movement library uses the Keyboard library for its input. This makes it easy to add custom keyboard commands to the game - all I have to do is override the mob's key_down() proc. For example:
mob
key_down(k)
..()
if(k == "escape")
level_menu()
That's all it takes to show the level menu when a player hits the escape key.
HUD Groups - The level menu (with the Retry, Exit, and Continue buttons) was implemented in about 2 minutes. The HUD Groups library makes the addition and positioning of screen objects easy. Also, by using the Keyboard library I can set focus to the level menu object so you can press the R key to restart the level (only while the menu is open).
Map Instancing - When the player enters a level they're actually entering a new map instance. You don't have to worry about restoring the initial state of each puzzle - with a single line of code you get a fresh instance of the original puzzle. This also makes it easy to reset a puzzle. If a player dies or voluntarily chooses to restart a level, we just reset the map instance (the library handles this for us).
// to make a new instance
map = maps.copy(zone.target_z)
// to reset the instance
map.reset()
The Map Instancing library also provides methods to retrieve objects by type within a map instance. For example, when a player enters a zone they're moved to the turf of type /turf/start within the map instance. To find the start, this is all it takes:
var/list/turfs = map.get(/turf/start)
start = turfs[1]
Region - Regions are used to associate buttons with doors. The library provides a proc to get a list of objects (by type) that are connected to a source atom by the region. To make a switch open a door, we simply place a switch turf and door turf on the map then place a region on the map connecting the two. Then, we do this to find the doors that are controlled by the switch:
doors = region.get_list(src, /turf/door)
// when the player steps on the switch
for(var/turf/door/d in doors)
d.open()
These libraries handle common tasks that games need to perform. They don't just make it easy to develop this sample game, these libraries can be used in many different kinds of projects. Something that may seem daunting, like creating separate map instances for battle screens is handled by the Map Instancing library in a single line of code. Instead of wasting your time writing code to copy maps you can be more productive and spend your time writing code that uses the map copies.
You don't have to write this common code, you can skip right to writing code that uses the map instance. It might not seem like a big deal, but shaving 5-10 minutes off of every task can make a huge difference. BYOND has a lot of "half creations" because people get bogged down with the generic, common, basic tasks. By the time someone implements an elevation system from scratch they feel accomplished - they don't have to make a game using it, just creating the system itself is an accomplishment. By using libraries you cut out this overhead and jump right to more important things. The concept of using tools that handle generic, common, boilerplate-type tasks for you shouldn't seem strange, that's what using BYOND is about.