public GameBlockAnimation(GameBlock block, GamePane pane, int column, int row) { this.block = block; this.pane = pane; this.column = column; this.row = row; }
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); }
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; }
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; }
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(); } }
public void OnGameOver(GamePane pane) { running = false; }
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(); }
public GameBlockDissolveAnimation(GameBlock block, GamePane pane, int column, int row) : base(block, pane, column, row) { this.scale = 1.0f; this.rotation = 0.0f; }
public GamePane GetOtherPane(GamePane pane) { if (pane == leftPane) return rightPane; else if (pane == rightPane) return leftPane; return null; }