-
-
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?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6304,12 +6304,12 @@ | |
5230 5231 0 0 0 0 0 0 0 | ||
) | ||
(attributes | ||
257 257 257 257 257 17 17 17 17 | ||
257 257 257 257 257 17 17 17 17 | ||
257 257 257 257 257 17 17 17 17 | ||
257 257 257 257 257 17 17 17 17 | ||
257 257 0 257 257 0 0 17 17 | ||
257 257 257 257 257 0 0 17 17 | ||
257 257 257 257 257 273 273 273 273 | ||
257 257 257 257 257 273 273 273 273 | ||
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 | ||
257 257 257 257 257 0 0 0 0 | ||
257 257 257 257 257 0 0 0 0 | ||
257 257 257 0 0 0 0 0 0 | ||
|
@@ -7146,10 +7146,10 @@ | |
) | ||
(attributes | ||
0 0 0 0 0 0 | ||
1 1 0 1 17 17 | ||
1 1 0 1 0 0 | ||
0 0 0 0 17 17 | ||
17 17 17 17 17 17 | ||
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 commentThe 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. |
||
) | ||
(datas | ||
0 0 0 0 0 0 | ||
|
@@ -7281,11 +7281,11 @@ | |
2070 2071 2072 2073 2074 5428 5429 5430 5431 5432 2079 | ||
) | ||
(attributes | ||
0 0 0 0 0 0 0 3 3 0 0 | ||
0 0 0 0 0 3 3 3 3 0 0 | ||
0 0 0 0 0 3 3 3 3 3 3 | ||
0 0 0 0 0 0 0 3 3 3 3 | ||
0 0 3 3 3 3 3 3 3 3 0 | ||
0 0 0 0 0 0 0 259 259 0 0 | ||
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 commentThe reason will be displayed to describe this comment to others. Learn more. same here |
||
) | ||
(images "tiles/snow/unisolid.png") | ||
) | ||
|
@@ -8632,10 +8632,10 @@ | |
7447 7448 7449 7450 | ||
) | ||
(attributes | ||
1 1 1 1 | ||
1 1 1 1 | ||
1 1 1 0 | ||
1 1 0 0 | ||
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 commentThe reason will be displayed to describe this comment to others. Learn more. same here |
||
0 0 0 0 | ||
0 0 0 0 | ||
0 0 0 0 | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -153,7 +153,7 @@ Rock::collision_solid(const CollisionHit& hit) | |
if (is_grabbed()) { | ||
return; | ||
} | ||
if (hit.top || hit.bottom) | ||
if (!m_on_ice && (hit.top || hit.bottom)) | ||
m_physic.set_velocity_y(0); | ||
|
||
if (hit.left || hit.right) { | ||
|
@@ -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 commentThe reason will be displayed to describe this comment to others. Learn more. You don't need to check for the same condition twice. |
||
} | ||
|
||
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 commentThe reason will be displayed to describe this comment to others. Learn more. same here |
||
} | ||
} | ||
|
||
HitResponse | ||
|
@@ -286,8 +290,9 @@ Rock::ungrab(MovingObject& object, Direction dir) | |
} | ||
else | ||
{ | ||
m_physic.set_velocity_x(fabsf(player->get_physic().get_velocity_x()) < 1.f ? 0.f : | ||
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 commentThe 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. |
||
m_physic.set_velocity_y((dir == Direction::UP) ? -500.f : (dir == Direction::DOWN) ? 500.f : | ||
(glm::length(m_last_movement) > 1) ? -200.f : 0.f); | ||
} | ||
|
Uh oh!
There was an error while loading. Please reload this page.
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)