106 lines
2.8 KiB
C
106 lines
2.8 KiB
C
#pragma once
|
|
|
|
#ifndef CONST_H
|
|
#define CONST_H
|
|
|
|
//Tamaño de bloque
|
|
const int BLOCK = 8;
|
|
|
|
//Tamaño de la pantalla real
|
|
const int 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;
|
|
|
|
//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;
|
|
|
|
//Color transparente para los sprites
|
|
const int COLOR_KEY_R = 0xff;
|
|
const int COLOR_KEY_G = 0x00;
|
|
const int COLOR_KEY_B = 0xff;
|
|
|
|
//Opciones de menu
|
|
const int MENU_NO_OPTION = -1;
|
|
const int MENU_OPTION_START = 0;
|
|
const int MENU_OPTION_QUIT = 1;
|
|
const int MENU_OPTION_TOTAL = 2;
|
|
|
|
//Selector de menu
|
|
const int MENU_SELECTOR_BLACK = (BLOCK * 0);
|
|
const int MENU_SELECTOR_WHITE = (BLOCK * 1);
|
|
|
|
//Tipos de fondos para el menu
|
|
const int MENU_BACKGROUND_TRANSPARENT = 0;
|
|
const int MENU_BACKGROUND_SOLID = 1;
|
|
|
|
//Estados del jugador
|
|
const int PLAYER_STATE_STOPPED = 0;
|
|
const int PLAYER_STATE_WALKING_LEFT = 1;
|
|
const int PLAYER_STATE_WALKING_RIGHT = 2;
|
|
const int PLAYER_STATE_TOTAL = 3;
|
|
|
|
//Estados del juego
|
|
const int GAME_STATE_TITLE = 0;
|
|
const int GAME_STATE_PLAYING = 1;
|
|
const int GAME_STATE_PAUSED = 2;
|
|
const int GAME_STATE_QUIT = 3;
|
|
const int GAME_STATE_TOTAL = 4;
|
|
|
|
//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) + 4;
|
|
const int SCORE_NUMBER_X = (SCREEN_WIDTH / 4) - (3 * BLOCK);
|
|
const int SCORE_NUMBER_Y = SCREEN_HEIGHT - (2 * BLOCK) + 4;
|
|
const int HISCORE_WORD_X = ((SCREEN_WIDTH / 4) * 3) - ((8 * BLOCK) / 2);
|
|
const int HISCORE_WORD_Y = SCREEN_HEIGHT - (3 * BLOCK) + 4;
|
|
const int HISCORE_NUMBER_X = ((SCREEN_WIDTH / 4) * 3) - (3 * BLOCK);
|
|
const int HISCORE_NUMBER_Y = SCREEN_HEIGHT - (2 * BLOCK) + 4;
|
|
|
|
//Ningun tipo
|
|
const int NO_KIND = 0;
|
|
|
|
//Tipos de globo
|
|
const int BALLOON_1 = 1;
|
|
const int BALLOON_2 = 2;
|
|
const int BALLOON_3 = 3;
|
|
const int BALLOON_4 = 4;
|
|
|
|
//Velocidad del globo
|
|
const float BALLON_VELX_POSITIVE = 0.7;
|
|
const float BALLON_VELX_NEGATIVE = -0.7;
|
|
|
|
//Tipos de bala
|
|
const int BULLET_UP = 1;
|
|
const int BULLET_LEFT = 2;
|
|
const int BULLET_RIGHT = 3;
|
|
|
|
//Estados de entrada
|
|
const int NO_INPUT = 0;
|
|
const int INPUT_UP = 1;
|
|
const int INPUT_DOWN = 2;
|
|
const int INPUT_LEFT = 3;
|
|
const int INPUT_RIGHT = 4;
|
|
const int INPUT_FIRE = 5;
|
|
|
|
//Zona muerta del mando analógico
|
|
const int JOYSTICK_DEAD_ZONE = 8000;
|
|
|
|
//Mapeo de bottones (8bitdo)
|
|
const int BUTTON_A = 0;
|
|
const int BUTTON_B = 1;
|
|
const int BUTTON_X = 3;
|
|
const int BUTTON_Y = 4;
|
|
const int BUTTON_SELECT = 10;
|
|
const int BUTTON_START = 11;
|
|
const int BUTTON_L = 6;
|
|
const int BUTTON_R = 7;
|
|
|
|
#endif |