java - Slick2D: getTileProperty returns true when it shouldn't -
I am trying to find some collisions for a test game which I am doing. I have used tilepad for management and have determined to block the property on one of the tiles = true. This tile has been dragged back to 0.
Then I check whether the tile is present in the direction player is moving forward using the following code
if (input.isKeyDown (input. KEY_DOWN)) { sprite = down; Sprite.update (delta); Int tileID = map.map.getTileId ((int) x / map.map.getTileWidth (), (int) y / map.map.getTileHeight () + 1, 0); String value = map.map.getTileProperty (Tile ID, "Blocked", "Wrong"); If (value.equals ("true")) {y + = delta * 0.1f; System.out.println ("tile id:" + (int) (x / map.map.getTileWidth ()) + "," + (int) (y / map.map.getTileHeight () + 1) + "try Do the bottom tile value for the player to run below: "+ value"; }} This is repeated for each direction.
The problem I'm running is picking up the blocked property for the wrong tiles. You can understand better. Yellow Tiles are collision / blocking tiles.
I think you have this problem because you update the graphics if Out of the statement Below if : Phantom = try to move the person inside down; Sprite.update (delta); Although I think one of them has kept the face of the phantom and therefore should not be inside.
Comments
Post a Comment