// ========================================================================== // STC - SIMPLE TETRIS CLONE // -------------------------------------------------------------------------- // Game constants and definitions. // // Copyright (c) 2009 Laurens Rodriguez Oscanoa. // This code is licensed under the MIT license: // http://www.opensource.org/licenses/mit-license.php // -------------------------------------------------------------------------- #include "game.h" #define STC_USE_SIMPLE_SDL //define multiple times for SciTE syntax highlight!! can be removed. #ifdef STC_USE_SIMPLE_SDL // Image files: ONLY Absolute paths?? //#define BMP_BACKGROUND "ndless/nTris/back.bmp.tns" //#define BMP_TILE_BLOCKS "ndless/nTris/blocks.bmp.tns" //#define BMP_NUMBERS "ndless/nTris/numbers.bmp.tns" //filename only! #define BMP_BACKGROUND "back.bmp.tns" // UI layout (quantities are expressed in pixels) // Screen size //defined by default for nSpire //#define SCREEN_WIDTH (320) //#define SCREEN_HEIGHT (240) // Size of square tile #define TILE_SIZE (12) // Board up-left corner coordinates #define BOARD_X (66) #define BOARD_Y (-24) //correct for unsufficient screen space. skip firs 2 lines // Preview tetromino position //#define PREVIEW_X (112) //#define PREVIEW_Y (210) #define PREVIEW_X (14) #define PREVIEW_Y (107) // Level position and length on screen //#define LEVEL_X (108) //#define LEVEL_Y (16) //#define LEVEL_LENGTH (5) #define LEVEL_X (2) #define LEVEL_Y (24) #define LEVEL_LENGTH (4) // Lines position and length on screen //#define LINES_X (108) //#define LINES_Y (34) //#define LINES_LENGTH (5) #define LINES_X (LEVEL_X) #define LINES_Y (LEVEL_Y+36) #define LINES_LENGTH (4) // Score position and length on screen //#define SCORE_X (72) //#define SCORE_Y (52) //#define SCORE_LENGTH (10) #define SCORE_X (LEVEL_X-4) #define SCORE_Y (216) #define SCORE_LENGTH (8) // Tetromino subtotals position //#define TETROMINO_X (425) //#define TETROMINO_L_Y (53) //#define TETROMINO_I_Y (77) //#define TETROMINO_T_Y (101) //#define TETROMINO_S_Y (125) //#define TETROMINO_Z_Y (149) //#define TETROMINO_O_Y (173) //#define TETROMINO_J_Y (197) //#define TETROMINO_LENGTH (5) #define TETROMINO_X (282) #define TETROMINO_L_Y (36) #define TETROMINO_I_Y (TETROMINO_L_Y+24) #define TETROMINO_T_Y (TETROMINO_I_Y+24) #define TETROMINO_S_Y (TETROMINO_T_Y+24) #define TETROMINO_Z_Y (TETROMINO_S_Y+24) #define TETROMINO_O_Y (TETROMINO_Z_Y+24) #define TETROMINO_J_Y (TETROMINO_O_Y+24) #define TETROMINO_LENGTH (4) // Tetromino total position //#define PIECES_X (418) //#define PIECES_Y (221) //#define PIECES_LENGTH (6) #define PIECES_X (274) #define PIECES_Y (TETROMINO_J_Y+24) #define PIECES_LENGTH (5) // Size of number #define NUMBER_WIDTH (7) #define NUMBER_HEIGHT (9) // Use 32 bits per pixel //#define SCREEN_BIT_DEPTH (32) #define SCREEN_BIT_DEPTH (8) // Use video hardware and double buffering //#define SCREEN_VIDEO_MODE (SDL_HWSURFACE | SDL_DOUBLEBUF) #define SCREEN_VIDEO_MODE (SDL_SWSURFACE|SDL_FULLSCREEN|SDL_HWPALETTE) //SpiroH // Delayed autoshift initial delay #define DAS_DELAY_TIMER (200) // Delayed autoshift timer for left and right moves #define DAS_MOVE_TIMER (40) // Here we define the platform dependent data structure struct tagStcPlatform { SDL_Surface* screen; SDL_Surface* bmpTiles; SDL_Surface* bmpBack; SDL_Surface* bmpNumbers; // For delayed autoshift: http://tetris.wikia.com/wiki/DAS int delayLeft; int delayRight; int lastTime; }; #endif // STC_USE_SIMPLE_SDL