File indexing completed on 2024-04-14 03:59:28

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