File tree Expand file tree Collapse file tree 2 files changed +9
-5
lines changed Expand file tree Collapse file tree 2 files changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -131,15 +131,16 @@ BouncingSnowball::collision_squished(MovingObject& object)
131
131
void
132
132
BouncingSnowball::collision_solid (const CollisionHit& hit)
133
133
{
134
- if (m_sprite->get_action () == " squished" )
135
- return ;
136
-
137
- if (m_frozen)
134
+ if (m_frozen || !is_active ())
138
135
{
139
136
BadGuy::collision_solid (hit);
140
137
return ;
141
138
}
142
139
140
+ if (m_sprite->get_action () == " squished" )
141
+ return ;
142
+
143
+
143
144
if (hit.bottom ) {
144
145
if (get_state () == STATE_ACTIVE) {
145
146
float bounce_speed = -m_physic.get_velocity_y ()*0 .8f ;
Original file line number Diff line number Diff line change @@ -87,7 +87,10 @@ CaptainSnowball::collision_solid(const CollisionHit& hit)
87
87
walk_speed = CAPTAIN_WALK_SPEED;
88
88
m_physic.set_velocity_x (m_dir == Direction::LEFT ? -walk_speed : walk_speed);
89
89
}
90
- WalkingBadguy::collision_solid (hit);
90
+ if (!is_active ())
91
+ BadGuy::collision_solid (hit);
92
+ else
93
+ WalkingBadguy::collision_solid (hit);
91
94
}
92
95
93
96
bool
You can’t perform that action at this time.
0 commit comments