Beispiel #1
0
    return this.flashLines.flash().then(() => {
      // shift the map for each line to remove
      for (let i = 0; i < lines.length; ++i) {
        map.shift(lines[i] + i, 1);
      }

      // add wall at each side of the new lines
      for (let i = 0; i < height; ++i) {
        for (let j = 0; j < map.numCols; ++j) {
          map.updateTile(j, i, 0, Tile.TYPE.AIR);
        }
        map.updateTile(0, i, 8, Tile.TYPE.WALL);
        map.updateTile(map.numCols - 1, i, 8, Tile.TYPE.WALL);
      }

      Dom('.athena-game').addClass('shake-vertical shake-constant');
      setTimeout(() => {
        Dom('.athena-game').removeClass('shake-vertical shake-constant');
      }, 300);

      this.increaseScore(lines.length);
      this.updateLevel();
    });
Beispiel #2
0
 setTimeout(() => {
   Dom('.athena-game').removeClass('shake-vertical shake-constant');
 }, 300);
Beispiel #3
0
import { Dom } from 'athenajs';

const div = Dom('div');
const body = Dom(document.body);
const domElt: HTMLElement = body[0];

// Dom.appendTo
div.appendTo(body).show().hide();
div.appendTo(domElt);

const str: string | null = body.css('display');
const i: number = body.length;

// Dom.css
body.css('display', ' block');
body.css({ display: 'none' });
body.css('display', 'block');

// Dom.find
body.find('div').appendTo('body');

// Dom.attr
body.attr('data-test', 'hi');
body.attr({ 'data-test2': 'foo' });

// Dom.addClass/Dom.removeClass
body.addClass('foo').removeClass('foo');

// Dom.show/hide
body.show().hide();