private GameScreen(BufferStrategy strategy, int sw, int sh,int wuWidth, int wuHeight, JPanel panel, String charname)
{
// needed for splitting Images to multpile sprites
GraphicsConfiguration gc = GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice().getDefaultConfiguration();
ChatMessages = new Vector<String>();
zoneChangePoints = new Vector<ZoneChangePoint>();
EatenSigns = new Vector<EatenSign>();
ww=wuWidth;
wh=wuHeight;
clear();
this.sw=sw;
this.sh=sh;
this.myPlayerName = charname;
// INIT IMAGES !!
ImageList = new Images(panel);
// Walls
this.wall_sprite = new Sprite(ImageList.getImage("wall0"));
this.sprite_wall = new Sprite[16];
for (int i=0;i<=15;i++)
{
this.sprite_wall[i]= new Sprite(ImageList.getImage("wall"+i));
}
// Dots, Sueprdots, Powerpills
this.sprite_dot = new Sprite(ImageList.getImage("dot"));
this.sprite_superdot = new Sprite(ImageList.getImage("superdot"));
this.sprite_powerpill = new Sprite(ImageList.getImage("powerpill"));
// Fruits
this.sprite_fruit = new Vector<Sprite>();
Sprite tempSprite = new Sprite(ImageList.getImage("fruits"));
for (int i=0;i<=13;i++)
{
Image image = gc.createCompatibleImage(PIXEL_SCALE,PIXEL_SCALE,Transparency.BITMASK);
tempSprite.draw(image.getGraphics(),0,0,i*PIXEL_SCALE,0);
sprite_fruit.add(new Sprite(image));
}
// KILLed Sprite
this.sprite_EatenSprite = new Vector<Sprite>();
tempSprite = new Sprite(ImageList.getImage("eatensign"));
for (int i=0;i<=2;i++)
{
Image image = gc.createCompatibleImage(PIXEL_SCALE,PIXEL_SCALE,Transparency.BITMASK);
tempSprite.draw(image.getGraphics(),0,0,i*PIXEL_SCALE,0);
sprite_EatenSprite.add(new Sprite(image));
}
// ZoneChangePoints
this.sprite_zonechange = new Sprite(ImageList.getImage("zonechange"));
// add Ghost sprites
this.sprite_GhostR = new Vector<Sprite>();
tempSprite = new Sprite(ImageList.getImage("GhostR"));
for (int i=0;i<=9;i++)
{
Image image = gc.createCompatibleImage(PIXEL_SCALE,PIXEL_SCALE,Transparency.BITMASK);
tempSprite.draw(image.getGraphics(),0,0,i*PIXEL_SCALE,0);
sprite_GhostR.add(new Sprite(image));
}
this.sprite_GhostG = new Vector<Sprite>();
tempSprite = new Sprite(ImageList.getImage("GhostG"));
for (int i=0;i<=9;i++)
{
Image image = gc.createCompatibleImage(PIXEL_SCALE,PIXEL_SCALE,Transparency.BITMASK);
tempSprite.draw(image.getGraphics(),0,0,i*PIXEL_SCALE,0);
sprite_GhostG.add(new Sprite(image));
}
// add Player Images
// for my Player
this.sprite_mplayer = new Vector<Sprite>();
tempSprite = new Sprite(ImageList.getImage("mplayer"));
for (int i=0;i<=13;i++)
{
Image image = gc.createCompatibleImage(PIXEL_SCALE,PIXEL_SCALE,Transparency.BITMASK);
tempSprite.draw(image.getGraphics(),0,0,i*PIXEL_SCALE,0);
sprite_mplayer.add(new Sprite(image));
}
// and other Players
this.sprite_oplayer = new Vector<Sprite>();
tempSprite = new Sprite(ImageList.getImage("oplayer"));
for (int i=0;i<=13;i++)
{
Image image = gc.createCompatibleImage(PIXEL_SCALE,PIXEL_SCALE,Transparency.BITMASK);
tempSprite.draw(image.getGraphics(),0,0,i*PIXEL_SCALE,0);
sprite_oplayer.add(new Sprite(image));
}
// and other Players
this.sprite_pplayer = new Vector<Sprite>();
tempSprite = new Sprite(ImageList.getImage("pplayer"));
for (int i=0;i<=13;i++)
{
Image image = gc.createCompatibleImage(PIXEL_SCALE,PIXEL_SCALE,Transparency.BITMASK);
tempSprite.draw(image.getGraphics(),0,0,i*PIXEL_SCALE,0);
sprite_pplayer.add(new Sprite(image));
}
// ALL IMAGES ADDED