Skip to content

Commit 1972d0c

Browse files
committed
Simon:
-Tutorial and thanks finished -Project Completed!!!!
1 parent c594dd0 commit 1972d0c

File tree

3 files changed

+59
-5
lines changed

3 files changed

+59
-5
lines changed

Simon/simon.c

Lines changed: 53 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,29 @@ void Error(const char* text)
147147
exit(0);
148148
}
149149

150+
void thanks()
151+
{
152+
clearScreenToTop();
153+
moveTo(0, 0);
154+
puts("Thanks for Playing!");
155+
puts("");
156+
puts("Thanks to:");
157+
puts("Brodhead Media Features for the Wrong Buzzer SFX (https://youtu.be/2naim9F4010)");
158+
puts("gamesplusjames for the button sounds that he used in his simon");
159+
puts("Stackoverflow people, mainly Ahmad Taha whose question was my solution");
160+
puts("Tomasz P. Szynalski and his Online Tone Generator for helping me to organze the sounds");
161+
puts("The neat things that this program uses works because of them!");
162+
puts("");
163+
puts("Also, thanks to Super Mario Maker streamers on twitch, coded everything hearing you");
164+
puts("");
165+
puts("The make of this project has the participation of:");
166+
puts("BASS Audio Library, with wich this can play sound");
167+
puts("Audacity, that was used to cut the audio");
168+
puts("Visual Studio Community 2019, in wich this project was made on.");
169+
puts("");
170+
puts("---Press any key to exit---");
171+
}
172+
150173
int main(int argc, char** argv)
151174
{
152175

@@ -180,14 +203,38 @@ int main(int argc, char** argv)
180203
blue_button = BASS_StreamCreateFile(FALSE, "blue_button.wav", 0, 0, 0);
181204
wrong = BASS_StreamCreateFile(FALSE, "wrong.wav", 0, 0, 0);
182205

183-
//BASS_Free();
184-
185206
printf("Starting Simon. Do you wish to:\n(P) play now\nor \n(T)see the tutorial?\n");
186207
fgets(trashcan, 5, stdin);
187208

188209
if (trashcan[0] == 'T' || trashcan[0] == 't')
189210
{
190-
//teach how to play
211+
clearScreenToTop();
212+
moveTo(0, 0);
213+
puts("Simon rules:");
214+
puts("-The board will flash colors on screen, in certain order");
215+
puts("-You repeat the pattern clicking on the same colors");
216+
puts("-If you get every color right, you go to the next level");
217+
puts("-Each level increases by one the number of colors to repeat");
218+
puts("-If you miss one, the game ends");
219+
puts("-Also, the color have sounds, use this to your advantage");
220+
puts("-Your failure also has a sound, don't be scared");
221+
puts("-Here you can go until the level 3999, good luck");
222+
puts("");
223+
puts("-Ready to start?");
224+
for (int count = 0; count < 15; count++)
225+
{
226+
delay(250);
227+
puts("---Press enter to continue---");
228+
moveUp(1);
229+
delay(250);
230+
puts(" ");
231+
moveUp(1);
232+
}
233+
puts("---Press enter to continue---");
234+
fgets(trashcan, 5, stdin);
235+
trashcan[0] = 'P';
236+
clearScreenToTop();
237+
moveTo(0, 0);
191238
}
192239

193240
if (trashcan[0] == 'P' || trashcan[0] == 'p')
@@ -252,6 +299,9 @@ int main(int argc, char** argv)
252299
}
253300
}
254301
}
302+
BASS_Free();
303+
thanks();
304+
fgets(trashcan, 5, stdin);
255305

256306
return 0;
257307
}

Simon/windowsConsoleInteraction.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,8 @@ VOID KeyEventProc(KEY_EVENT_RECORD ker)
9696
else printf("key released\n");*/
9797

9898
retEvent.regEvent = _KEY_EVENT;
99-
retEvent.event.keyPress = ker.uChar.AsciiChar;
99+
retEvent.event.keyPressed = ker.bKeyDown;
100+
retEvent.event.keyPressed = ker.uChar.AsciiChar;
100101
}
101102
VOID MouseEventProc(MOUSE_EVENT_RECORD mer)
102103
{

Simon/windowsConsoleInteraction.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,10 @@ typedef enum event {
1212
typedef struct Interaction_Event_t {
1313
eventType regEvent;
1414
union eventContent {
15-
char keyPress;
15+
struct keyPress {
16+
BOOL keyDown;
17+
char keyPressed;
18+
};
1619
struct mouse {
1720
int mouseEvent;
1821
COORD mouseCoord;

0 commit comments

Comments
 (0)