Advertisement

Finding Tiles

Started by November 14, 2000 01:35 PM
1 comment, last by lazer_hassing 24 years, 2 months ago
I have a tilemap(15x15 tiles) made of 16x16pixel tiles and a player which is circle-shaped (8pixel radius). The player has 'free-movement' (can touch more than one tile at a time). How can I find the tiles the player is over? (btw, I dont want to use a bounding-box) Lasse Hassing -------------------------------------------------------------- Erh? Edited by - lazer_hassing on 11/14/00 1:36:38 PM
Get the center of the player. Do a bounding box to find the tiles they might be on. Do a distance calc for each tile corner. If the dist is >= 4 he is on that tile.
Advertisement
quote: Original post by Anonymous Poster

Get the center of the player. Do a bounding box to find the tiles they might be on. Do a distance calc for each tile corner. If the dist is >= 4 he is on that tile.


So I guess I do want to use a bounding box anyway,
Thanks!!!

Lasse Hassing
--------------------------------------------------------------
Erh?

Edited by - lazer_hassing on November 15, 2000 4:18:49 PM

This topic is closed to new replies.

Advertisement