#pragma once #include "ifdefs.h" #include #ifndef CONST_H #define CONST_H // Textos #define WINDOW_CAPTION "Coffee Crisis" #define TEXT_COPYRIGHT "@2020,2021 JAILDESIGNER (V1.4)" // Recursos #define BINFILE_SCORE 0 #define BINFILE_DEMO 1 #define BINFILE_CONFIG 2 #define TOTAL_BINFILE 3 #define MUSIC_INTRO 0 #define MUSIC_PLAYING 1 #define MUSIC_TITLE 2 #define TOTAL_MUSIC 3 #define SOUND_BALLOON 0 #define SOUND_BUBBLE1 1 #define SOUND_BUBBLE2 2 #define SOUND_BUBBLE3 3 #define SOUND_BUBBLE4 4 #define SOUND_BULLET 5 #define SOUND_COFFEE_OUT 6 #define SOUND_HISCORE 7 #define SOUND_ITEM_DROP 8 #define SOUND_ITEM_PICKUP 9 #define SOUND_MENU_CANCEL 10 #define SOUND_MENU_MOVE 11 #define SOUND_MENU_SELECT 12 #define SOUND_PLAYER_COLLISION 13 #define SOUND_STAGE_CHANGE 14 #define SOUND_TITLE 15 #define SOUND_CLOCK 16 #define TOTAL_SOUND 17 #define TEXTURE_BALLOON 0 #define TEXTURE_BULLET 1 #define TEXTURE_FONT_BLACK 2 #define TEXTURE_FONT_BLACK_X2 3 #define TEXTURE_FONT_NOKIA 4 #define TEXTURE_FONT_WHITE 5 #define TEXTURE_FONT_WHITE_X2 6 #define TEXTURE_GAME_BG 7 #define TEXTURE_GAME_TEXT 8 #define TEXTURE_INTRO 9 #define TEXTURE_ITEMS 10 #define TEXTURE_LOGO 11 #define TEXTURE_MENU 12 #define TEXTURE_PLAYER_BODY 13 #define TEXTURE_PLAYER_DEATH 14 #define TEXTURE_PLAYER_LEGS 15 #define TEXTURE_TITLE 16 #define TOTAL_TEXTURE 17 // Tamaño de bloque #define BLOCK 8 #define HALF_BLOCK BLOCK / 2 // Tamaño de la pantalla real #define SCREEN_WIDTH 256 const int SCREEN_HEIGHT = SCREEN_WIDTH * 3 / 4; // Tamaño de la pantalla que se muestra const int VIEW_WIDTH = SCREEN_WIDTH * 3; const int VIEW_HEIGHT = SCREEN_HEIGHT * 3; // Cantidad de enteros a escribir en los ficheros de datos #define TOTAL_SCORE_DATA 3 #define TOTAL_DEMO_DATA 2000 // Zona de juego const int PLAY_AREA_TOP = (0 * BLOCK); const int PLAY_AREA_BOTTOM = SCREEN_HEIGHT - (4 * BLOCK); const int PLAY_AREA_LEFT = (0 * BLOCK); const int PLAY_AREA_RIGHT = SCREEN_WIDTH - (0 * BLOCK); const int PLAY_AREA_WIDTH = PLAY_AREA_RIGHT - PLAY_AREA_LEFT; const int PLAY_AREA_HEIGHT = PLAY_AREA_BOTTOM - PLAY_AREA_TOP; const int PLAY_AREA_CENTER_X = PLAY_AREA_LEFT + (PLAY_AREA_WIDTH / 2); const int PLAY_AREA_CENTER_FIRST_QUARTER_X = (PLAY_AREA_WIDTH / 4); const int PLAY_AREA_CENTER_THIRD_QUARTER_X = (PLAY_AREA_WIDTH / 4) * 3; const int PLAY_AREA_CENTER_Y = PLAY_AREA_TOP + (PLAY_AREA_HEIGHT / 2); const int PLAY_AREA_FIRST_QUARTER_Y = PLAY_AREA_HEIGHT / 4; const int PLAY_AREA_THIRD_QUARTER_Y = (PLAY_AREA_HEIGHT / 4) * 3; // Anclajes de pantalla const int SCREEN_CENTER_X = SCREEN_WIDTH / 2; const int SCREEN_FIRST_QUARTER_X = SCREEN_WIDTH / 4; const int SCREEN_THIRD_QUARTER_X = (SCREEN_WIDTH / 4) * 3; const int SCREEN_CENTER_Y = SCREEN_HEIGHT / 2; const int SCREEN_FIRST_QUARTER_Y = SCREEN_HEIGHT / 4; const int SCREEN_THIRD_QUARTER_Y = (SCREEN_HEIGHT / 4) * 3; // Opciones de menu #define MENU_NO_OPTION -1 #define MENU_OPTION_START 0 #define MENU_OPTION_QUIT 1 #define MENU_OPTION_TOTAL 2 // Tipos de fondos para el menu #define MENU_BACKGROUND_TRANSPARENT 0 #define MENU_BACKGROUND_SOLID 1 // Estados del jugador #define PLAYER_STATUS_WALKING_LEFT 0 #define PLAYER_STATUS_WALKING_RIGHT 1 #define PLAYER_STATUS_WALKING_STOP 2 #define PLAYER_STATUS_FIRING_UP 0 #define PLAYER_STATUS_FIRING_LEFT 1 #define PLAYER_STATUS_FIRING_RIGHT 2 #define PLAYER_STATUS_FIRING_NO 3 #define PLAYER_ANIMATION_LEGS_WALKING_LEFT 0 #define PLAYER_ANIMATION_LEGS_WALKING_RIGHT 1 #define PLAYER_ANIMATION_LEGS_WALKING_STOP 2 #define PLAYER_ANIMATION_BODY_WALKING_LEFT 0 #define PLAYER_ANIMATION_BODY_FIRING_LEFT 1 #define PLAYER_ANIMATION_BODY_WALKING_RIGHT 2 #define PLAYER_ANIMATION_BODY_FIRING_RIGHT 3 #define PLAYER_ANIMATION_BODY_WALKING_STOP 4 #define PLAYER_ANIMATION_BODY_FIRING_UP 5 // Variables del jugador #define PLAYER_INVULNERABLE_COUNTER 200 // Secciones del programa #define PROG_SECTION_LOGO 0 #define PROG_SECTION_INTRO 1 #define PROG_SECTION_TITLE 2 #define PROG_SECTION_GAME 3 // Secciones del juego #define GAME_SECTION_PLAY 0 #define GAME_SECTION_PAUSE 1 #define GAME_SECTION_GAMEOVER 2 // Secciones del titulo #define TITLE_SECTION_1 0 #define TITLE_SECTION_2 1 #define TITLE_SECTION_3 2 #define TITLE_SECTION_INSTRUCTIONS 3 // Estados de cada elemento que pertenece a un evento #define EVENT_WAITING 1 #define EVENT_RUNNING 2 #define EVENT_COMPLETED 3 // Cantidad de eventos de la intro #define INTRO_TOTAL_BITMAPS 6 #define INTRO_TOTAL_TEXTS 9 const int INTRO_TOTAL_EVENTS = INTRO_TOTAL_BITMAPS + INTRO_TOTAL_TEXTS; // Cantidad de eventos de la pantalla de titulo #define TITLE_TOTAL_EVENTS 2 // Relaciones de Id con nomnbres #define BITMAP0 0 #define BITMAP1 1 #define BITMAP2 2 #define BITMAP3 3 #define BITMAP4 4 #define BITMAP5 5 #define TEXT0 6 #define TEXT1 7 #define TEXT2 8 #define TEXT3 9 #define TEXT4 10 #define TEXT5 11 #define TEXT6 12 #define TEXT7 13 #define TEXT8 14 // Anclajes para el marcador de puntos const int SCORE_WORD_X = (SCREEN_WIDTH / 4) - ((5 * BLOCK) / 2); const int SCORE_WORD_Y = SCREEN_HEIGHT - (3 * BLOCK) + 2; const int SCORE_NUMBER_X = (SCREEN_WIDTH / 4) - ((6 * BLOCK) / 2); const int SCORE_NUMBER_Y = SCREEN_HEIGHT - (2 * BLOCK) + 2; const int HISCORE_WORD_X = ((SCREEN_WIDTH / 4) * 3) - ((8 * BLOCK) / 2); const int HISCORE_WORD_Y = SCREEN_HEIGHT - (3 * BLOCK) + 2; const int HISCORE_NUMBER_X = ((SCREEN_WIDTH / 4) * 3) - ((6 * BLOCK) / 2); const int HISCORE_NUMBER_Y = SCREEN_HEIGHT - (2 * BLOCK) + 2; const int MULTIPLIER_WORD_X = (SCREEN_WIDTH / 2) - ((4 * BLOCK) / 2); const int MULTIPLIER_WORD_Y = SCREEN_HEIGHT - (3 * BLOCK) + 2; const int MULTIPLIER_NUMBER_X = (SCREEN_WIDTH / 2) - ((3 * BLOCK) / 2); const int MULTIPLIER_NUMBER_Y = SCREEN_HEIGHT - (2 * BLOCK) + 2; // Ningun tipo #define NO_KIND 0 // Tipos de globo #define BALLOON_1 1 #define BALLOON_2 2 #define BALLOON_3 3 #define BALLOON_4 4 #define HEXAGON_1 5 #define HEXAGON_2 6 #define HEXAGON_3 7 #define HEXAGON_4 8 #define POWER_BALL 9 // Clases de globo #define BALLOON_CLASS 0 #define HEXAGON_CLASS 1 // Velocidad del globo #define BALLOON_VELX_POSITIVE 0.7f #define BALLOON_VELX_NEGATIVE -0.7f // Indice para las animaciones de los globos #define BALLOON_MOVING_ANIMATION 0 #define BALLOON_POP_ANIMATION 1 #define BALLOON_BORN_ANIMATION 2 // Cantidad posible de globos #define MAX_BALLOONS 100 // Velocidades a las que se mueven los enemigos #define BALLOON_SPEED_1 0.60f #define BALLOON_SPEED_2 0.70f #define BALLOON_SPEED_3 0.80f #define BALLOON_SPEED_4 0.90f #define BALLOON_SPEED_5 1.00f // Tamaño de los globos #define BALLOON_SIZE_1 8 #define BALLOON_SIZE_2 13 #define BALLOON_SIZE_3 21 #define BALLOON_SIZE_4 37 // Tipos de bala #define BULLET_UP 1 #define BULLET_LEFT 2 #define BULLET_RIGHT 3 // Cantidad posible de globos #define MAX_BULLETS 50 // Tipos de objetos #define ITEM_POINTS_1_DISK 1 #define ITEM_POINTS_2_GAVINA 2 #define ITEM_POINTS_3_PACMAR 3 #define ITEM_CLOCK 4 #define ITEM_TNT 5 #define ITEM_COFFEE 6 #define ITEM_POWER_BALL 7 // Cantidad de objetos simultaneos #define MAX_ITEMS 5 // Valores para las variables asociadas a los objetos #define REMAINING_EXPLOSIONS 3 #define REMAINING_EXPLOSIONS_COUNTER 50 #define TIME_STOPPED_COUNTER 300 // Estados de entrada #define NO_INPUT 0 #define INPUT_UP 1 #define INPUT_DOWN 2 #define INPUT_LEFT 3 #define INPUT_RIGHT 4 #define INPUT_ACCEPT 5 #define INPUT_CANCEL 6 #define INPUT_FIRE_UP 7 #define INPUT_FIRE_LEFT 8 #define INPUT_FIRE_RIGHT 9 #define INPUT_PAUSE 10 // Zona muerta del mando analógico #define JOYSTICK_DEAD_ZONE 8000 // Tipos de mensajes para el retorno de las funciones #define MSG_OK 0 #define MSG_BULLET_OUT 1 // Tipos de texto #define TEXT_FIXED 0 #define TEXT_VARIABLE 1 // Cantidad de elementos del vector de SmartSprites #define MAX_SMART_SPRITES 10 // Cantidad máxima de gotas de café #define MAX_COFFEE_DROPS 100 // Contadores #define TITLE_COUNTER 800 #define STAGE_COUNTER 200 #define INSTRUCTIONS_COUNTER 600 #define DEATH_COUNTER 350 #define SHAKE_COUNTER 10 #endif