Bump
|
how would I make it a 4x4 , 6x6, 8x8, etc area object removal instead of removing objects 1 by 1?
so I came up with this
using a Boolean:
if(c.isinhouse)) {
c.getPA().removeObject
or something like that, but it didn't work. any other way
Bump
Oh really, because everyone one i search it tells me the things i already know which is removing it one by one
Bump.
Bump, I need this aswell. BUMP BUMP BUMP
if(c.isinhouse)) {
c.getPA().removeObject
wut?
Just make an array,
private int[] removingArea = {
{x, y, z}, {x, y, z}
};
if (c.isInHouse) {
for(int i = 0; i < removingArea.length; i++) {
c.getPA().removeObject(removingArea[0], removingArea[1], removingArea[2]); //or however the method is
}
}
EDIT:
I see what you mean now, I wrote this up. (I haven't tested, i'm not very confident that it will work perfectly.)
Code:public void clearOutRoom(Client c, int amountX, int amountY) { int playerX = c.absX; int playerY = c.absY; int x1, y1, x2, y2; for (x1 = playerX; x1 < (amountX * 0.5) + playerX; x1++) { for (y2 = playerY; y2 < (amountY * 0.5) + playerY; y1++) { for (x2 = playerX; x2 > (amountX * 0.5) + playerX; x2++) { for (y2 = playerY; y2 > (amountY * 0.5) + playerY; y2++) { c.getPA().removeObject(x1, y1, c.height); c.getPA().removeObject(x2, y2, c.height); } } } } } if (c.isInHouse) { clearOutRoom(6, 6); }
in this case,
woul clear out 3 squares in each direction. (Making a 6x6 square of cleared object around the player).Code:clearOutRoom(6, 6);
« Previous Thread | Next Thread » |
Thread Information |
Users Browsing this ThreadThere are currently 1 users browsing this thread. (0 members and 1 guests) |