The library has a new demo called "v2.4" which shows what the new features are and how they work (I'm not sure why I didn't think to add a demo for each new version earlier!). If you'd like to just read about it, here are descriptions of the new features in version 2.4:
The update includes many new camera options. The options are contained in the mob's camera var, which is an object of type /Camera. This is a simple object that contains some vars you can use to change how the camera is handled.
These are used to set the position of the camera. To move the camera up by 96 pixels you can do this:
camera.py += 96
The camera.lag var controls how many pixels the player can move from the camera before the camera will move to follow the player. By default this is zero - every time the player moves the camera will follow.
The camera.mode var can be set to either camera.FOLLOW or camera.SLIDE. The default mode is follow. In this mode the camera moves as fast as the player does to constantly track the player. In the slide mode, the camera will speed up and slow down to follow the player using smoother motions.
mob.camera.minx, mob.camera.maxx, mob.camera.miny, mob.camera.maxy
These vars define a rectangle that the camera will stay inside of. You can use this to create rooms. When the camera scrolls too far it might reveal what's inside the next room and ruin a surprise, this can be used to prevent that. You can also use it to control how the camera scrolls - if miny and maxy are set to the same value, the camera will only scroll horizontally.
In the "v2.4" demo, several areas are created. When you enter an area the camera bounds are changed. This way you just have to define the bounds, place the area on the map, and the library takes care of limiting the camera's movement.
atom.stepped_on, atom.stepped_off, atom.stepping_on
The stepped_on proc has existed for a while now, but in this update it gets a change. Now, the stepped_on proc is called when a mob begins to stand on top of an atom (the mob is the argument to the proc). The stepped_off proc is called when the mob stops standing on the atom. The stepping_on proc is called every tick for as long as the mob is standing on the atom (this is how the stepped_on proc used to work). Also, for stepping_on, there is a second argument which is the number of ticks that the mob has spent standing on the atom. This way, if you want to make a lava floor tile that hurts the player once per second for as long as they're standing on the tile.
Here is the complete list of update notes:
- Added a demo called "v2.4" which shows how to use the features that are new in this
version. I used to add examples of new features into whatever existing demos were most
relevant. I wish I had thought of doing it this way sooner!
- Added the flags_left, flags_right, flags_top, and flags_bottom vars which behave
just like atom.flags except they let you define properties for individual sides of
the atom. The mob's flags are binary ORed with the atom's flags var and the specific
side's flags var.
- Added camera.dm which contains the set_camera proc (which was previously in pixel-movement.dm)
and the /Camera object. A var called "camera" was added for mobs that's an instance of the
Camera object. This object stores all properties related to the camera.
- The camera.mode var can be set to camera.FOLLOW or camera.SLIDE to switch between a camera
that strictly follows the mob and one that speeds up and slows down to smoothly follow the mob.
- The camera.lag var can be used to specify the number of pixels the mob can move away from
the camera before the camera will move to follow the mob.
- The camera.px and camera.py vars can be used to set the camera's position.
- The camera.minx, camera.maxx, camera.miny, and camera.maxy vars can be used to specify
bounds on the camera's position. The set_camera proc's default behavior will not move the
camera outside of these bounds.
- The camera can still do some weird things when you use EDGE_PERSPECTIVE, so I recommend not
using it and instead using the minx, maxx, miny, and maxy vars to enforce camera bounds near
the edge of the map.
- Added the stepped_off and stepping_on procs and changed how the stepped_on proc works.
stepped_on is called only once when you first step on an atom, stepped_off is called
once when you stop standing on an atom. stepping_on is called every tick for the whole
time you're standing on top of the atom.
- Updated the reference to include all new vars, procs, and objects.