Game For ECE 2035
Dependencies: mbed wave_player 4DGL-uLCD-SE MMA8452
spells.cpp
- Committer:
- nasiromar
- Date:
- 2021-12-03
- Revision:
- 14:7225da81314a
- Parent:
- 7:862062ffca62
File content as of revision 14:7225da81314a:
#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_speech1(line1,line2,line3); } void init_store(){ char line1[] = "Pot$4"; char line2[] = "Elx$5"; char line3[] = "Frt$2"; vertical_speech2(line1,line2,line3); } int spell_used; int spell() { GameInputs inputs = read_inputs(); if (!inputs.b1 ) { erase_vertical_speech_bubble(); char line1[] = "You Cast:"; char line2[] = "Earth"; horizontal_speech2(line1,line2); spell_used = EARTH; } if (!inputs.b2 ) { erase_vertical_speech_bubble(); char line1[] = "You Cast:"; char line2[] = "Fire"; horizontal_speech2(line1,line2); spell_used = FIRE; } if (!inputs.b3 ) { erase_vertical_speech_bubble(); char line1[] = "You Cast:"; char line2[] = "Water"; horizontal_speech2(line1,line2); spell_used = WATER; } return spell_used; } int dinero; int store() { GameInputs inputs = read_inputs(); if (!inputs.b1 ) { erase_vertical_speech_bubble(); char line1[] = "You Chose:"; char line2[] = "Fruit"; horizontal_speech2(line1,line2); dinero = FRT; } if (!inputs.b2 ) { erase_vertical_speech_bubble(); char line1[] = "You Chose:"; char line2[] = "Elixer"; horizontal_speech2(line1,line2); dinero = ELX; } if (!inputs.b3) { erase_vertical_speech_bubble(); char line1[] = "You Chose:"; char line2[] = "Potion"; horizontal_speech2(line1,line2); dinero = POT; } return dinero; }