コード例 #1
0
 protected void AddNullMark(int x, int y) {
   gameManager.playOnAddEmptyMark();
   AbstractBehaviorBuilder builder = new EmptyMarkBuilder();
   Matrix m = marks();
   AbstractBehavior mark = builder.create(gameManager.view());
   m.insertMark(x, y, mark);
 }
コード例 #2
0
 protected void createNullMark() {
   Matrix m = marks();
   Random rnd = new Random();
   int x = rnd.nextInt(m.columns());
   int y = rnd.nextInt(m.rows());
   AddNullMark(x, y);
 }
コード例 #3
0
 protected void createBlockMark() {
   Matrix m = marks();
   Random rnd = new Random();
   int x = rnd.nextInt(m.columns());
   int y = rnd.nextInt(m.rows());
   while (!blockMark(x, y)) ;
 }
コード例 #4
0
  protected boolean blockMark(int x, int y) {
    Matrix m = marks();
    BehaviorDelegate mark = (BehaviorDelegate) m.getMark(x, y);
    if (mark.isDied()) return false;

    Sprite sprite = new Sprite(ImagesPool.instance(gameManager.view()).getCage(), 1000, 1, 1);
    ViewsManager viewManager = new SlowViewBehavior(mark, sprite, gameManager.view().gameField());
    BlockBehavior b = new BlockBehavior(viewManager, gameManager.view().gameField());

    m.insertMark(x, y, b);
    gameManager.playOnAddBlock();
    return true;
  }