Skip to content

Commit 8531a54

Browse files
Renamed
1 parent 5c53dc5 commit 8531a54

7 files changed

+44
-40
lines changed

Copyright

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
/*!
2-
* Tetris.js <%= version %>
3-
* jQuery plugin that lets you put a playable (and configurable) tetris in your site or just leave it in auto in the background.
4-
* http://aerolab.github.io/tetris.js/
2+
* BlockRain.js <%= version %>
3+
* jQuery plugin that lets you put a playable (and configurable) game of Tetris in your site or just leave it in auto in the background.
4+
* http://aerolab.github.io/blockrain.js/
55
*
66
* Copyright (c) 2015 Aerolab <[email protected]>
77
*
88
* Released under the MIT license
9-
* http://aerolab.github.io/tetris.js/LICENSE.txt
9+
* http://aerolab.github.io/blockrain.js/LICENSE.txt
1010
*/
1111

File renamed without changes.

tetris.jquery.src.js blockrain.jquery.src.js

+28-23
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/**
2-
* Tetris.js is based on http://mrcoles.com/tetris/
3-
* I haven't seen it on github, but it's one of the better js tetris clones out there
2+
* BlockRain.js is based on http://mrcoles.com/tetris/
3+
* I haven't seen it on github, but it's one of the better js Tetris clones out there
44
*/
55

