- if(other.get_flags() & FLAG_SOLID) {
- if(hit.normal.y < -.5) { // ground
- physic.set_velocity_y(JUMPSPEED);
- } else if(hit.normal.y > .5) { // roof
- physic.set_velocity_y(0);
- } else { // bumped left or right
- physic.set_velocity_x(-physic.get_velocity_x());
- }
-
- return CONTINUE;
+ if(hit.bottom) {
+ physic.set_velocity_y(JUMPSPEED);
+ } else if(hit.top) {
+ physic.set_velocity_y(0);
+ } else if(hit.left || hit.right) {
+ physic.set_velocity_x(-physic.get_velocity_x());