-
-
Notifications
You must be signed in to change notification settings - Fork 523
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? |
data/images/tiles.strf
Outdated
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.
@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. |
… when the rock falls down the slopes and the friction feels more natural.
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 revoke my review. It looks like I can't delete this post, so just ignore this lol
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.
Your code is equivalent to:
if (m_on_ground || (hit.bottom && m_on_ice)) {
// Full friction!
m_physic.set_velocity_x(m_physic.get_velocity_x() * (1.f - (GROUND_FRICTION * (m_on_ice ? 0.3f : 10.f))));
}
This is almost the original code, except that two values are changed.
Can you tell me why you changed the non-ice friction from 1.0 to 10.0? Nobody complained about that.
@Hypernoot the non-ice friction value changed by mistake! I will fix that! I had changed the GROUND_FRICTION constant and then also changed that value and forgot to change! |
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.
almost ^.^
src/object/rock.cpp
Outdated
@@ -177,9 +177,9 @@ Rock::collision_solid(const CollisionHit& hit) | |||
m_at_ceiling = true; | |||
} | |||
|
|||
if (m_on_ground || (hit.bottom && m_on_ice)) { | |||
if (m_on_ground || (hit.bottom && m_on_ice)) { |
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 accidentally messed up indentation.
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