switch (state) {
case STATE_NORMAL:
- if (might_fall()) {
+ if (on_ground() && might_fall()) {
// turn around when we are at a ledge
turn_around();
}
void
Igel::collision_solid(const CollisionHit& hit)
{
+ update_on_ground_flag(hit);
+
if(hit.top || hit.bottom) { // floor or roof
physic.set_velocity_y(0);
return;