SFML community forums
Help => General => Topic started by: Loopback on April 25, 2014, 11:32:39 am
-
Hi there! I'd like to know if there's a way to resize bounding boxes. I'm coding a game in which I want my pj's enemies to detect him in a wide area and I'd like to know how can do that.
Thanks in advance!
-
The Wiki subforum is not for help questions.
Bounding box of what exactly?
The bounds you get from a sprite represent the visual aspect. A good code design separates the visual part from the logical part. So in essence just use your own sf::Rect<T> object and set its size as large as you want. ;)
-
I think he meant the "detection bounding box".
Just use a radius and check if an enemy is near the player, no need of resizing anything.
Unless you want a rectangular detection area, then you can use what was said above.
-
I think he meant the "detection bounding box".
Just use a radius and check if an enemy is near the player, no need of resizing anything.
Unless you want a rectangular detection area, then you can use what was said above.
A radius?? what you mean?
The Wiki subforum is not for help questions.
Bounding box of what exactly?
The bounds you get from a sprite represent the visual aspect. A good code design separates the visual part from the logical part. So in essence just use your own sf::Rect<T> object and set its size as large as you want. ;)
I'm really sorry T_T I will delete the topic as soon as possible!
-
I'm coding a game in which I want my pj's enemies to detect him in a wide area and I'd like to know how can do that.
You might want to use a line of sight algorithm.
I'm really sorry T_T I will delete the topic as soon as possible!
You can't, just use the correct forum (help section) next time. ;)