Android Open Source - Tetris-Evolution Blocks Box






From Project

Back to project page Tetris-Evolution.

License

The source code is released under:

GNU General Public License

If you think the Android project Tetris-Evolution listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.mygdx.blocks;
//ww w .  j av a  2s  .co m
import java.util.HashMap;
import java.util.Map;

import com.badlogic.gdx.utils.Array;

public class BlocksBox {
  private Array<Block> blocks;
  
  public BlocksBox(){
    blocks = new Array<Block>();
  }
  
  public boolean checkBlockCollisionWithOtherBlocks(Block block, float xMove, float yMove){
    for (Block otherBlock : getBlocks()) {
      if (!block.equals(otherBlock) && block.checkCollisionWithBlock(xMove, yMove, otherBlock)){
        return true;
      }
    }
    
    return false;
  }
  
  public Array<Block> getBlocks(){
    return blocks;
  }
  
  public Block getBlock(float x, float y){
    for (Block block : getBlocks()) {
      if (block.checkCollisionWithPoint(0, 0, x, y, 1, 1)) return block;
    }
    
    return null;
  }
  
  public int getBlockIndex(float x, float y){
    for (int index = 0; index < blocks.size; index++) {
      if (blocks.get(index).checkCollisionWithPoint(0, 0, x, y, 1, 1)) return index;
    }
    
    return -1;
  }
}




Java Source Code List

com.mygdx.TetrisEvolution.android.AndroidLauncher.java
com.mygdx.TetrisEvolution.client.HtmlLauncher.java
com.mygdx.TetrisEvolution.desktop.DesktopLauncher.java
com.mygdx.blocks.Block.java
com.mygdx.blocks.BlocksBox.java
com.mygdx.blocks.Connect.java
com.mygdx.blocks.Level.java
com.mygdx.blocks.LogicScheme.java
com.mygdx.game.Game.java
com.mygdx.main.TetrisEvolution.java
com.mygdx.modes.DarwinMode.java
com.mygdx.modes.Mode.java
com.mygdx.renderer.ModeRenderer.java
com.mygdx.states.Info.java
com.mygdx.states.MainMenu.java
com.mygdx.states.ModeMenu.java
com.mygdx.states.Play.java
com.mygdx.states.Splash.java
com.mygdx.tools.GifDecoder.java
com.mygdx.tools.InvertXY.java
com.mygdx.tools.Resources.java
com.mygdx.util.Collision.java