66
$.fn.safekeypress = function(func, cfg) {
@@ -40,9 +40,9 @@ $.fn.safekeypress = function(func, cfg) {
4040
};
4141

4242

43-
$.fn.tetris = function( customOptions ) {
43+
$.fn.blockrain = function( customOptions ) {
4444

45-
$.fn.tetris['themes'] = {
45+
$.fn.blockrain['themes'] = {
4646
'modern': {
4747
primary: null,
4848
secondary: null,
@@ -79,6 +79,11 @@ $.fn.tetris = function( customOptions ) {
7979
'aerolab': {
8080
primary: '#ff7b00',
8181
secondary: '#000000'
82+
},
83+
'chocolate': {
84+
primary: '#7B3F00',
85+
secondary: '#7B3F00',
86+
stroke: '#291811'
8287
}
8388
};
8489

@@ -87,7 +92,7 @@ $.fn.tetris = function( customOptions ) {
8792
var options = {
8893
autoplay: false,
8994
showFieldOnStart: true,
90-
theme: $.fn.tetris.themes['retro'],
95+
theme: $.fn.blockrain.themes['retro'],
9196
blockWidth: 10,
9297
autoBlockWidth: false,
9398
autoBlockSize: 24,
@@ -103,11 +108,11 @@ $.fn.tetris = function( customOptions ) {
103108
options = $.extend(options, customOptions);
104109

105110
if( typeof options.theme === 'string' ) {
106-
options.theme = $.fn.tetris.themes[options.theme];
111+
options.theme = $.fn.blockrain.themes[options.theme];
107112
}
108113

109114
var $game = $(this);
110-
var $gameholder = $('<div class="tetris-game-holder"></div>');
115+
var $gameholder = $('<div class="blockrain-game-holder"></div>');
111116
$game.html('').append($gameholder);
112117

113118
$gameholder.css('position', 'relative').css('width', '100%').css('height', '100%');
@@ -123,25 +128,25 @@ $.fn.tetris = function( customOptions ) {
123128

124129
// Score
125130
var $score = $(
126-
'<div class="tetris-score-holder" style="position:absolute; top:0; right:0; ">'+
127-
'<div class="tetris-score">'+
128-
'<div class="tetris-score-msg">Score</div>'+
129-
'<div class="tetris-score-num">0</div>'+
131+
'<div class="blockrain-score-holder" style="position:absolute; top:0; right:0; ">'+
132+
'<div class="blockrain-score">'+
133+
'<div class="blockrain-score-msg">Score</div>'+
134+
'<div class="blockrain-score-num">0</div>'+
130135
'</div>'+
131136
'</div>');
132-
var $scoreText = $score.find('.tetris-score-num');
137+
var $scoreText = $score.find('.blockrain-score-num');
133138
$gameholder.append($score);
134139

135140
// Create the start menu
136141
var $start = $(
137-
'<div class="tetris-start-holder" style="position:absolute; top:0; left:0; right:0; bottom:0;">'+
138-
'<div class="tetris-start">'+
139-
'<button class="tetris-start-btn btn">Play Tetris</button>'+
142+
'<div class="blockrain-start-holder" style="position:absolute; top:0; left:0; right:0; bottom:0;">'+
143+
'<div class="blockrain-start">'+
144+
'<button class="blockrain-start-btn">Play blockrain</button>'+
140145
'</div>'+
141146
'</div>');
142147
$gameholder.append($start);
143148

144-
$start.find('.tetris-start-btn').click(function(event){
149+
$start.find('.blockrain-start-btn').click(function(event){
145150
event.preventDefault();
146151
$start.fadeOut(200);
147152
$gameover.fadeOut(200);
@@ -151,13 +156,13 @@ $.fn.tetris = function( customOptions ) {
151156

152157
// Create the game over menu
153158
var $gameover = $(
154-
'<div class="tetris-game-over-holder" style="position:absolute; top:0; left:0; right:0; bottom:0; display:none;">'+
155-
'<div class="tetris-game-over">'+
156-
'<div class="tetris-game-over-msg">Game Over</div>'+
157-
'<button class="tetris-game-over-btn btn">Play Again</button>'+
159+
'<div class="blockrain-game-over-holder" style="position:absolute; top:0; left:0; right:0; bottom:0; display:none;">'+
160+
'<div class="blockrain-game-over">'+
161+
'<div class="blockrain-game-over-msg">Game Over</div>'+
162+
'<button class="blockrain-game-over-btn">Play Again</button>'+
158163
'</div>'+
159164
'</div>');
160-
$gameover.find('.tetris-game-over-btn').click(function(event){
165+
$gameover.find('.blockrain-game-over-btn').click(function(event){
161166
event.preventDefault();
162167
$start.fadeOut(200);
163168
$gameover.fadeOut(200);
@@ -671,7 +676,7 @@ $.fn.tetris = function( customOptions ) {
671676

672677
var start = [], colors = [], i, ilen, j, jlen, color;
673678

674-
// Draw a random tetris screen
679+
// Draw a random blockrain screen
675680
for( var i in shapeFactory ) {
676681
colors.push( getBlockColor(i, false) );
677682
}
@@ -766,7 +771,7 @@ $.fn.tetris = function( customOptions ) {
766771
}
767772
}
768773

769-
// Draw the tetris field
774+
// Draw the blockrain field
770775
ctx.clearRect(0, 0, PIXEL_WIDTH, PIXEL_HEIGHT);
771776
filled.draw();
772777
this.cur.draw(drop);

bower.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
2-
"name": "tetris",
2+
"name": "blockrain",
33
"version": "0.1.0",
44
"description": "Add a game of tetris to your site",
5-
"main": "tetris.jquery.js",
5+
"main": "blockrain.jquery.js",
66
"license": "MIT",
77
"authors": [
88
"Aerolab <[email protected]>"

gulpfile.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@ var getCopyright = function () {
1313
};
1414

1515
gulp.task('build', function () {
16-
gulp.src('./tetris.jquery.src.js')
16+
gulp.src('./blockrain.jquery.src.js')
1717
.pipe(header(getCopyright(), {version: getVersion()}))
18-
.pipe(concat('tetris.jquery.js'))
18+
.pipe(concat('blockrain.jquery.js'))
1919
.pipe(gulp.dest('./'))
2020
.pipe(uglify({preserveComments:'some'}))
21-
.pipe(concat('tetris.jquery.min.js'))
21+
.pipe(concat('blockrain.jquery.min.js'))
2222
.pipe(gulp.dest('./'));
2323
});
2424

index.html

+4-5
Original file line numberDiff line numberDiff line change
@@ -54,19 +54,18 @@ <h1>Use a background</h1>
5454
</section>
5555

5656

57-
5857
<script src="assets/js/jquery-1.11.1.min.js"></script>
59-
<script src="tetris.jquery.src.js"></script>
58+
<script src="blockrain.jquery.src.js"></script>
6059
<script>
61-
$('#cover-tetris').tetris({
60+
$('#cover-tetris').blockrain({
6261
autoplay: true,
6362
speed: 10,
6463
autoBlockWidth: true,
6564
autoBlockSize: 25,
6665
theme: 'modern'
6766
});
6867

69-
$('#tetris-versus-1, #tetris-versus-2').tetris({
68+
$('#tetris-versus-1, #tetris-versus-2').blockrain({
7069
autoplay: true,
7170
speed: 10,
7271
theme: 'monochrome',
@@ -75,7 +74,7 @@ <h1>Use a background</h1>
7574
}
7675
});
7776

78-
$('#tetris-hipster').tetris({
77+
$('#tetris-hipster').blockrain({
7978
autoplay: true,
8079
speed: 10,
8180
autoBlockWidth: true,

package.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "Tetris.JS",
2+
"name": "Blockrain.JS",
33
"version": "0.1.0",
44
"description": "Add a game of tetris to your site",
55
"devDependencies": {
@@ -10,11 +10,11 @@
1010
},
1111
"repository": {
1212
"type": "git",
13-
"url": "https://github.com/Aerolab/tetris.js"
13+
"url": "https://github.com/Aerolab/blockrain.js"
1414
},
1515
"author": "Aerolab",
1616
"license": "MIT",
1717
"bugs": {
18-
"url": "https://github.com/Aerolab/tetris.js/issues"
18+
"url": "https://github.com/Aerolab/blockrain.js/issues"
1919
}
2020
}

0 commit comments

Comments
 (0)