Beispiel #1
0
 public GameBlockAnimation(GameBlock block, GamePane pane, int column, int row)
 {
     this.block  = block;
     this.pane   = pane;
     this.column = column;
     this.row    = row;
 }
Beispiel #2
0
 public void Draw(DrawContext ctx, GamePane pane, float alpha)
 {
     Color4 blockColor = color;
     blockColor.A = alpha;
     ctx.BindTexture(texture);
     ctx.SetColor(blockColor);
     ctx.DrawTexturedRectangle(pane.BlockSize, pane.BlockSize, texture);
 }
Beispiel #3
0
 public GameBlockExplosionAnimation(GameBlock block, GamePane pane, int column, int row)
     : base(block, pane, column, row)
 {
     scale    = 1.0f;
     rotation = 0.0f;
     alpha    = 1.0f;
     yOff     = 0.0f;
 }
Beispiel #4
0
        public void Draw(DrawContext ctx, GamePane pane, float alpha)
        {
            Color4 blockColor = color;

            blockColor.A = alpha;
            ctx.BindTexture(texture);
            ctx.SetColor(blockColor);
            ctx.DrawTexturedRectangle(pane.BlockSize, pane.BlockSize, texture);
        }
Beispiel #5
0
 public GameBlockState(GamePane pane, int column, int row, float jiggle)
 {
     this.block                = null;
     this.pane                 = pane;
     this.column               = column;
     this.row                  = row;
     this.jiggle               = jiggle;
     this.animationStep        = -1.0f;
     this.animationSpeedFactor = 1.0f;
 }
 public GamePane GetOtherPane(GamePane pane)
 {
     if (pane == leftPane)
     {
         return(rightPane);
     }
     else if (pane == rightPane)
     {
         return(leftPane);
     }
     return(null);
 }
        public GameSession(Game game) : base(game)
        {
            backgroundTexture = new Texture("resources/background.png");
            Texture gameTexture = new Texture("resources/blocks.png");

            Texture[]   textures      = CreateBlockTextures(gameTexture);
            GameBlock[] regularBlocks = CreateColoredBlocks(textures, regularBlockColors, false);
            GameBlock[] hardBlocks    = CreateColoredBlocks(textures, hardBlockColors, true);
            barTexture      = gameTexture.Slice(6, 88, 243, 66);
            gameOverTexture = gameTexture.Slice(5, 166, 238, 45);

            leftPane  = new GamePane(this, regularBlocks, hardBlocks, 40.0f, 30.0f);
            rightPane = new GamePane(this, regularBlocks, hardBlocks, 430.0f, 30.0f);
            running   = true;
        }
Beispiel #8
0
        public GameSession(Game game)
            : base(game)
        {
            backgroundTexture = new Texture("resources/background.png");
            Texture gameTexture = new Texture("resources/blocks.png");
            Texture[] textures = CreateBlockTextures(gameTexture);
            GameBlock[] regularBlocks = CreateColoredBlocks(textures, regularBlockColors, false);
            GameBlock[] hardBlocks = CreateColoredBlocks(textures, hardBlockColors, true);
            barTexture = gameTexture.Slice(6, 88, 243, 66);
            gameOverTexture = gameTexture.Slice(5, 166, 238, 45);

            leftPane = new GamePane(this, regularBlocks, hardBlocks, 40.0f, 30.0f);
            rightPane = new GamePane(this, regularBlocks, hardBlocks, 430.0f, 30.0f);
            running = true;
        }
        public void OnBlocksCleared(GamePane pane, int blockCount, int lineCount)
        {
            GamePane otherPane = GetOtherPane(pane);

            if (lineCount > 1)
            {
                otherPane.DropHardLine();
            }
            if (blockCount >= 5)
            {
                pane.DecreaseSpeed();
            }
            if (blockCount >= 8)
            {
                otherPane.IncreaseSpeed();
            }
        }
Beispiel #10
0
 public void OnGameOver(GamePane pane)
 {
     running = false;
 }
Beispiel #11
0
 public void OnBlocksCleared(GamePane pane, int blockCount, int lineCount)
 {
     GamePane otherPane = GetOtherPane(pane);
     if (lineCount > 1)
         otherPane.DropHardLine();
     if (blockCount >= 5)
         pane.DecreaseSpeed();
     if (blockCount >= 8)
         otherPane.IncreaseSpeed();
 }
Beispiel #12
0
 public GameBlockAnimation(GameBlock block, GamePane pane, int column, int row)
 {
     this.block = block;
     this.pane = pane;
     this.column = column;
     this.row = row;
 }
Beispiel #13
0
 public GameBlockState(GamePane pane, int column, int row, float jiggle)
 {
     this.block = null;
     this.pane = pane;
     this.column = column;
     this.row = row;
     this.jiggle = jiggle;
     this.animationStep = -1.0f;
     this.animationSpeedFactor = 1.0f;
 }
Beispiel #14
0
 public GameBlockExplosionAnimation(GameBlock block, GamePane pane, int column, int row)
     : base(block, pane, column, row)
 {
     scale = 1.0f;
     rotation = 0.0f;
     alpha = 1.0f;
     yOff = 0.0f;
 }
Beispiel #15
0
 public void OnGameOver(GamePane pane)
 {
     running = false;
 }
Beispiel #16
0
 public GameBlockDissolveAnimation(GameBlock block, GamePane pane, int column, int row)
     : base(block, pane, column, row)
 {
     this.scale    = 1.0f;
     this.rotation = 0.0f;
 }
Beispiel #17
0
 public GamePane GetOtherPane(GamePane pane)
 {
     if (pane == leftPane)
         return rightPane;
     else if (pane == rightPane)
         return leftPane;
     return null;
 }
Beispiel #18
0
 public GameBlockDissolveAnimation(GameBlock block, GamePane pane, int column, int row)
     : base(block, pane, column, row)
 {
     this.scale = 1.0f;
     this.rotation = 0.0f;
 }