This repository has been archived by the owner on Nov 12, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Screens.cpp
58 lines (48 loc) · 1.47 KB
/
Screens.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#include <iostream>
#include <stdio.h>
#include "Declaration.h"
#include "GraphicAPI.h"
#include "Sound.h"
#include "Screens.h"
using namespace std;
//extern bool gameOver;
void mainMenu()
{
// initGraphic();
playSound(SOUND_START_SCREEN, 1);
int logoX = 250;
int logoY = 50;
int order = 1;
settextjustify(LEFT_TEXT, BOTTOM_TEXT);
settextstyle(BOLD_FONT, HORIZ_DIR, 2);
outtextxy(10,H-13, TEXT_COPYRIGHT);
outtextxy(W-400,H-13, TEXT_MAJOR);
settextstyle(BOLD_FONT, HORIZ_DIR, 3);
outtextxy(470,500, TEXT_PRESSKEY);
while ( !kbhit() ) //PRESS KEY TO CONTINUE
{
if (order%4+1 == 1)
readimagefile(IMG_SNAKE1, logoX, logoY, logoX + 312*2.5, logoY + 65*2.5);
if (order%4+1 == 2)
readimagefile(IMG_SNAKE2, logoX, logoY, logoX + 312*2.5, logoY + 65*2.5);
if (order%4+1 == 3)
readimagefile(IMG_SNAKE3, logoX, logoY, logoX + 312*2.5, logoY + 65*2.5);
if (order%4+1 == 4)
readimagefile(IMG_SNAKE4, logoX, logoY, logoX + 312*2.5, logoY + 65*2.5);
order++;
Sleep(700);
}
}
//------------------------------
void gameOverScreen()
{
//fflush(stdin);
cleardevice(); //clear the screen
int logoX=400;
int logoY=50;
readimagefile(IMG_GAMEOVER, logoX, logoY, logoX + 176*2.5, logoY + 85*2.5);
settextstyle(BOLD_FONT, HORIZ_DIR, 3);
outtextxy(620,500, TEXT_PRESSKEY);
playSound(SOUND_GAMEOVER, 1);
getch(); //wait key pressed
}