flixel
flixel copied to clipboard
weird pixelPerfectOverlap() behaviour when working in cpp target
- Haxe version: 3.4.7
- Flixel version: 4.6.3
- OpenFL version: 8.9.5
- Lime version: 7.6.3
- Affected targets: windows
I compiled the "Flappybalt" DEMO but the collison's behavior is pretty weird, at the beginning of the game, after the bird collide with the right side paddle, you let the bird falls, then the bird will falls out off the screen, this is not normal, the bird should be killed, which because there's the spike on the bottom.
Then i modify the source code,found the problem probably comes from pixelPerfectOverlap()
Here's an example:

Code snippet reproducing the issue:
override public function update(elapsed:Float):Void
{
if (FlxG.pixelPerfectOverlap(_player, _spikeBottom) || FlxG.pixelPerfectOverlap(_player, _spikeTop)
|| FlxG.pixelPerfectOverlap(_player, _paddleLeft) || FlxG.pixelPerfectOverlap(_player, _paddleRight))
{
_player.kill();
}
// ... other part of code
This issue raise on cpp target, the flash target I have tried it works fine.
I'm also seeing this behavior on html5 builds (chrome) from my Windows machine, but not when I target Mac or when I target html5 on my Mac (also chrome). Oddly, it works on the demos page on chrome for both of my machines
That makes it sound like it's a recently broken thing then? If the demos were compiled with an older stack. The Mac vs Windows thing is weird, I would have expected them to be the same. Although, OP's haxelib versions aren't super new either.
or possibly demos were built from linux, which doesn't have the bug? I don't know if merging Pull request triggers a rebuild of all games, but I changed FlxGamepadTest in June and this bug was reported in January