Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test high tiles #2

Open
petrosh opened this issue Apr 23, 2014 · 1 comment
Open

Test high tiles #2

petrosh opened this issue Apr 23, 2014 · 1 comment

Comments

@petrosh
Copy link
Member

petrosh commented Apr 23, 2014

on game-manager.js:

line 144 extend legend tile list

for (var i = 1; i <= 12; i++) {

then exist already this function to crowd the board with live tiles.

// Crowd board
GameManager.prototype.crowd = function () {
  this.storageManager.clearGameState();
  this.actuator.continueGame(); // Clear the game won/lost message
  this.grid        = new Grid(this.size);
  this.score       = 0;
  this.over        = false;
  this.won         = false;
  this.keepPlaying = false;
  this.actuate();
  var counter = 0;
  for (var i = 0; i < 3; i++) {
    for (var j = 0; j < 4; j++) {
      counter++;
      var value = Math.pow(2, counter);
      var tile = new Tile({ x: j, y: i }, value);
      // adjust limit below
      if (value <= 4096) this.grid.insertTile(tile);    
    }
  }
};

To activate

  • uncomment line 9
    this.inputManager.on("crowd", this.crowd.bind(this));
  • uncomment line 72 in keyboard_input_manager.js
    this.bindButtonPress(".crowd-button", this.crowd);
  • add crow button anywhere in index.html
    <a class="crowd-button">crowd</a>
@petrosh petrosh closed this as completed Apr 23, 2014
@petrosh petrosh reopened this Apr 23, 2014
@petrosh
Copy link
Member Author

petrosh commented Apr 28, 2014

...or more simply edit <div class="tile tile-4096 tile-position-2-1"> and the svg url inside the tile <img src="style/img/4096.svg">

background is black though... :(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant