Dark Mode

Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Collision regression#3498

Draft
Geokureli wants to merge 2 commits intoHaxeFlixel:devfrom
Geokureli:collision-regression
Draft

Collision regression#3498
Geokureli wants to merge 2 commits intoHaxeFlixel:devfrom
Geokureli:collision-regression

Conversation

Copy link
Member

Geokureli commented Oct 1, 2025 *
edited
Loading

Reverts #3418, removing the ability to detect overlaps where both axes start overlapping on the same frame. This change broke standing on moving platforms.

Fixes bug introduced in #3158 where jumping didn't work depending on order of super.update() and collide calls.
The reproducing code is a copy of the Jumping snippet but with the input detection before the collide call)

package states;

import flixel.FlxG;
import flixel.FlxSprite;
import flixel.ui.FlxVirtualPad;

class JumpTestState extends flixel.FlxState
{
var sprite:FlxSprite;
var box:FlxSprite;
var pad:FlxVirtualPad;

override function create()
{
super.create();

sprite = new FlxSprite();
sprite.makeGraphic(24, 24);
sprite.x = FlxG.width / 2 - sprite.width / 2;
sprite.acceleration.y = 900;
sprite.maxVelocity.y = 300;
add(sprite);

box = new FlxSprite();
box.makeGraphic(40, 40);
box.x = FlxG.width / 2 - box.width / 2;
box.y = FlxG.height * 0.75 - box.height / 2;
box.immovable = true;
add(box);

pad = new FlxVirtualPad(FlxDPadMode.NONE, FlxActionMode.A);
add(pad);
}

override function update(elapsed:Float)
{
// call super.update first, as it sets touching flags to NONE
super.update(elapsed);

// jump if touching the box, and jump is pressed
if (sprite.wasTouching.down && pad.getButton(A).justPressed)
{
sprite.velocity.y = -300;
}

// If sprite is resting on box it will set its touching to DOWN
FlxG.collide(box, sprite);
}
}

Geokureli added 2 commits October 1, 2025 14:33
Geokureli added this to the 6.1.1 milestone Oct 2, 2025
Geokureli marked this pull request as draft October 2, 2025 18:56
Copy link
Member Author

Geokureli commented Oct 2, 2025

Turns out 3158 did not introduce a bug, the above test has always been broken. Gonna shelf this open a new PR to revert 3418

Geokureli removed this from the 6.1.1 milestone Oct 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

1 participant