Game For ECE 2035
Dependencies: mbed wave_player 4DGL-uLCD-SE MMA8452
spells.cpp
- Committer:
- nasiromar
- Date:
- 2021-11-19
- Revision:
- 6:c9695079521d
- Child:
- 7:862062ffca62
File content as of revision 6:c9695079521d:
#include "spells.h" #include "speech.h" #include "globals.h" #include "hardware.h" #define FIRE 0 #define WATER 1 #define AIR 2 #define EARTH 3 void init_spells() { char line1[] = "Water"; char line2[] = "Fire"; char line3[] = "Earth"; vertical_speech(line1,line2,line3); } int spell() { int spell_used; GameInputs inputs = read_inputs(); if (!inputs.b1) { erase_vertical_speech_bubble(); char line1[] = "You Cast:"; char line2[] = "Earth"; horizontal_speech2(line1,line2); return spell_used = EARTH; } if (!inputs.b2) { erase_vertical_speech_bubble(); char line1[] = "You Cast:"; char line2[] = "Fire"; horizontal_speech2(line1,line2); return spell_used = AIR; } if (!inputs.b3) { erase_vertical_speech_bubble(); char line1[] = "You Cast:"; char line2[] = "Water"; horizontal_speech2(line1,line2); return spell_used = WATER; } }