Exemple #1
0
 public static void initLevel()
 {
     levelItems = new LevelItem[Level.MAX_LEVEL];
     for (int i = 0; i < Level.MAX_LEVEL; i++)
     {
         levelItems[i] = new LevelItem(i+1,Level.MAXIMUM_SPEED_VALUE - i * Level.SPEED_STEP, Level.MINIMUM_POINT_VALUE + i * Level.POINT_STEP);
     }
 }
Exemple #2
0
 public static LevelItem jumpLevel( LevelItem actLevel )
 {
     LevelItem newLevel = actLevel;
     if (actLevel.Level < Level.MAX_LEVEL)
     {
         newLevel = levelItems[actLevel.Level];
     }
     return newLevel;
 }
Exemple #3
0
        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;
        }
Exemple #4
0
 void tetris_changeLevel(LevelItem param)
 {
     lLevel.Text = param.Level.ToString();
     tbSpeed.Text = param.Speed.ToString();
     tbPoint.Text = param.Point.ToString();
     timerFall.Interval = param.Speed;
 }
 public HighScoreItem(string name, int points, LevelItem startLevel)
 {
     this.name = name;
     this.points = points;
     this.startLevel = startLevel;
 }
Exemple #6
0
 private void addPoints()
 {
     this.points += this.actLevelItem.Point;
     this.actLevelRowPoints++;
     if (this.actLevelRowPoints >= Tetris.MAX_LEVEL_ROW_POINT)
     {
         this.actLevelItem = Level.jumpLevel(this.actLevelItem);
         this.actLevelRowPoints = 0;
         if (this.changeLevel != null)
         {
             this.changeLevel(this.actLevelItem);
         }
     }
 }