flixel icon indicating copy to clipboard operation
flixel copied to clipboard

weird pixelPerfectOverlap() behaviour when working in cpp target

Open NulllStack opened this issue 5 years ago • 3 comments

  • 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:

GIF 2020-1-15 10-27-06

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.

NulllStack avatar Jan 15 '20 02:01 NulllStack

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

Geokureli avatar Feb 26 '21 19:02 Geokureli

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.

MSGhero avatar Feb 27 '21 02:02 MSGhero

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

Geokureli avatar Feb 27 '21 05:02 Geokureli