![](/media/cache/profiles/fa1fc368935a59b748bec5e15aca97ea.jpg.50x50_q85.png)
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
Constants.h
- Committer:
- Oshyrath
- Date:
- 2017-11-17
- Revision:
- 1:527a11035e0b
- Parent:
- 0:c9afe145b57b
File content as of revision 1:527a11035e0b:
#ifndef __CONSTS #define __CONSTS //LCD SIZE #define LCD_WIDTH 240 #define LCD_HEIGHT 320 //ENEMY #define ENEMY_WIDTH 20 #define ENEMY_HEIGHT 30 #define FREEZE_TIME 40 #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 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