Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed wave_player 4DGL-uLCD-SE MMA8452
spells.cpp
- Committer:
- nasiromar
- Date:
- 2021-11-20
- Revision:
- 7:862062ffca62
- Parent:
- 6:c9695079521d
- Child:
- 14:7225da81314a
File content as of revision 7:862062ffca62:
#include "spells.h"
#include "speech.h"
#include "globals.h"
#include "hardware.h"
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;
}
}