public Tetris(int mapsize_x, int mapsize_y, int picture_width, int picture_height, LevelItem startLevelItem) { this.MAPSIZE_X = mapsize_x; this.MAPSIZE_Y = mapsize_y; this.LEGOSIZE_WIDTH = (float)(picture_width / mapsize_x); this.LEGOSIZE_HEIGHT = (float)(picture_height / mapsize_y); map = new TetrisLego[this.MAPSIZE_X][]; for (int i = 0; i < this.MAPSIZE_X; i++) { map[i] = new TetrisLego[this.MAPSIZE_Y]; } initMap(); this.isDraw = true; this.points = 0; this.startLevelItem = startLevelItem; this.actLevelItem = startLevelItem; }
public void initMap() { for (int i = 0; i < this.MAPSIZE_X; i++){ for (int j = 0; j < this.MAPSIZE_Y; j++){ map[i][j] = new TetrisLego( this.LEGOSIZE_WIDTH, this.LEGOSIZE_HEIGHT ); } } }