HaxeFlixel / HaxeFlixel/flixel

Add `FlxG.touches.pressed` and `FlxG.touches.anyPressed`

Open
#2,211 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Easy Change
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

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

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.