Game For ECE 2035
Dependencies: mbed wave_player 4DGL-uLCD-SE MMA8452
Diff: spells.cpp
- Revision:
- 6:c9695079521d
- Child:
- 7:862062ffca62
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/spells.cpp Fri Nov 19 22:03:25 2021 +0000 @@ -0,0 +1,53 @@ +#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; + } + + +}