
Originally Posted by
DivinityGang
Can you elaborate?
Code:
// The tiles & method would be in boss class
/*We store the values of the designated tiles you want to launch the projectiles on here.
They do not have to be hard coded like I did. You could create a method that loads tiles based on players present etc.*/
private Tile[] tiles = new Tile[] { new Tile(3333, 3333, 0), new Tile(3330, 3333, 0), new Tile(3332, 3333, 0) };
/*This is your method in boss class that launches the projectiles. It uses the values in the tiles array to determine
the location for the projectiles. You will have to input the values though. I just used 0's and 1's for example.*/
public void launchProjectiles() {
for(Tile tile : tiles) {
createProjectile(tile.getX(), tile.getY(), 0, 0, 1, 1, 1, 1, 1, 1, 1);
}
}
// We have your createProjectile method here which is most likely in another class. I just have this here for visual.
private void createProjectile(int x, int y, int offX, int offY, int angle, int speed, int gfxMoving,
int startHeight, int endHeight, int lockon, int time) {
// synchronized(c) {
if (c.getOutStream() != null && c != null) {
c.getOutStream().createFrame(85);
c.getOutStream().writeByteC((y - (c.getMapRegionY() * 8)) - 2);
c.getOutStream().writeByteC((x - (c.getMapRegionX() * 8)) - 3);
c.getOutStream().createFrame(117);
c.getOutStream().writeByte(angle);
c.getOutStream().writeByte(offY);
c.getOutStream().writeByte(offX);
c.getOutStream().writeWord(lockon);
c.getOutStream().writeWord(gfxMoving);
c.getOutStream().writeByte(startHeight);
c.getOutStream().writeByte(endHeight);
c.getOutStream().writeWord(time);
c.getOutStream().writeWord(speed);
c.getOutStream().writeByte(16);
c.getOutStream().writeByte(64);
c.flushOutStream();
}
}
}
For example