Skip to content

Commit

Permalink
Add physics to mole and set collision groups.
Browse files Browse the repository at this point in the history
  • Loading branch information
MatusGuy committed Jul 7, 2023
1 parent d78c56b commit 8b20fce
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/badguy/mole.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ Mole::Mole(const ReaderMapping& reader) :
timer(),
throw_timer()
{
m_physic.enable_gravity(false);
m_physic.enable_gravity(true);
SoundManager::current()->preload("sounds/fall.wav");
SoundManager::current()->preload("sounds/squish.wav");
SoundManager::current()->preload("sounds/dartfire.wav");
Expand Down Expand Up @@ -132,31 +132,31 @@ Mole::set_state(MoleState new_state)
switch (new_state) {
case PRE_THROWING:
set_action("idle");
set_colgroup_active(COLGROUP_DISABLED);
set_colgroup_active(COLGROUP_MOVING_ONLY_STATIC);
timer.start(MOLE_WAIT_TIME);
break;
case THROWING:
set_action("idle");
set_colgroup_active(COLGROUP_DISABLED);
set_colgroup_active(COLGROUP_MOVING_ONLY_STATIC);
timer.start(THROW_TIME);
throw_timer.start(THROW_INTERVAL);
break;
case POST_THROWING:
set_action("idle");
set_colgroup_active(COLGROUP_DISABLED);
set_colgroup_active(COLGROUP_MOVING_ONLY_STATIC);
timer.start(MOLE_WAIT_TIME);
break;
case PEEKING:
set_action("peeking", 1);
set_colgroup_active(COLGROUP_STATIC);
set_colgroup_active(COLGROUP_MOVING_STATIC);
break;
case DEAD:
set_action("squished");
set_colgroup_active(COLGROUP_DISABLED);
set_colgroup_active(COLGROUP_MOVING_ONLY_STATIC);
break;
case BURNING:
set_action("burning", 1);
set_colgroup_active(COLGROUP_DISABLED);
set_colgroup_active(COLGROUP_MOVING_ONLY_STATIC);
break;
}

Expand Down

0 comments on commit 8b20fce

Please sign in to comment.