Problem with platform collisions system

Hi, I’ve a strange problem trying to make a platformer collisions system.
I don’t know what’s wrong, all started when I made a prototype using Python, now I’m trying to make the whole game using Java but I’ve a serious problem with the platforms collision system, I exactly translated the code from Python to Java but it doesn’t work correctly here. When the player moves right or left, it detects the collisions with the ground and, I don’t know why, it does an strange movement. If player horizontal velocity is higher than 0, player x coordinate should be tile.x - player.width, and it almost works… except for the problem that the player detects horizontal collisions with the ground and that should not be like that. I don’t know if you know what I mean, I’m trying to explain what’s going on as good as I can.

For example, the player is touching the ground, if you press right key vx > 0 and the player is colliding with a solid block so player.x = tile.x - player.width… It’s the same if you press left key vx < 0.

It’s really really strange because the system I use right now worked perfectly with python…

Here are the classes where I think it’s the problem…

Here’s the code of the “player”
http://pastebin.java-gaming.org/56d116e1d1912
Here’s the code of the function I use to check collisions
http://pastebin.java-gaming.org/6d11e7d19121e

I hope you may help me, thank you very much :slight_smile: