Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: Aerolab/blockrain.js
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 0.2.0
Choose a base ref
...
head repository: Aerolab/blockrain.js
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: gh-pages
Choose a head ref
  • 14 commits
  • 8 files changed
  • 4 contributors

Commits on Dec 20, 2016

  1. fix css inclusion code

    lsei authored Dec 20, 2016
    Copy the full SHA
    eac3bab View commit details
  2. Merge pull request #18 from lsei/gh-pages

    fix css inclusion code
    RobertoGonzalez authored Dec 20, 2016
    Copy the full SHA
    150d3af View commit details

Commits on Jul 11, 2017

  1. added auto-shifting

    mikirobles committed Jul 11, 2017
    Copy the full SHA
    eb80e34 View commit details
  2. cleanup

    mikirobles committed Jul 11, 2017
    Copy the full SHA
    9726fe2 View commit details
  3. revert cleanup

    mikirobles committed Jul 11, 2017
    Copy the full SHA
    d8b1c45 View commit details

Commits on Jul 12, 2017

  1. Copy the full SHA
    8a082af View commit details

Commits on Aug 6, 2017

  1. Copy the full SHA
    c3f953d View commit details
  2. fix indentation

    mikirobles committed Aug 6, 2017
    Copy the full SHA
    764e972 View commit details
  3. fix indentation

    mikirobles committed Aug 6, 2017
    Copy the full SHA
    17a229e View commit details
  4. fix indentation

    mikirobles committed Aug 6, 2017
    Copy the full SHA
    9632a46 View commit details
  5. fix typo

    mikirobles committed Aug 6, 2017
    Copy the full SHA
    43be543 View commit details
  6. build

    mikirobles committed Aug 6, 2017
    Copy the full SHA
    4314a91 View commit details
  7. Merge pull request #21 from erosilk/gh-pages

    Add auto-shifting
    RobertoGonzalez authored Aug 6, 2017
    1
    Copy the full SHA
    a38129e View commit details
  8. v0.2.1

    RobertoGonzalez committed Aug 6, 2017
    Copy the full SHA
    ba6d419 View commit details
Showing with 2,673 additions and 10 deletions.
  1. +1 −1 README.md
  2. +1 −1 dist/README.md
  3. +43 −3 dist/blockrain.jquery.js
  4. +1 −1 dist/blockrain.jquery.min.js
  5. BIN dist/blockrain.zip
  6. +2,580 −0 package-lock.json
  7. +4 −1 package.json
  8. +43 −3 src/blockrain.jquery.src.js
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -21,7 +21,7 @@ Then you just include **jquery** and **blockrain** and setup the game with **$('

```html
<!-- The stylesheet should go in the <head>, or be included in your CSS -->
<link rel="stylesheet" src="blockrain.css">
<link rel="stylesheet" href="blockrain.css">

<!-- jQuery and Blockrain.js -->
<script src="jquery.js"></script>
2 changes: 1 addition & 1 deletion dist/README.md
Original file line number Diff line number Diff line change
@@ -21,7 +21,7 @@ Then you just include **jquery** and **blockrain** and setup the game with **$('

```html
<!-- The stylesheet should go in the <head>, or be included in your CSS -->
<link rel="stylesheet" src="blockrain.css">
<link rel="stylesheet" href="blockrain.css">

<!-- jQuery and Blockrain.js -->
<script src="jquery.js"></script>
46 changes: 43 additions & 3 deletions dist/blockrain.jquery.js
Original file line number Diff line number Diff line change
@@ -447,11 +447,51 @@
orientation: 0, // 4 possible

rotate: function(direction) {
var orientation = (this.orientation + (direction === 'left' ? 1 : -1) + 4) % 4;
var orientation =
(this.orientation + (direction === "left" ? 1 : -1) + 4) % 4;

if (!game._checkCollisions(
this.x,
this.y,
this.getBlocks(orientation)
)) {
this.orientation = orientation;
game._board.renderChanged = true;
} else {
var ogOrientation = this.orientation;
var ogX = this.x;
var ogY = this.y;

//TODO - when past limit - auto shift and remember that too!
if (!game._checkCollisions(this.x, this.y, this.getBlocks(orientation))) {
this.orientation = orientation;

while (this.x >= game._BLOCK_WIDTH - 2) {
this.x--;
}
while (this.x < 0) {
this.x++;
}

if (this.blockType === "line" && this.x === 0) this.x++;

if ( game._checkCollisions(
this.x,
this.y,
this.getBlocks(orientation)
)
) {
this.y--;
if (
game._checkCollisions(
this.x,
this.y,
this.getBlocks(orientation)
)
) {
this.x = ogX;
this.y = ogY;
this.orientation = ogOrientation;
}
}
game._board.renderChanged = true;
}
},
2 changes: 1 addition & 1 deletion dist/blockrain.jquery.min.js

Large diffs are not rendered by default.

Binary file modified dist/blockrain.zip
Binary file not shown.
2,580 changes: 2,580 additions & 0 deletions package-lock.json

Large diffs are not rendered by default.

5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
{
"name": "blockrain",
"version": "0.2.0",
"version": "0.2.1",
"description": "Add a game of tetris to your site",
"main": "dist/blockrain.jquery.min.js",
"dependencies": {
"jquery": "~1.11.3"
},
"scripts": {
"build": "gulp build"
},
"devDependencies": {
"gulp": "^3.8.8",
"gulp-clean": "^0.3.1",
46 changes: 43 additions & 3 deletions src/blockrain.jquery.src.js
Original file line number Diff line number Diff line change
@@ -435,11 +435,51 @@
orientation: 0, // 4 possible

rotate: function(direction) {
var orientation = (this.orientation + (direction === 'left' ? 1 : -1) + 4) % 4;
var orientation =
(this.orientation + (direction === "left" ? 1 : -1) + 4) % 4;

if (!game._checkCollisions(
this.x,
this.y,
this.getBlocks(orientation)
)) {
this.orientation = orientation;
game._board.renderChanged = true;
} else {
var ogOrientation = this.orientation;
var ogX = this.x;
var ogY = this.y;

//TODO - when past limit - auto shift and remember that too!
if (!game._checkCollisions(this.x, this.y, this.getBlocks(orientation))) {
this.orientation = orientation;

while (this.x >= game._BLOCK_WIDTH - 2) {
this.x--;
}
while (this.x < 0) {
this.x++;
}

if (this.blockType === "line" && this.x === 0) this.x++;

if ( game._checkCollisions(
this.x,
this.y,
this.getBlocks(orientation)
)
) {
this.y--;
if (
game._checkCollisions(
this.x,
this.y,
this.getBlocks(orientation)
)
) {
this.x = ogX;
this.y = ogY;
this.orientation = ogOrientation;
}
}
game._board.renderChanged = true;
}
},