File tree Expand file tree Collapse file tree 4 files changed +18
-14
lines changed Expand file tree Collapse file tree 4 files changed +18
-14
lines changed Original file line number Diff line number Diff line change @@ -720,7 +720,11 @@ BadGuy::kill_squished(GameObject& object)
720
720
721
721
SoundManager::current ()->play (" sounds/squish.wav" , get_pos ());
722
722
m_physic.enable_gravity (true );
723
- m_physic.set_velocity (0 , 0 );
723
+
724
+ if (on_ground ())
725
+ m_physic.set_velocity (0 , 0 );
726
+ else
727
+ m_physic.set_velocity_y (0 .0f );
724
728
set_state (STATE_SQUISHED);
725
729
set_group (COLGROUP_MOVING_ONLY_STATIC);
726
730
auto player = dynamic_cast <Player*>(&object);
@@ -1194,7 +1198,12 @@ BadGuy::ignite()
1194
1198
unfreeze ();
1195
1199
1196
1200
m_physic.enable_gravity (true );
1197
- m_physic.set_velocity (0 , 0 );
1201
+
1202
+ if (on_ground ())
1203
+ m_physic.set_velocity (0 , 0 );
1204
+ else
1205
+ m_physic.set_velocity_y (0 .0f );
1206
+
1198
1207
set_group (COLGROUP_MOVING_ONLY_STATIC);
1199
1208
m_sprite->stop_animation ();
1200
1209
m_ignited = true ;
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 @@ -187,7 +187,7 @@ WalkingBadguy::collision_solid(const CollisionHit& hit)
187
187
188
188
update_on_ground_flag (hit);
189
189
190
- if (m_frozen)
190
+ if (m_frozen || ! is_active () )
191
191
{
192
192
BadGuy::collision_solid (hit);
193
193
return ;
Original file line number Diff line number Diff line change @@ -104,18 +104,12 @@ Zeekling::on_bump_vertical()
104
104
void
105
105
Zeekling::collision_solid (const CollisionHit& hit)
106
106
{
107
- if (m_frozen)
107
+ if (m_frozen || ! is_active () )
108
108
{
109
109
BadGuy::collision_solid (hit);
110
110
return ;
111
111
}
112
112
113
- if (BadGuy::get_state () == STATE_SQUISHED ||
114
- BadGuy::get_state () == STATE_BURNING)
115
- {
116
- return ;
117
- }
118
-
119
113
if (hit.top || hit.bottom )
120
114
on_bump_vertical ();
121
115
else if (hit.left || hit.right )
You can’t perform that action at this time.
0 commit comments