This code contains the game Starship designed for the STM32F429i-DISC1 board. It requires a keyboard to play.
Dependencies: Starship LCD_DISCO_F429ZI USBHost mbed
Diff: Constants.h
- Revision:
- 1:527a11035e0b
- Parent:
- 0:c9afe145b57b
diff -r c9afe145b57b -r 527a11035e0b Constants.h --- a/Constants.h Sun Sep 17 17:05:27 2017 +0000 +++ b/Constants.h Fri Nov 17 02:23:33 2017 +0000 @@ -1,23 +1,62 @@ #ifndef __CONSTS #define __CONSTS -//LCD Size -#define LCD_WIDTH 272 -#define LCD_HEIGHT 480 +//LCD SIZE +#define LCD_WIDTH 240 +#define LCD_HEIGHT 320 //ENEMY -#define ENEMY_WIDTH 4 -#define ENEMY_HEIGHT 4 +#define ENEMY_WIDTH 20 +#define ENEMY_HEIGHT 30 #define FREEZE_TIME 40 -#define ENEMY_BULLET_WAIT_TIME 10 -#define X_ID 0 -#define Y_ID 1//DON'T delete +#define ENEMY_BULLET_WAIT_TIME 40 +#define X_ID 1 +#define Y_ID 0//DON'T delete +#define SLOWEST_ENEMY_X_VELOCITY 1 +#define SLOWEST_ENEMY_Y_VELOCITY 1 //BULLET #define BULLET_SIZE 4 #define DEFAULT_BULLET_SPEED 10 +//#define SPEED_FIRE_BULLET_SPEED (2*DEFAULT_BULLET_SPEED) +#define POWER_BULLET_ID 1 +#define DEFAULT_BULLET_ID 0 +#define BOMB_BULLET_ID 1 +#define NOT_BOMB_ID 0 +#define NORMAL_BULLET_DAMAGE 1 +#define POWER_BULLET_DAMAGE 4 +#define WIDE_SHOT_X_VELOCITY_FACTOR 0.25 //Fraction of Bullet Speed. +#define NUMBER_OF_BULLETS_PER_EXPLOSION 12 //PLAYER +#define DEFAULT_POWERUP_TIME 140 #define PLAYER_WIDTH ENEMY_WIDTH #define PLAYER_HEIGHT ENEMY_HEIGHT -#define PLAYER_VELOCITY 10 -#define SHIELD_TIME -#define RAPID_FIRE_TIME -#define WIDE_SHOT_TIME +#define PLAYER_VELOCITY 11 +#define PLAYER_FIRE_PERIOD 4 +#define SHIELD_TIME 50 +#define RAPID_FIRE_TIME 30 +#define RFT_PERIOD 0 +#define WIDE_SHOT_TIME DEFAULT_POWERUP_TIME +#define POWER_SHOT_TIME DEFAULT_POWERUP_TIME +#define LEFT_DIR -1 +#define RIGHT_DIR 1 +#define UP_DIR -1 +#define DOWN_DIR 1 +#define NO_DIR 0 +#define PLAYER_STARTING_HEALTH 10 +//POWER UP +#define POWER_UP_SIZE 20 +#define PROPABILITY_DROP_POWERUP 0.5 +#define POWER_UP_EXPERATION_TIME 110 +#define NUMBER_OF_POWER_UPS_TYPES 7 +//KEYS +#define KEY_UP 82 +#define KEY_DOWN 81 +#define KEY_LEFT 80 +#define KEY_RIGHT 79 +#define KEY_FIRE 2 +#define KEY_START 40 +#define KEY_PAUSE 40 +//OTHER +#define PI 3.14159265359 +#define STARTING_LIFE_TOTAL 5 +#define GAME_WAIT_TIME 0.05 +#define HEALTH_BAR_SIZE 4 #endif \ No newline at end of file