Guest User

Untitled

a guest
Apr 26th, 2013
42
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #define _PUSH(pos) { _pushing = true; obj.push##pos##(); }
  2.             //_pushing is always false before this
  3.             if(colliding)
  4.             {
  5.                 // Horizontal Pushing
  6.                 if(Math.abs(axis.x) > PUSH_THRESHOLD)
  7.                 {
  8.                     if(_controller.isDown(Controller.LEFT) && axis.x > 0)
  9.                         _PUSH(Left);
  10.                     else if(_controller.isDown(Controller.RIGHT) && axis.x < 0)
  11.                         _PUSH(Right);
  12.                     else obj.stopPushing();
  13.                 }
  14.                 // Vertical Pushing
  15.                 else if(Math.abs(axis.y) > PUSH_THRESHOLD)
  16.                 {
  17.                     if(_controller.isDown(Controller.UP) && axis.y > 0)
  18.                         _PUSH(Up);
  19.                     else if(_controller.isDown(Controller.DOWN) && axis.y < 0)
  20.                         _PUSH(Down);
  21.                     else obj.stopPushing();
  22.                 }
  23.             }
  24.             else obj.stopPushing();
Advertisement
Add Comment
Please, Sign In to add comment