HaxeFlixel / HaxeFlixel/flixel

CollisionFrontEnd

Open
#3,430 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Haxe
Stars
2.2k
Forks
522
Avg merge
34m
Merged PRs (30d)
1

Description

PR, here: https://github.com/HaxeFlixel/flixel/pull/3431

Spinoff from https://github.com/HaxeFlixel/flixel/pull/3418

FlxObject.separate is weirdly laid out and could use a redo.

Operations like computeOverlapX should just compute the overlap, and not set touching flags. We can refactor this system completely and avoid breaking backwards compatibility if we move all of this to FlxG.collision.

I think FlxG.collision.separate should:

  1. Check whether the swept hulls overlap (once, not per axis)
  2. Compute the overlap of each axis
  3. Separate on the smaller axis before the other, setting touching flags when separating, not when computing overlap

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Review PR 3431 and the current FlxObject.separate implementation linked in the issue, then inspect the proposed FlxG.collision.separate entry point and computeOverlapX behavior. Done means the collision flow checks swept-hull overlap once, computes axis overlaps without setting touching flags, and separates on the smaller axis first while setting flags during separation.

Written by the indexing model from the issue text.

Assessment

Domain
game-dev
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.