Skip to content

Commit

Permalink
Fix collision jitter
Browse files Browse the repository at this point in the history
  • Loading branch information
bl0ckeduser committed May 29, 2012
1 parent a046c6e commit f3ddb2d
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion TODO
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
+ Get the default world to load on the real console.


- Fix the collision resolve jitter.
+ Fix the collision resolve jitter.
(I must confess that I've seen in it in a professional
3d DS game once though)
- Test the new edge-evasion code
Binary file modified clown3d-DS.nds
Binary file not shown.
2 changes: 1 addition & 1 deletion collisions.c
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ void resolveCollisions(game_obj* objs, void (*handler)(void*, void*))
earlier collision calculations) is added for edge evasion. */
if(node->type == PLAYER && which == 3) {
node->box.min.x += move.x;
node->box.max.x += move.x;
node->box.max.x += move.x;
}
if(node->type == PLAYER && which == 1) {
node->box.min.z += move.z;
Expand Down
6 changes: 4 additions & 2 deletions player.c
Original file line number Diff line number Diff line change
Expand Up @@ -184,10 +184,12 @@ void playerCollide(game_obj* a, game_obj* b)
it results from movement on the
Y axis */

a->data[PLAYER_X] = a->box.min.x + 10;
if(a->box.move.y == 0)
a->data[PLAYER_X] = a->box.min.x + 10;
if(a->box.move.y != 0)
a->data[PLAYER_Y] = a->box.min.y + 10;
a->data[PLAYER_Z] = a->box.min.z + 10;
if(a->box.move.y == 0)
a->data[PLAYER_Z] = a->box.min.z + 10;

} else if(b->type == KEY && b->data[KEY_EXISTS]) {
/* Pick up a key */
Expand Down

0 comments on commit f3ddb2d

Please sign in to comment.