package com.arvin;
import java.awt.image.BufferedImage; import java.util.ArrayList; import java.util.List;
public class BackGround {
private BufferedImage bgImage = null;
private int sort;
private boolean flag;
private List<Obstacle> ObstacleList = new ArrayList<>();
private List<Enemy> enemyList = new ArrayList<>();
private BufferedImage Gan = null;
private BufferedImage Tower = null;
private boolean isReach = false;
private boolean isBase = false;
public BackGround() {
}
public BackGround(int sort,boolean flag) { this.sort = sort; this.flag = flag;
if (flag) { bgImage = StaticValue.BackgroundImage_Two; }else{ bgImage = StaticValue.BackgroundImage_Noe; }
if (sort == 1) { for (int i = 0; i < 27; i++) { ObstacleList.add(new Obstacle(i*30,420,1,this)); } for (int j = 0; j <= 120; j += 30) { for (int i = 0; i < 27; i++) { ObstacleList.add(new Obstacle(i*30,570-j,2,this)); } }
for (int i = 120; i <= 150 ; i += 30) { ObstacleList.add(new Obstacle(i,300,3,this)); } for (int i = 300; i <= 570; i += 30) { if (i == 360 || i == 390 || i == 480 || i==510 || i == 540) { ObstacleList.add(new Obstacle(i,300,3,this)); }else{ ObstacleList.add(new Obstacle(i,300,0,this)); } } for (int i = 420; i <= 450; i+=30) { ObstacleList.add(new Obstacle(i,240,3,this)); }
for (int i = 360; i <=600; i += 25){ if (i == 360){ ObstacleList.add(new Obstacle(620,i,5,this)); ObstacleList.add(new Obstacle(645,i,6,this)); }else{ ObstacleList.add(new Obstacle(620,i,7,this)); ObstacleList.add(new Obstacle(645,i,8,this)); } } enemyList.add(new Enemy(580,385,true,1,this)); enemyList.add(new Enemy(635,420,true,2,328,428,this)); }
if (sort == 2) { for (int i = 0; i < 27; i++){ ObstacleList.add(new Obstacle(i*30,420,1,this)); } for (int j = 0; j <= 120; j+= 30){ for (int i = 0; i < 27; i++){ ObstacleList.add(new Obstacle(i*30,570-j,2,this)); } }
for (int i = 360; i <= 600; i += 25){ if (i == 360) { ObstacleList.add(new Obstacle(60,i,5,this)); ObstacleList.add(new Obstacle(85,i,6,this)); }else{ ObstacleList.add(new Obstacle(60,i,7,this)); ObstacleList.add(new Obstacle(85,i,8,this)); } }
for (int i = 330; i <=600; i+= 25){ if (i == 330) { ObstacleList.add(new Obstacle(620,i,5,this)); ObstacleList.add(new Obstacle(645,i,6,this)); }else{ ObstacleList.add(new Obstacle(620,i,7,this)); ObstacleList.add(new Obstacle(645,i,8,this)); } }
ObstacleList.add(new Obstacle(300,330,0,this));
for (int i = 270; i <= 330; i+=30){ if (i == 270 || i == 330) { ObstacleList.add(new Obstacle(i,360,0,this)); }else{ ObstacleList.add(new Obstacle(i,360,3,this)); } }
for (int i = 240; i <= 360; i += 30){ if (i == 240 || i == 360){ ObstacleList.add(new Obstacle(i,390,0,this)); }else{ ObstacleList.add(new Obstacle(i,390,3,this)); } }
ObstacleList.add(new Obstacle(240,300,0,this));
for (int i = 360; i <= 540; i += 60) { ObstacleList.add(new Obstacle(i,270,3,this)); }
enemyList.add(new Enemy(75,420,true,2,328,418,this)); enemyList.add(new Enemy(635,420,true,2,298,388,this)); enemyList.add(new Enemy(200,385,true,1,this)); enemyList.add(new Enemy(500,385,true,1,this)); }
if (sort == 3) { for (int i = 0; i < 27; i++){ ObstacleList.add(new Obstacle(i*30,420,1,this)); } for (int j = 0; j <= 120; j+= 30){ for (int i = 0; i < 27; i++){ ObstacleList.add(new Obstacle(i*30,570-j,2,this)); } }
int temp = 290; for (int i = 390; i >= 270; i -= 30) { for (int j = temp; j <= 410; j += 30) { ObstacleList.add(new Obstacle(j,i,3,this)); } temp += 30; }
temp = 60; for (int i = 390; i >= 360; i -= 30) { for (int j = temp; j <= 90; j += 30) { ObstacleList.add(new Obstacle(j,i,3,this)); } temp += 30; }
Gan = StaticValue.Gan;
Tower = StaticValue.Tower;
ObstacleList.add(new Obstacle(515,220,4,this));
enemyList.add(new Enemy(150,385,true,1,this)); } }
public BufferedImage getBgImage() { return bgImage; }
public int getSort() { return sort; }
public boolean isFlag() { return flag; }
public List<Obstacle> getObstacleList() { return ObstacleList; }
public BufferedImage getGan() { return Gan; }
public BufferedImage getTower() { return Tower; }
public boolean isReach() { return isReach; }
public void setReach(boolean reach) { isReach = reach; }
public boolean isBase() { return isBase; }
public void setBase(boolean base) { isBase = base; }
public List<Enemy> getEnemyList() { return enemyList; } }
|