Skip to content

Commit

Permalink
Touched up the plane's behavior to account for Super Sonic #129
Browse files Browse the repository at this point in the history
Its X is now clamped instead of relying on character speed (which produces the same result, but accounting for what happens when the player gets knocked back repeatedly while running into an enemy.

As the player can still phase through the plane while hitting Big Bomb Badniks, the plane how has an emergency code, repositioning itself when this happens. This is not the most elegant solution, but at least it prevents a softlock.
  • Loading branch information
AlexKhayrullin committed Jan 14, 2021
1 parent 1c2d0e2 commit 77ee75e
Showing 1 changed file with 15 additions and 19 deletions.
34 changes: 15 additions & 19 deletions SonicTimeTwisted.gmx/objects/objPlaneGimmick.object.gmx
Original file line number Diff line number Diff line change
Expand Up @@ -252,30 +252,26 @@ remove = 0;
<kind>1</kind>
<string>/// Plane Motion
with objPlayer {
if other.x -4 &gt; x
other.x += xspeed;
if other.x +14 &lt; x
other.x += xspeed;
// clamping x instead of relying on speed, otherwise the player can fly off the plane
other.x = clamp(other.x, x - 14, x + 4);

if landed == false
{
if other.y &lt; y
other.y +=1;
}
else
if landed
{
rumble(rumble_short_weakest);
}
else
{
if other.y &lt; y
{
other.y +=1;
// emergency reposition of the plane if the player is clipping through
if(y &gt; other.y - 38)
{
other.y = ceil(y)+38;
}
}
}
}
//Rebound
/*if rebound {
y+=yspeed;
yspeed -=.1;
if yspeed &lt;= 0 {
rebound = false;
yspeed = 3;
}
}*/

y = floor(y);

Expand Down

0 comments on commit 77ee75e

Please sign in to comment.