IT WORKS NOW
This commit is contained in:
parent
f5b65a390b
commit
0f2d03526e
14 changed files with 19477 additions and 31 deletions
|
|
@ -1,7 +1,9 @@
|
|||
#include "01_automato.h"
|
||||
#include "../../logging.h"
|
||||
|
||||
void do_moving(void) {
|
||||
GameState_t* state = get_game_state();
|
||||
LOG_FUNCTION_START("do_moving", "moving_type=%d", state->moving_type);
|
||||
|
||||
switch (state->moving_type) {
|
||||
case LeftDown:
|
||||
|
|
@ -34,10 +36,10 @@ void do_moving(void) {
|
|||
|
||||
case ToDown:
|
||||
// Мгновенное падение: двигаем вниз, пока не упрёмся
|
||||
do {
|
||||
while (!check_collision()) {
|
||||
state->curr.y++;
|
||||
} while (!check_collision());
|
||||
state->curr.y--; // откат на 1 назад
|
||||
}
|
||||
state->curr.y--; // откат на 1 назад, чтобы убрать последний шаг, вызвавший коллизию
|
||||
state->state = Attaching; // сразу в Attaching
|
||||
break;
|
||||
|
||||
|
|
@ -45,4 +47,7 @@ void do_moving(void) {
|
|||
state->state = Move;
|
||||
break;
|
||||
}
|
||||
|
||||
LOG_FUNCTION_END("do_moving", "curr=(%d,%d), state=%d",
|
||||
state->curr.x, state->curr.y, state->state);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue