public void frameTest() {
    Image TestImage;
    Image TestImage2;
    TestImage = loadImage("images/Tank.jpg");
    TestImage2 = loadImage("images/Tank.jpg");
    Animation AnimTest = new Animation();
    AnimTest.addFrame(TestImage, 200);

    Animation AnimTest2 = new Animation();
    AnimTest2.addFrame(TestImage2, 500);
    System.out.println(AnimTest.getImage());
    System.out.println(AnimTest2.getImage());
  }
Esempio n. 2
0
  public void loadImages() {
    // load images
    bgImage = loadImage("images/background.jpg");
    Image player1 = loadImage("images/player1.png");
    Image player2 = loadImage("images/player2.png");
    Image player3 = loadImage("images/player3.png");

    // create animation
    anim = new Animation();
    anim.addFrame(player1, 250);
    anim.addFrame(player2, 150);
    anim.addFrame(player1, 150);
    anim.addFrame(player2, 150);
    anim.addFrame(player3, 200);
    anim.addFrame(player2, 150);
  }