ZuseApp/zuse-ios — pull request #66 by pwightman (2014-02-20 23:51:39+00:00)
Title: Change JSON semantics for post-physics collisions and groups

All collision events that previously caused something to bounce now explicitly bounce by calling the “bounce” method in their event handler. These changes are a result of conversations with @abutterf and @mhogenso during the last few days.

This decouples "contacting" from "colliding". This solves the problem of "what if we want to know when two things make contact, but don't want them to bounce off of one another?" It also fits nicely into our post-physics-engine world since we are no longer restricted by SpriteKit's semantics.

Also, since colliding (bouncing) is no longer the default behavior, I've renamed `collision_groups` to `groups` since these may be helpful outside of just contact/collision stuff.

@abutterf @finalfantasyfreak15 I would appreciate a code review, since you two will be influenced directly by this. @mhogenso @vladizhidkov feel free to chime in as well.

This will require that the renderer (both web and iOS) implement a "bounce" method that checks the sprite's surroundings for objects it is in contact with and changes x/y direction accordingly. Any code that automatically "bounced" the object on collisions should be removed (or moved into the "bounce" method). Also, be sure to change lookups for `collision_groups` and `collision_group` to just `groups` and `group`.