forked from jaildesigner-jailgames/jaildoctors_dilemma
Solo sube las rampas desde el principio. Las atraviesa al saltar
This commit is contained in:
@@ -260,13 +260,16 @@ void Player::move()
|
|||||||
x = pos + 1;
|
x = pos + 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Si ha tocado alguna rampa, asciende
|
// Si ha tocado alguna rampa mientras camina (sin saltar), asciende
|
||||||
v_line_t leftSide = {(int)x, (int)y, (int)y + h - 1};
|
if (state != s_jumping)
|
||||||
const int ly = room->checkLeftSlopes(&leftSide);
|
|
||||||
if (ly > -1)
|
|
||||||
{
|
{
|
||||||
y = ly - h;
|
v_line_t leftSide = {(int)x, (int)y + h - 2, (int)y + h - 1};
|
||||||
setState(s_standing);
|
const int ly = room->checkLeftSlopes(&leftSide);
|
||||||
|
if (ly > -1)
|
||||||
|
{
|
||||||
|
y = ly - h;
|
||||||
|
setState(s_standing);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -293,13 +296,16 @@ void Player::move()
|
|||||||
x = pos - w;
|
x = pos - w;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Si ha tocado alguna rampa, asciende
|
// Si ha tocado alguna rampa mientras camina (sin saltar), asciende
|
||||||
v_line_t rightSide = {(int)x + w - 1, (int)y, (int)y + h - 1};
|
if (state != s_jumping)
|
||||||
const int ry = room->checkRightSlopes(&rightSide);
|
|
||||||
if (ry > -1)
|
|
||||||
{
|
{
|
||||||
y = ry - h;
|
v_line_t rightSide = {(int)x + w - 1, (int)y + h - 2, (int)y + h - 1};
|
||||||
setState(s_standing);
|
const int ry = room->checkRightSlopes(&rightSide);
|
||||||
|
if (ry > -1)
|
||||||
|
{
|
||||||
|
y = ry - h;
|
||||||
|
setState(s_standing);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -488,7 +488,7 @@ void Room::fillMapTexture()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// LeftSlopes
|
// LeftSlopes
|
||||||
if (false)
|
if (true)
|
||||||
{
|
{
|
||||||
for (auto l : leftSlopes)
|
for (auto l : leftSlopes)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user