예제 #1
0
 /// <summary>
 /// Instantiates an instance of the DrawFromMultiImageArray class from an imaage array and a block.
 /// </summary>
 /// <param name="images">The Image array to fill.</param>
 /// <param name="block">The block to use as a reference for drawing images</param>
 public DrawFromMultiImageArray(Bitmap[] images, Block block)
 {
     this.block             = block;
     this.images            = images;
     this.animationMaxIndex = this.images.Count() - 2;
     this.image             = images[animationCounterIndex];
     BlockFlashing          = new TimedEffect(500, TimeUnit.Milliseconds);
     this.flipAnimation     = false;
 } // end constructor method DrawFromMultiImageArray
예제 #2
0
파일: Game.cs 프로젝트: dahopkin/Tetris
 /// <summary>
 /// Instantiates an instance of the Game class from a Location point, a random, and a BlockType enum.
 /// </summary>
 /// <param name="location">The location of the gaming grid.</param>
 /// <param name="random">A random to use for the game's functions that use random.</param>
 /// <param name="BlockType">The type of blocks that will be generated in the game.</param>
 public Game(Point location, Random random, BlockType BlockType)
 {
     this.Location = location;
     this.random   = random;
     this.gridPile = new Pile();
     gridSize      = new Size(
         (Block.BlockLength * gridWidth)
         , (Block.BlockLength * gridHeight));
     Boundaries           = new Rectangle(Location, gridSize);
     shapeGenerationPoint = new Point((Boundaries.Left) + BlocksOver(4), Boundaries.Top - BlocksOver(1));
     shapeFactory         = new ShapeFactory();
     dropShapes           = new List <Shape>();
     linesToClear         = new List <List <Block> >();
     GenerateBackgroundBlockGrid();
     lockDelay      = new TimedEffect(500, TimeUnit.Milliseconds);
     this.BlockType = BlockType;
 } // end constructor method Game