Ejemplo n.º 1
0
 public GameBlockAnimation(GameBlock block, GamePane pane, int column, int row)
 {
     this.block  = block;
     this.pane   = pane;
     this.column = column;
     this.row    = row;
 }
Ejemplo n.º 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);
 }
Ejemplo n.º 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;
 }
Ejemplo n.º 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);
        }
Ejemplo n.º 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;
 }
Ejemplo n.º 6
0
 public GamePane GetOtherPane(GamePane pane)
 {
     if (pane == leftPane)
     {
         return(rightPane);
     }
     else if (pane == rightPane)
     {
         return(leftPane);
     }
     return(null);
 }
Ejemplo n.º 7
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;
        }
Ejemplo n.º 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;
        }
Ejemplo n.º 9
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();
            }
        }
Ejemplo n.º 10
0
 public void OnGameOver(GamePane pane)
 {
     running = false;
 }
Ejemplo n.º 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();
 }
Ejemplo n.º 12
0
 public GameBlockAnimation(GameBlock block, GamePane pane, int column, int row)
 {
     this.block = block;
     this.pane = pane;
     this.column = column;
     this.row = row;
 }
Ejemplo n.º 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;
 }
Ejemplo n.º 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;
 }
Ejemplo n.º 15
0
 public void OnGameOver(GamePane pane)
 {
     running = false;
 }
Ejemplo n.º 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;
 }
Ejemplo n.º 17
0
 public GamePane GetOtherPane(GamePane pane)
 {
     if (pane == leftPane)
         return rightPane;
     else if (pane == rightPane)
         return leftPane;
     return null;
 }
Ejemplo n.º 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;
 }