R49 : [Platform Behavior] - IsOnFloor (won't fix)

Bugs will be moved here once resolved.

Post » Mon Jul 25, 2011 3:53 am

Seems IsOnFloor doesn't work correctly when the sprite has frames with different sizes. The sprite collides on floor , isOnFloor is true, the next frame it returns false, then true , then false, then true etc...
So it appears IsOnFloor is moving the sprite up and down indefinitelly.
Example: A sprite has an animation with two frames one with 52px height and another with 49px height. When it collides in one frame IsOnFloor returns true than it changes the frame IsOnFloor is false , then true , then false and so on. If i force it to stay on frame 0 for example it works correctly. Hope my description is clear enough

Ashley2011-08-02 13:57:17
B
58
S
13
G
10
Posts: 632
Reputation: 12,505

Post » Mon Jul 25, 2011 4:39 am

Are you sure it is a bug ?
Seems pretty obvious to me though, since you are changing a 52 px high image to a 49 px image. There is a 2 px difference, putting the sprite (hotspot is still the center) 1 px above the ground, so not in collision with it.

Do having some "Y tweaker" on a "animation frame changed" event resolve this ?
New to Construct ? Where to start

Image Image
Image Image

Please attach a capx to any help request or bug report !
Moderator
B
247
S
85
G
40
Posts: 6,999
Reputation: 57,793

Post » Mon Jul 25, 2011 1:26 pm

I don't think we can or should fix this.

Even in Classic, using animated sprites as your platform object is notorious for causing unintended problems. The usual thing to do is have an invisible solid square representing the player, which does not animate, and you position your animating player on top. Otherwise, you end up with lots of complicated situations like: you're standing next to a wall, the animation frame changes, and now part of your character is embedded within the wall. This kicks off Construct's 'push out of solid' code, which usually works but sometimes doesn't do quite what you wanted (your player may teleport a short distance or appear to "glitch").

So even if we fixed this, you're still going to have problems if you use the animated sprite with a platform movement. For the record, 'Is on floor' works by pushing the player down 1 pixel and seeing if it overlaps a solid there, so if your player's bottom edge raises it won't count as on the floor any more. (If you could change hot spots, you could also fix it by having the hot spot at the bottom-middle edge.)

So I think this should be resolved "won't fix".
Scirra Founder
B
359
S
214
G
72
Posts: 22,952
Reputation: 178,580

Post » Mon Jul 25, 2011 6:08 pm

Ok, fair enough. For some reason i forgot the collisor technique, my bad. Thanks
B
58
S
13
G
10
Posts: 632
Reputation: 12,505


Return to Closed bugs

Who is online

Users browsing this forum: No registered users and 1 guest