Hi, I'm working on my program for....stuff yeah. I'm making my class 'Astercore', and I'm currently using this for my collision:
Now, I'm currently looking at a way to use: getObjectsInRange(int radius, java.lang.Class cls)
Since I don't want the detection range to be the image itself, and rather have a radius detection range. However, I'm unsure how to use this method, since I have never used this before and I am unsure how I would use this in my own program. I have had a look at other discussions about this, but I'm still a little unsure, so I'm here just asking about it myself. :P
So what I'm basically saying is, I need some help changing my getOneIntersectingObject to hopefully getObjectsInRange, so I can get rid of the Shot.class in a radius rather than an image square.
If you need any other additional information, I'll try to provide what you ask for. (And slightly nervous while writing this since I don't usually ask for help from others ._.)
private void checkCollision()
{
Actor hit = getOneIntersectingObject(Shot.class);
if (hit != null)
{
if (shotCount > 0)
{
getWorld().removeObject(hit);
shotCount = shotCount - 1;
resistShot.play();
}
if (shotCount <= 0)
{
getWorld().removeObject(hit);
getWorld().removeObject(this);
}
}
}
