comparison test/testsprite2.c @ 2834:feb6ccdb888f

minor bug
author Sam Lantinga <slouken@libsdl.org>
date Fri, 05 Dec 2008 07:01:12 +0000
parents 6bacfecbf27e
children 9dde605c7540
comparison
equal deleted inserted replaced
2833:c2e182a37f5f 2834:feb6ccdb888f
127 if ((position->x < 0) || (position->x >= (window_w - sprite_w))) { 127 if ((position->x < 0) || (position->x >= (window_w - sprite_w))) {
128 velocity->x = -velocity->x; 128 velocity->x = -velocity->x;
129 position->x += velocity->x; 129 position->x += velocity->x;
130 } 130 }
131 position->y += velocity->y; 131 position->y += velocity->y;
132 if ((position->y < 0) || (position->y >= (window_h - sprite_w))) { 132 if ((position->y < 0) || (position->y >= (window_h - sprite_h))) {
133 velocity->y = -velocity->y; 133 velocity->y = -velocity->y;
134 position->y += velocity->y; 134 position->y += velocity->y;
135 } 135 }
136 136
137 /* Blit the sprite onto the screen */ 137 /* Blit the sprite onto the screen */