File indexing completed on 2024-04-28 04:02:03

0001 /*
0002     SPDX-FileCopyrightText: 2012 Viranch Mehta <viranch.mehta@gmail.com>
0003 
0004     SPDX-License-Identifier: GPL-2.0-or-later
0005 */
0006 
0007 // how many pixels it moves each step
0008 // should be less than the half of BALL_SIZE
0009 var BALL_SPEED = 2;
0010 var MINIMUM_SPEED = 1.2;
0011 var MINIMUM_GIFT_SPEED = 1;
0012 var MAXIMUM_GIFT_SPEED = 3;
0013 var REPAINT_INTERVAL = 16; // should be a power of two
0014 // how ofter the position of the item is updated (but not repainted)
0015 var DEFAULT_UPDATE_INTERVAL = 13;
0016 //var MAXIMUM_UPDATE_INTERVAL = REPAINT_INTERVAL;
0017 // the higher this number the more the game becomes faster over time
0018 var AUTO_SPEED_INCREASE = 1.05;
0019 
0020 var BURNING_INTERVAL = 200; // how long it burns
0021 var BURNING_SPEED = Math.floor(BURNING_INTERVAL/2); // lower is faster
0022 
0023 var WIDTH = 20; // how many bricks the game is wide
0024 var HEIGHT = 24; // how many bricks the game is high
0025 var BRICK_WIDTH = 30;
0026 var BRICK_HEIGHT = 15;
0027 var BALL_SIZE = 10;
0028 var DEFAULT_BAR_WIDTH = 60;
0029 var MIN_BAR_WIDTH = 30;
0030 var MAX_BAR_WIDTH = 250;
0031 var GIFT_WIDTH = 25;
0032 var GIFT_HEIGHT = 18;
0033 
0034 // used to enlarge and shrink the bar
0035 var RESIZE_BAR_RATIO = 1.4;
0036 var CHANGE_SPEED_RATIO = 1.3;
0037 
0038 // pixels to move the bar each "tick", when using the keyboard
0039 var BAR_MOVEMENT = 5;
0040 
0041 // points when breaking a brick
0042 // decreases over time since last brick was hit
0043 var BRICK_SCORE = 15;
0044 // relative score w.r.t the old score
0045 var SCORE_AUTO_DECREASE = 0.998;
0046 // score when i brick gets "autoremoved" 
0047 // (for example becouse of a gift, of fire)
0048 var AUTOBRICK_SCORE = Math.floor(BRICK_SCORE / 2);
0049 // points avarded when passing a level
0050 var LEVEL_SCORE = 300;
0051 var GIFT_SCORE = 30;
0052 var LOSE_LIFE_SCORE = 0; // disabled
0053 // score added for each life when game is won
0054 var LIFE_SCORE = 2000;
0055 var GAME_WON_SCORE = 10000;
0056 var INITIAL_LIVES = 2;
0057 var MAXIMUM_LIVES = 10;
0058 
0059 // minimum with and height of the game widget (CanvasWidget)
0060 var DEFAULT_WIDTH = 750;
0061 var DEFAULT_HEIGHT = 500;