HaxeFlixel / HaxeFlixel/flixel
Add `FlxG.touches.pressed` and `FlxG.touches.anyPressed`
Nobody has claimed this yet.
- Dominant language
- Haxe
- Stars
- 2.2k
- Forks
- 522
- Avg merge
- 34m
- Merged PRs (30d)
- 1
Description
I was under the impression that all touches in FlxG.touches.list were in a justPressed, pressed and justReleased state, but apparently they exist in a released state before they are removed. This threw me for a loop when debugging some code. Given that we have FlxG.touches.justStarted maybe we should have lists for all other states.
Additionally, I think FlxTouchManager could benefit from boolean flags for whether any touch is in the target state. such as: FlxG.touches.anyJustPressed
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading FlxTouchManager and the existing FlxG.touches.justStarted and FlxG.touches.list behavior. Trace how touch states are tracked and removed, then define the requested pressed and anyPressed accessors consistently with those states. Done means the new lists and boolean flags accurately expose the requested touch states.
Written by the indexing model from the issue text.
Assessment
- Domain
- game-dev
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100