===================================================================
--- original.js
+++ change.js
@@ -1040,13 +1040,14 @@
var ROW_SPEED_BASE = 0.2;
var ROW_SPEED_INCREASE = 0.04;
var ROW_SPEED_INCREASE_MIN = 0.01;
var ROW_SPEED_INCREASE_FACTOR = 0.9;
-var COL_SLIP_MIN = 30;
-var COL_SLIP_MAX = 50;
-var COL_SLIP_TIME = 500;
+var COL_SLIP_MIN = 10;
+var COL_SLIP_MAX = 30;
+var COL_SLIP_TIME = 750;
var COL_TIMEOUT_MIN = 1000;
var COL_TIMEOUT_MAX = 10000;
+var COL_RISE_FACTOR = 0.2;
var COMPLIMENTS = {
up: 'down',
right: 'left',
down: 'up',
@@ -1067,36 +1068,19 @@
// Play background music on repeat when the game starts
LK.playMusic('background', {
loop: true
});
-console.log(columns); // TEMP
game.update = function () {
- var i = 1;
- // for (var i = 1; i < columns.length - 1; i++) {
- var column = columns[i];
- if (!column.timer) {
- if (column.y > 0) {
- column.y = Math.max(0, column.y - rowSpeed);
- } else {
- column.timer = true; // Set the column's timer to true
- var timeoutDuration = COL_TIMEOUT_MIN + Math.random() * (COL_TIMEOUT_MAX - COL_TIMEOUT_MIN);
- LK.setTimeout(function () {
- var targetY = COL_SLIP_MIN + Math.random() * (COL_SLIP_MAX - COL_SLIP_MIN);
- tween(column, {
- y: targetY
- }, {
- duration: COL_SLIP_TIME,
- easing: tween.easeIn,
- // Apply ease in for the tween
- onFinish: function onFinish() {
- column.timer = false; // Reset the timer to false after tween completes
- console.log('timer done for column ' + column.index);
- }
- });
- }, timeoutDuration);
+ for (var i = 1; i < columns.length - 1; i++) {
+ var column = columns[i];
+ if (!column.timer) {
+ if (column.y > 0) {
+ column.y = Math.max(0, column.y - rowSpeed * COL_RISE_FACTOR);
+ } else {
+ startColumnTimer(i);
+ }
}
}
- // }
};
var scoreText = new BorderedText('0', {
size: 100,
anchorX: 0.5,
@@ -1199,8 +1183,26 @@
rowSpeed += rowSpeedIncrease;
rowSpeedText.setText((rowSpeed * 60).toFixed(1));
rowSpeedIncrease = Math.max(ROW_SPEED_INCREASE_MIN, rowSpeedIncrease * ROW_SPEED_INCREASE_FACTOR);
}
+function startColumnTimer(index) {
+ var column = columns[index];
+ column.timer = true;
+ var timeoutDuration = COL_TIMEOUT_MIN + Math.random() * (COL_TIMEOUT_MAX - COL_TIMEOUT_MIN);
+ LK.setTimeout(function () {
+ var targetY = COL_SLIP_MIN + Math.random() * (COL_SLIP_MAX - COL_SLIP_MIN);
+ tween(column, {
+ y: targetY
+ }, {
+ duration: COL_SLIP_TIME,
+ easing: tween.easeIn,
+ // Apply ease in for the tween
+ onFinish: function onFinish() {
+ column.timer = false; // Reset the timer to false after tween completes
+ }
+ });
+ }, timeoutDuration);
+}
function randomizeBlockClass(settings) {
var classes = [{
blockClass: BlockBlank,
chance: Math.max(0, 1.5 - 0.5 * (settings.blanks || 0))
background
Music
light
Sound effect
rotate
Sound effect
error
Sound effect
crack
Sound effect
break
Sound effect
flow
Sound effect
bubble1
Sound effect
bubble2
Sound effect
bubble3
Sound effect
bubble4
Sound effect
bubble5
Sound effect
gong
Sound effect