Anpassungen an Bildern etc.

This commit is contained in:
andreas
2015-01-13 14:58:26 +01:00
parent 6435ef52a7
commit 7d196790bf
34 changed files with 92 additions and 33 deletions
+37 -30
View File
@@ -20,43 +20,40 @@ public class ImageLoader {
public BufferedImage getBufferedImage(char key) {
String imageFileName;
switch (key) {
// Wall images
case Config.wayChar:
imageFileName="de/heatup/resources/images/25x25_black.png";
break;
case Config.wallChar:
imageFileName="de/heatup/resources/images/25x25_wall_orange_2.png";
imageFileName="de/heatup/resources/images/grid_1.png";
break;
// Opponent images w - z with animation.
case 'w':
imageFileName="de/heatup/resources/images/opponent_f1.png";
break;
case 'x':
imageFileName="de/heatup/resources/images/opponent_f2.png";
break;
case 'y':
imageFileName="de/heatup/resources/images/opponent_f3.png";
break;
case 'z':
imageFileName="de/heatup/resources/images/opponent_f4.png";
break;
// Image for power up
case 'b':
imageFileName="de/heatup/resources/images/25x25_powerup.png";
break;
case 'u':
imageFileName="de/heatup/resources/images/little_green_guy_verysmall.png";
break;
case 'd':
imageFileName="de/heatup/resources/images/little_green_guy_verysmall.png";
break;
case 'l':
imageFileName="de/heatup/resources/images/little_green_guy_verysmall.png";
break;
case 'r':
imageFileName="de/heatup/resources/images/little_green_guy_verysmall.png";
break;
// Player
case 'p':
imageFileName="de/heatup/resources/images/little_blue_guy_verysmall.png";
//imageFileName="de/heatup/resources/images/red_bug_25x25.png";
break;
case 'q':
//imageFileName="de/heatup/resources/images/little_blue_guy_verysmall.png";
imageFileName="de/heatup/resources/images/little_bug_25x25_1.png";
break;
case 's':
//imageFileName="de/heatup/resources/images/little_blue_guy_verysmall.png";
imageFileName="de/heatup/resources/images/little_bug_25x25_2.png";
break;
case 't':
//imageFileName="de/heatup/resources/images/little_blue_guy_verysmall.png";
imageFileName="de/heatup/resources/images/little_bug_25x25_3.png";
imageFileName="de/heatup/resources/images/little_green_guy_verysmall.png";
break;
// Default images if no other is found
default:
imageFileName="de/heatup/resources/images/dummy_image.png";
break;
@@ -65,17 +62,27 @@ public class ImageLoader {
Random rand = new Random();
switch (rand.nextInt(2)) {
case 0:
imageFileName="de/heatup/resources/images/hardware/rectangular_chip.jpg";
//imageFileName="de/heatup/resources/images/hardware/rectangular_chip.jpg";
imageFileName="de/heatup/resources/images/hardware/chip_rc_1.png";
break;
case 1:
imageFileName="de/heatup/resources/images/hardware/square_chip.jpg";
//imageFileName="de/heatup/resources/images/hardware/square_chip.jpg";
imageFileName="de/heatup/resources/images/hardware/chip_sq_1.png";
break;
case 2:
//imageFileName="de/heatup/resources/images/hardware/square_chip.jpg";
imageFileName="de/heatup/resources/images/hardware/chip_rc_2.png";
break;
case 3:
//imageFileName="de/heatup/resources/images/hardware/square_chip.jpg";
imageFileName="de/heatup/resources/images/hardware/chip_sq_2.png";
break;
default:
break;
}
}
BufferedImage loadedBufferedImage = null;
//System.out.println(imageFileName);
try {
loadedBufferedImage = ImageIO.read(this.getClass().getClassLoader().getResourceAsStream(imageFileName));
+28 -2
View File
@@ -29,7 +29,9 @@ public class Opponent extends Player {
private char charDir;
// Direkten Pfad zum Spieler nutzen
private char newd;
// Variablen zur Animation
private int tickCounter = 0;
private int ticker = 0;
public Opponent() {
CollisionHandler.addMovingObject(this);
@@ -37,13 +39,37 @@ public class Opponent extends Player {
@Override protected void loadBufferedImage() {
try {
super.bf1 = ImageIO.read(this.getClass().getClassLoader().getResourceAsStream("de/heatup/resources/images/little_green_guy_verysmall.png"));
super.bf1 = ImageIO.read(this.getClass().getClassLoader().getResourceAsStream("de/heatup/resources/images/opponent_f1.png"));
} catch (IOException e) {
e.printStackTrace();
}
}
@Override public void tick() {
// Part for Animation
this.tickCounter++;
if ( (this.tickCounter%10) == 0 ) {
this.tickCounter = 0;
if ( ticker == 0 ) {
super.setStaticObjectType('w');
super.loadBufferedImage();
ticker = 1;
} else if ( ticker == 1 ) {
super.setStaticObjectType('x');
super.loadBufferedImage();
ticker = 2;
} else if ( ticker == 2 ) {
super.setStaticObjectType('y');
super.loadBufferedImage();
ticker = 3;
} else if ( ticker == 3 ) {
super.setStaticObjectType('z');
super.loadBufferedImage();
ticker = 0;
}
}
if ( redecide ) {
while ( true ) {
+27 -1
View File
@@ -37,7 +37,14 @@ public class StaticObject extends JComponent {
public StaticObject(char staticObjectType, Point location) {
this(staticObjectType, location, Config.singleTilePixels, Config.singleTilePixels);
}
public char getStaticObjectType() {
return this.staticObjectType;
}
public void setStaticObjectType(char staticObjectType) {
this.staticObjectType = staticObjectType;
}
public void paintComponent(Graphics g) {
this.g2d = (Graphics2D)g;
@@ -47,6 +54,25 @@ public class StaticObject extends JComponent {
loadBufferedImage();
}
this.imgcounter++;
if ( staticObjectType == '0' && this.imgcounter > 0 && this.imgcounter < 5 ) {
System.out.println("hit 0");
staticObjectType = '2';
loadBufferedImage();
}
if ( staticObjectType == '2' && this.imgcounter > 5 && this.imgcounter < 10 ) {
System.out.println("hit 2");
staticObjectType = '0';
loadBufferedImage();
}
if ( staticObjectType == '2' && this.imgcounter > 10 ) {
staticObjectType = '0';
this.imgcounter=0;
}
// this.imgcounter++;
// if ( staticObjectType == 'p' && this.imgcounter > 0 && this.imgcounter < 5 ) {
// System.out.println("hit 1");
Binary file not shown.

Before

Width:  |  Height:  |  Size: 169 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 168 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 166 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 260 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 343 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 406 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 358 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 390 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 240 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 265 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 273 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 272 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 389 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 371 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 852 B