예제 #1
0
  public void set_the_Enemy_Shots_image() {

    if (type == 0) {
      try {
        weapon = loader.loadImage("images/Ship_Shop/Enemy_Shot_1.png");
      } catch (IOException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
      }

    } else if (type == 1) {
      try {
        weapon = loader.loadImage("images/Ship_Shop/Enemy_Shot_2.png");
      } catch (IOException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
      }

    } else if (type == 2) {
      try {
        weapon = loader.loadImage("images/Ship_Shop/Enemy_Shot_3.png");
      } catch (IOException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
      }
    }
  }
예제 #2
0
  public void set_up_ship() {
    BufferedImageLoader loader = new BufferedImageLoader();
    // Level 1 type Enemy Ship
    if (type == 0) {
      try {
        enemy_ship = loader.loadImage("images/Ship_Shop/Enemy_Ships_1.png");
      } catch (IOException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
      }
      current_max_speed = 25;
      current_health = 150;
      current_damage = 100;
    } else if (type == 1) {
      try {
        enemy_ship = loader.loadImage("images/Ship_Shop/Enemy_Ships_2.png");
      } catch (IOException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
      }

      current_max_speed = 45;
      current_health = 200;
      current_damage = 150;

    }
    // Level 3 type of Enemy Ship
    else {
      try {
        enemy_ship = loader.loadImage("images/Ship_Shop/Enemy_Ships_3.png");
      } catch (IOException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
      }

      current_max_speed = 65;
      current_health = 250;
      current_damage = 200;
    }
  }
예제 #3
0
  public void init() {
    requestFocus();
    BufferedImageLoader loader = new BufferedImageLoader();
    try {

      spriteSheet = loader.loadImage("/sprite_sheet.png");
      background = loader.loadImage("/star_field_-_3.jpg");
    } catch (IOException e) {
      e.printStackTrace();
    }

    tex = new Textures(this); // before player and controller ..grab image

    p = new Player(200, 200, tex);
    // origin all c = new Controller(this,tex);
    c = new Controller(tex);

    ea = c.getEntityA();
    eb = c.getEntityB();

    this.addKeyListener(new KeyInput(this));

    c.createEnemy(enemy_count);
  }