• Advertisement

Archived

This topic is now archived and is closed to further replies.

falling down

This topic is 5685 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

how would i make the player fall if there''s no ground but not fall when theres ground. my game is tile based. like gta.

Share this post


Link to post
Share on other sites
Advertisement
do you have tiles for ground?

if so just test the tile under the player

if(TileMap[player.x][player.y] != FloorTile)
player.y--;

I'm not sure exactly what you meant.. try being more specific or showing some code.



[edited by - cozman on July 1, 2002 2:55:19 AM]

Share this post


Link to post
Share on other sites
i was thinking of doing that but i was wondering how i would get what square the player is in.

Share this post


Link to post
Share on other sites
try player.xtile = player.x/TILE_SIZE; (if your tiles are drawn on an offset you have to use that)

Share this post


Link to post
Share on other sites
all my walls and ground are drawn from three arrays of position''s x,y,z. also how do you do bounding box collision detection. because that would help me to do it. i could check the level below for collisions then if i collide with a box i want let the player fall down.

Share this post


Link to post
Share on other sites

  • Advertisement