-
-
Notifications
You must be signed in to change notification settings - Fork 519
Fixes #3215: Ice isn't slippery for rocks #3226
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
Since the ice floor wasn't being recognized as ice, specially on the hills on level "Tip of the Ice", the floor didn't have the slippery feature. I changed the tile attributes to address this problem and added a condition on the rock logic to include a slippery property on ice. Now tux can throw a rock to hills and it will slide back down due to the slippery property.
@tobbi could you check this, please? |
257 257 257 257 257 273 273 273 273 | ||
257 257 257 257 257 273 273 273 273 | ||
257 257 0 257 257 0 0 273 273 | ||
257 257 257 257 257 0 0 273 273 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Rusty-Box The ice slopes aren't slippery. Was that intended? (tiles/snow/icechunk.png)
It looks like the behaviour is almost the same, both in master and this PR. So what was actually fixed?
|
@Hypernoot @Rusty-Box @tobbi could you check this last version? Solid Flat Ice: I decreased the friction |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't test it in-game but I suspect that anything essential has changed, except that the ice friction was decreased. So that fixes point 1. The rest remains.
If this PR shall be treated as a partial fix, then all you need is decreasing one value, the ice friction. And you can drop all the other changes.
257 257 0 257 273 273 | ||
257 257 0 257 0 0 | ||
0 0 0 0 273 273 | ||
273 273 273 273 273 273 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These tiles were not supposed to be slippery. If you need some testing tiles, then make the changes locally and don't push them to the PR.
0 0 0 0 0 259 259 259 259 0 0 | ||
0 0 0 0 0 259 259 259 259 259 259 | ||
0 0 0 0 0 0 0 259 259 259 259 | ||
0 0 259 259 259 259 259 259 259 259 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here
257 257 257 257 | ||
257 257 257 257 | ||
257 257 257 0 | ||
257 257 0 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here
@@ -177,10 +177,14 @@ Rock::collision_solid(const CollisionHit& hit) | |||
m_at_ceiling = true; | |||
} | |||
|
|||
if (m_on_ground || (hit.bottom && m_on_ice)) { | |||
if (m_on_ground && !m_on_ice) { | |||
// Full friction! | |||
m_physic.set_velocity_x(m_physic.get_velocity_x() * (1.f - (GROUND_FRICTION * (m_on_ice ? 0.5f : 1.f)))); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You don't need to check for the same condition twice.
// Full friction! | ||
m_physic.set_velocity_x(m_physic.get_velocity_x() * (1.f - (GROUND_FRICTION * (m_on_ice ? 0.5f : 1.f)))); | ||
} | ||
|
||
if (hit.bottom && m_on_ice) { | ||
m_physic.set_velocity_x(m_physic.get_velocity_x() * (1.f - (GROUND_FRICTION * (m_on_ice ? 0.2f : 1.f)))); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here
player->m_dir == Direction::LEFT ? -200.f : 200.f); | ||
//add minimum force when tux is still | ||
float throw_force = std::max(fabsf(player->get_physic().get_velocity_x()), 50.f); | ||
m_physic.set_velocity_x(player->m_dir == Direction::LEFT ? -throw_force : throw_force); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why does the throwing speed need to be changed? Nobody complained about this.
@Hypernoot I thought I fixed the problems! Could you help me identify the right tiles? On the code I can't identify them by their type. |
Since the ice floor wasn't being recognized as ice, specially on the hills on level "Tip of the Ice", the floor didn't have the slippery feature. I changed the tile attributes to address this problem and added a condition on the rock logic to include a slippery property on ice. Now tux can throw a rock to hills and it will slide back down due to the slippery property.
Video: https://youtube.com/shorts/B_z0Fx5yYJc?feature=share
Closes #3215