diff --git a/platform.g3a b/platform.g3a index c1d5efe..c4084ec 100644 Binary files a/platform.g3a and b/platform.g3a differ diff --git a/src/collide.c b/src/collide.c index 2357da2..1cffad3 100644 --- a/src/collide.c +++ b/src/collide.c @@ -6,11 +6,11 @@ char collide(int x, int y, char level[], char tile) if ((level[(int)(x/8) + (int)(y/8) * LEVEL_WIDTH] == tile) || (level[(int)(x/8) + (int)((y+PLAYER_SIDES)/8) * LEVEL_WIDTH] == tile) || (level[(int)((x+PLAYER_SIDES)/8) + (int)((y+PLAYER_SIDES)/8) * LEVEL_WIDTH] == tile) || - (level[(int)((x+PLAYER_SIDES)/8) + (int)(y/8) * LEVEL_WIDTH] == tile) || + (level[(int)((x+PLAYER_SIDES)/8) + (int)(y/8) * LEVEL_WIDTH] == tile) /*|| (level[(int)(x/8) + (int)((y+PLAYER_SIDES/2)/8) * LEVEL_WIDTH] == tile) || (level[(int)((x+PLAYER_SIDES/2)/8) + (int)(y/8) * LEVEL_WIDTH] == tile) || (level[(int)((x+PLAYER_SIDES/2)/8) + (int)((y+PLAYER_SIDES)/8) * LEVEL_WIDTH] == tile) || - (level[(int)((x+PLAYER_SIDES)/8) + (int)((y+PLAYER_SIDES/2)/8) * LEVEL_WIDTH] == tile)) return 1; + (level[(int)((x+PLAYER_SIDES)/8) + (int)((y+PLAYER_SIDES/2)/8) * LEVEL_WIDTH] == tile)*/) return 1; return 0; } diff --git a/src/main.c b/src/main.c index ff2612d..9978982 100644 --- a/src/main.c +++ b/src/main.c @@ -90,7 +90,7 @@ int main(void) } //vertical movement if (UG_CAN_JUMP) jump_test(&jump_pressed, &jump_buffer, &jump_hold); - //if jump is pressed and on ground + //jump if (jump_buffer && on_ground) { vspd = JUMP_SPD; on_ground = 0; @@ -121,14 +121,15 @@ int main(void) { player_y += trunc_vspd; } - else - { + else + { int sign_vspd = sgn(trunc_vspd); while (!collide_solid(player_x, player_y + sign_vspd, level)) { player_y += sign_vspd; } vspd = 0; + jump_hold = 0; } } }