in coinrun/coinrun.cpp [1225:1274]
void sub_step(float _vx, float _vy)
{
float ny = y + _vy;
float nx = x + _vx;
if (_vy < 0 && !maze->has_vertical_space(x, ny, false)) {
y = int(ny) + 1;
support = true;
vy = 0;
} else if (_vy < 0 && !maze->has_vertical_space(x, ny, true)) {
if (action_dy >= 0 && int(ny)!=int(y)) {
y = int(ny) + 1;
vy = 0;
support = true;
} else { // action_dy < 0, come down from a crate
support = false;
y = ny;
}
} else if (_vy > 0 && !maze->has_vertical_space(x, ny + 1, false)) {
y = int(ny);
while (!maze->has_vertical_space(x, y, false)) {
y -= 1;
}
vy = 0;
} else {
y = ny;
}
int ix = int(x);
int iy = int(y);
int inx = int(nx);
if (_vx < 0 && is_wall(maze->get_elem(inx, iy)) ) {
vx = 0;
x = int(inx) + 1;
} else if (_vx > 0 && is_wall(maze->get_elem(inx + 1, iy))) {
vx = 0;
x = int(inx);
} else {
x = nx;
}
eat_coin(ix, iy);
eat_coin(ix, iy+1);
eat_coin(ix+1, iy);
eat_coin(ix+1, iy+1);
}