-
Notifications
You must be signed in to change notification settings - Fork 457
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FlxTilemap one-way collision bug #1546
Comments
If you add another column, this stops happening. |
Depends on what the column looks like... The original csv from the thread looked like this: 1,1,1,1,1,1,1,1,1,1
1,0,4,0,0,0,0,4,0,1
1,1,1,0,0,0,0,1,1,1
0,0,0,0,0,0,0,0,0,0
0,0,0,0,0,0,0,0,0,0
0,0,0,0,0,0,0,0,0,0
1,1,1,0,0,0,0,1,1,1
1,0,4,0,0,0,0,4,0,1
1,1,1,0,0,0,0,1,1,1
1,0,4,0,0,0,0,4,0,1
1,1,1,0,0,0,0,1,1,1
2,0,0,0,0,0,0,0,0,3
2,0,0,0,0,0,0,0,0,3
2,0,0,0,0,0,0,0,0,3
1,1,1,0,0,0,0,1,1,1
1,0,4,0,0,0,0,4,0,1
1,1,1,1,1,1,1,1,1,1 I just reduced it as much as possible. |
I assume this code compiles on Dev, it doesn't on 3.3.8. Tim, how did you add the other column? I'm using a CSV in a string "1,1\n0,0" and I'm still getting the collision. |
|
In AS3 Flixel, in FlxTilemap.overlapsWithCallback selectionX and selectionY are respectively set to 0 if they're less than 0. I added this in Haxe and the collision was correct. |
It looks like the issue with with |
It also seems to solve the problem in the original case :-) when debugging before, it seems that the collision function was looking in a negative column (-2), maybe it was accessing an invalid tile. |
Cheers, thanks for all the help. |
Fix a one-way collision bug in FlxTilemap, closes #1546
Originally reported here.
Code to reproduce:
Moving from left to right works fine - right to left doesn't though, the sprite gets stuck at the edeg of the tilemap. Doesn't seem to be a target-specific issue.
Supposedly, this doesn't happen in AS3 Flixel (haven't tested myself), so comparing some of the collision code might be helpful.
Originally reported here.
Happens in both dev and 3.3.8, so not a recent regression.
The text was updated successfully, but these errors were encountered: