[main.c+JTMM.g3a] Drill speed boost when hitting a wall

This commit is contained in:
KikooDX 2020-05-18 19:08:38 +02:00
parent b81c529278
commit a75eb5143f
2 changed files with 10 additions and 6 deletions

BIN
JTMM.g3a

Binary file not shown.

View File

@ -10,7 +10,8 @@
#include "menu.h"
#include "shared_define.h"
#define MAX_HSPD 2.5
#define MAX_HSPD 2.0
#define DRILL_HSPD 4.5
#define ACCELERATION 1.0
#define DECELERATION 0.5
#define MIN_VSPD -12.0
@ -152,7 +153,6 @@ int main(void)
if (hspd < MAX_HSPD)
{
hspd += ACCELERATION * friction;
if (hspd > MAX_HSPD) hspd = MAX_HSPD;
}
direction = move;
}
@ -295,11 +295,15 @@ int main(void)
break;
}
collide_and_erase(drill_x, drill_y, level, 'd');
if ((selected_direction == UP || selected_direction == DOWN) &&
(collide_spike(drill_x, drill_y, level) || collide_solid(drill_x, drill_y, level, polarity, 0)))
if (collide_spike(drill_x, drill_y, level) || collide_solid(drill_x, drill_y, level, polarity, 0))
{
vspd = -vspd;
drill_toggle = 0;
if (selected_direction == UP || selected_direction == DOWN)
{
vspd = -vspd;
drill_toggle = 0;
}
else if (selected_direction == LEFT) hspd = DRILL_HSPD;
else /*direction is RIGHT*/ hspd = -DRILL_HSPD;
}
}
//spike collision and death