コード例 #1
0
ファイル: GameBlock.cs プロジェクト: polytronicgr/blockpuzzle
 public GameBlockAnimation(GameBlock block, GamePane pane, int column, int row)
 {
     this.block  = block;
     this.pane   = pane;
     this.column = column;
     this.row    = row;
 }
コード例 #2
0
ファイル: GameBlock.cs プロジェクト: mitsuhiko/blockpuzzle
 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);
 }
コード例 #3
0
ファイル: GameBlock.cs プロジェクト: polytronicgr/blockpuzzle
 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;
 }
コード例 #4
0
ファイル: GameBlock.cs プロジェクト: polytronicgr/blockpuzzle
        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);
        }
コード例 #5
0
ファイル: GameBlock.cs プロジェクト: polytronicgr/blockpuzzle
 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;
 }
コード例 #6
0
 public GamePane GetOtherPane(GamePane pane)
 {
     if (pane == leftPane)
     {
         return(rightPane);
     }
     else if (pane == rightPane)
     {
         return(leftPane);
     }
     return(null);
 }
コード例 #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;
        }
コード例 #8
0
ファイル: GameSession.cs プロジェクト: mitsuhiko/blockpuzzle
        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;
        }
コード例 #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();
            }
        }
コード例 #10
0
ファイル: GameSession.cs プロジェクト: mitsuhiko/blockpuzzle
 public void OnGameOver(GamePane pane)
 {
     running = false;
 }
コード例 #11
0
ファイル: GameSession.cs プロジェクト: mitsuhiko/blockpuzzle
 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();
 }
コード例 #12
0
ファイル: GameBlock.cs プロジェクト: mitsuhiko/blockpuzzle
 public GameBlockAnimation(GameBlock block, GamePane pane, int column, int row)
 {
     this.block = block;
     this.pane = pane;
     this.column = column;
     this.row = row;
 }
コード例 #13
0
ファイル: GameBlock.cs プロジェクト: mitsuhiko/blockpuzzle
 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;
 }
コード例 #14
0
ファイル: GameBlock.cs プロジェクト: mitsuhiko/blockpuzzle
 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;
 }
コード例 #15
0
 public void OnGameOver(GamePane pane)
 {
     running = false;
 }
コード例 #16
0
ファイル: GameBlock.cs プロジェクト: polytronicgr/blockpuzzle
 public GameBlockDissolveAnimation(GameBlock block, GamePane pane, int column, int row)
     : base(block, pane, column, row)
 {
     this.scale    = 1.0f;
     this.rotation = 0.0f;
 }
コード例 #17
0
ファイル: GameSession.cs プロジェクト: mitsuhiko/blockpuzzle
 public GamePane GetOtherPane(GamePane pane)
 {
     if (pane == leftPane)
         return rightPane;
     else if (pane == rightPane)
         return leftPane;
     return null;
 }
コード例 #18
0
ファイル: GameBlock.cs プロジェクト: mitsuhiko/blockpuzzle
 public GameBlockDissolveAnimation(GameBlock block, GamePane pane, int column, int row)
     : base(block, pane, column, row)
 {
     this.scale = 1.0f;
     this.rotation = 0.0f;
 }