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.
This commit is contained in:
parent
b6c516bd4f
commit
f7c4847934
|
@ -19,10 +19,6 @@ function main() {
|
||||||
var startedAnimation = false;
|
var startedAnimation = false;
|
||||||
|
|
||||||
Events.OnCollide(function(e) {
|
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 the floor is falling, the player passes right thru.
|
||||||
if (state === stateFalling || state === stateFallen) {
|
if (state === stateFalling || state === stateFallen) {
|
||||||
|
@ -36,6 +32,11 @@ function main() {
|
||||||
return false;
|
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.
|
// Begin the animation sequence if we're in the solid state.
|
||||||
if (state === stateSolid) {
|
if (state === stateSolid) {
|
||||||
state = stateShaking;
|
state = stateShaking;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user