Collision problems with FlxTilemap, porting from ActionScript

43 views
Skip to first unread message

Ciro Duran

unread,
Jun 27, 2015, 7:35:47 AM6/27/15
to haxef...@googlegroups.com
Hi Everyone!,

I'm porting some old code I did in 2011. In this game, I have a train-like vehicle that goes between stations, and the player is able to get into it. The level itself uses a TlxTilemap, whereas the train uses a movable FlxTilemap for collision detection. You can see the ActionScript version of the game here http://www.ciroduran.com/files/2011/metro/Metro.html.

However, after porting the game to HaxeFlixel, I noticed that the FlxTilemap object produces a collision to the LEFT of the player sprite, which in my game it translates to the player unable to exit the train to the left, when the train is on the right side of the station. The player is able to enter the train, but exiting is impossible, even by setting the border tiles to transparent.

This behaviour was not present in the original Flixel, and it has frustrated me the entire week. There is a similar discussion with Pacman in the forum, but the solution proposed (padding one tile to the left) is not acceptable to me, as it will not solve my problem. Compare the ActionScript version to the Haxe version here http://ciroduran.com/files/2015/metro/Metro.html (get into the train, go to the other station, exit the train, wait until it comes out again from the right, and enter the train, you will not be able to exit to the left).

I would appreciate if someone could point me to the way I could disable this collision in the tile map, as I have not seen the "prevent player from exiting to the left" option in FlxTilemap :-)

Cheers,

Ciro.

Gama11

unread,
Jun 28, 2015, 4:11:40 AM6/28/15
to haxef...@googlegroups.com, ciro....@gmail.com
For things like this, it's always helpful to have a small code snippet that reproduces the issue.

Ciro Durán

unread,
Jun 28, 2015, 4:13:53 AM6/28/15
to haxef...@googlegroups.com
Yeh, I'll try to have this to show the problem.

Enviado desde mi Commodore 64

Ciro Duran

unread,
Jun 29, 2015, 3:20:38 AM6/29/15
to haxef...@googlegroups.com
I got a minimal code showing the bug (HaxeFlixel 3.3.8). here - https://dl.dropboxusercontent.com/u/582383/Sandbox.zip - just use the arrow keys to move the pink sprite.

Now that I see it it looks more like the collisions with the tilemap are not completely clean, I'll look into it later and see what's happening. Once again, I appreciate your help :)

Cheers,

Ciro.

Gama11

unread,
Jun 29, 2015, 10:12:24 AM6/29/15
to haxef...@googlegroups.com, ciro....@gmail.com
Definitely seem like a bug, thanks for reporting. I opened an issue here.

Ciro Durán

unread,
Jun 29, 2015, 12:57:59 PM6/29/15
to haxef...@googlegroups.com
Cheers, I'll be investigating too.


Enviado desde mi Commodore 64
--
HaxeFlixel Development Community
See our github https://github.com/haxeflixel/ and our documentation http://haxeflixel.com/documentation/
---
You received this message because you are subscribed to a topic in the Google Groups "HaxeFlixel" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/haxeflixel/3Lxwjz9Q5Ro/unsubscribe.
To unsubscribe from this group and all its topics, send an email to haxeflixel+...@googlegroups.com.
Visit this group at http://groups.google.com/group/haxeflixel.
To view this discussion on the web visit https://groups.google.com/d/msgid/haxeflixel/a8f19e80-eb88-42e4-86ee-fd6ced4a5ee3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Gama11

unread,
Jun 29, 2015, 3:43:59 PM6/29/15
to haxef...@googlegroups.com, ciro....@gmail.com
A fix for this has just been merged into dev.
To unsubscribe from this group and all its topics, send an email to haxeflixel+unsubscribe@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages