I would search for the player first. Once you find her, you might just have to subtract 1 from her height. Of course, that assumes that she's a well-grounded player.
I don't really understand either of your code snippets. "a" represents the array I guess. What's tile_size?
Joined: Mar 21, 2013
i just change some of the stuff.
tile_size = 32;
this code justt making a rectange where there is ground and storeing in arraylist
this code loop though arraylist and see is player is touching the rectanges in arraylist.
this code will find the ground no matter where is the player. bc i getting player y postion.
but the problem is that 1st player will be touch the ground(1) so it will get player y postion + height and thats the ground postion. if he moves right than there is another ground block on top. so he touchs that and moves the ground up. and so on...
now notic if player moves left than he is no ground under him and he is not touching any ground blocks. so he should fall down untill he touch another block. but this doesnt happed. he just stays there and no ground block under him.