Example #1
0
        public void DrawGameScreen(leveldata level, ReturnInput input)
        {
            int squaresize = 1;

            if ((width / level.x_num) > height / level.y_num)
            {
                squaresize = height / level.y_num;
            }
            else
            {
                squaresize = width / level.x_num;
            }

            squaresize   = ConvertInt(squaresize);
            gamescreen_x = ConvertInt(level.x_num * squaresize);
            gamescreen_y = ConvertInt(level.y_num * squaresize);

            level.realsize = new Size(gamescreen_x, gamescreen_y);

            level.realposition = ConvertPosition(new Position((width - gamescreen_x) / 2, (height - gamescreen_y) / 2));

            Size tilesize = new Size(squaresize, squaresize);

            foreach (Tile tile in level.positions)
            {
                tile.real_position = ConvertPosition(new Position((level.realposition.x) + tile.position.x * tilesize.x, (level.realposition.y) + tile.position.y * tilesize.y));
                tile.real_size     = tilesize;

                DrawTile(tile);
            }
        }
Example #2
0
 public void NewLevel()
 {
     // animation done
     this.EndingLevel = false;
     this.level = new leveldata(this, Dificulty.normal);
     this.TileControllEnabled = true;
     this.SelectedTile = this.EmptyTile;
 }
Example #3
0
 public Game_Manager(Platform current_platform, Drawvisitor drawvisitor, iInputhandler inputhandler)
 {
     this.EmptyTile = new Tile(this, new Position(-1, -1), false);
     this.drawvisitor = drawvisitor;
     this.level = new leveldata(this, Dificulty.normal);
     this.inputhandler = inputhandler;
     latestinput = inputhandler.getinput();
     this.SelectedTile = EmptyTile;
     this.selectionbuttons = new SelectionButtons(this);
     this.current_platform = current_platform;
     if (this.current_platform == Platform.windows)
     {
         SelectionButtonsEnabled = false;
     }
     else
     {
         SelectionButtonsEnabled = true;
     }
 }