diff options
author | Colin Noga <Tempus@chronometry.ca> | 2013-06-01 16:49:34 -0500 |
---|---|---|
committer | Colin Noga <Tempus@chronometry.ca> | 2013-06-01 16:49:34 -0500 |
commit | fb2694aec8d0744ad3e407eb67b62e56c3b8cdd2 (patch) | |
tree | 61828799131592397966b48e06bab69e92610162 /src | |
parent | 4d4a226cfd5bd62da04ef70b623c2f568f7d5b64 (diff) | |
download | kamek-fb2694aec8d0744ad3e407eb67b62e56c3b8cdd2.tar.gz kamek-fb2694aec8d0744ad3e407eb67b62e56c3b8cdd2.zip |
Minor shy guy fix for ice block detection
Diffstat (limited to '')
-rw-r--r-- | src/shyguy.cpp | 40 |
1 files changed, 25 insertions, 15 deletions
diff --git a/src/shyguy.cpp b/src/shyguy.cpp index 32928c0..140501a 100644 --- a/src/shyguy.cpp +++ b/src/shyguy.cpp @@ -657,7 +657,7 @@ int daShyGuy::onCreate() { _324 = 16.0f; // These structs tell stupid collider what to collide with - these are from koopa troopa - static const lineSensor_s below(-6<<12, 6<<12, 0<<12); + static const lineSensor_s below(-5<<12, 5<<12, 0<<12); static const pointSensor_s above(0<<12, 12<<12); static const lineSensor_s adjacent(6<<12, 9<<12, 6<<12); @@ -1227,17 +1227,36 @@ bool daShyGuy::willWalkOntoSuitableGround() { void daShyGuy::executeState_RealWalk() { chrAnimation.setUpdateRate(1.5f); + // if (distance) { + // // What the fuck. Somehow, having this code makes the shyguy not + // // fall through solid-on-top platforms... + // bool turn = collMgr.isOnTopOfTile(); + // if (!turn) { + // if (!stillFalling) { + // stillFalling = true; + // pos.x = direction ? pos.x + 1.5 : pos.x - 1.5; + // doStateChange(&StateID_RealTurn); + // } + // } else + // } + + if (distance) { - // What the fuck. Somehow, having this code makes the shyguy not - // fall through solid-on-top platforms... - bool turn = collMgr.isOnTopOfTile(); - if (!turn) { + if (collMgr.isOnTopOfTile()) { + stillFalling = false; + + if (!willWalkOntoSuitableGround()) { + pos.x = direction ? pos.x + 1.5 : pos.x - 1.5; + doStateChange(&StateID_RealTurn); + } + } + else { if (!stillFalling) { stillFalling = true; pos.x = direction ? pos.x + 1.5 : pos.x - 1.5; doStateChange(&StateID_RealTurn); } - } else stillFalling = false; + } } bool ret = calculateTileCollisions(); @@ -1245,15 +1264,6 @@ bool daShyGuy::willWalkOntoSuitableGround() { doStateChange(&StateID_RealTurn); } - if (distance) { - if (collMgr.isOnTopOfTile()) { - if (!willWalkOntoSuitableGround()) { - pos.x = direction ? pos.x + 1.5 : pos.x - 1.5; - doStateChange(&StateID_RealTurn); - } - } - } - if(this->chrAnimation.isAnimationDone()) { this->chrAnimation.setCurrentFrame(0.0); } |