kyleconroy/hawkthorne-journey — pull request #567 by campadrenalin (2012-11-12 08:04:16+00:00)
Title: Platform interface

This introduces the new platform interface technique for handling platforming objects like enemies, reusing as much code as possible with the player. The interface is simply a set of functions that an object may provide as callbacks for environmental objects such as floors, platforms, and walls.

### wall_collide_floor(node, new_y)

Callback for collisions with a floorlike object (note - floorspaces don't count). This means your feet touch the ground. This is the most important callback, as it is used by the player, baseball, and acorn within this branch.

```node``` is the environmental object being collided with (a platform, for example), and ```new_y``` is the y position that the environmental object would like to set on the platforming object.

### wall_collide_head(node, new_y)

Like wall_collide_floor, except that it only applies to "bumping your head" against the bottom of a wall. This distinction is useless for most nodes, but critical for the player to avoid calling impactDamage() and restore_solid_ground().

### wall_collide_side(node, new_x)

For horizontal collisions. new_x is the x position that the environmental object recommends as a resolution to the collision.

You can test this branch best in baseball, gay island, black caverns and forest 1. Leading acorns to their growly death is surprisingly satisfying.