Fix Actor Collision Checks Again

* Recent collision update caused a regression where the player would get
  "stuck" while standing on top of a solid doodad, unable to walk left
  or right.
* When deciding if the actor is on top of a doodad, use the doodad's
  Hitbox (if available) instead of the bounding box. This fixes the
  upside-down trapdoor acting solid when landed on from the top, since
  its Hitbox Y coordinate is not the same as the top of its sprite.
* Cheats: when using the noclip cheat in Play Mode, you can hold down
  the Shift key while moving to only move one pixel at a time.
master
Noah 2020-01-02 22:05:49 -08:00
parent b6c516bd4f
commit f7c4847934
1 changed files with 5 additions and 4 deletions

View File

@ -19,10 +19,6 @@ function main() {
var startedAnimation = false;
Events.OnCollide(function(e) {
// Only trigger for mobile characters.
if (!e.Actor.IsMobile()) {
return;
}
// If the floor is falling, the player passes right thru.
if (state === stateFalling || state === stateFallen) {
@ -36,6 +32,11 @@ function main() {
return false;
}
// If movement is not settled, be solid.
if (!e.Settled) {
return false;
}
// Begin the animation sequence if we're in the solid state.
if (state === stateSolid) {
state = stateShaking;