This repository was archived by the owner on Feb 16, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathGameEngine.cpp
63 lines (61 loc) · 1.54 KB
/
GameEngine.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
59
60
61
62
63
#include <SDL2/SDL_image.h>
#include <SDL2/SDL_ttf.h>
#include <SDL2/SDL_mixer.h>
#include <SDL2/SDL.h>
#include <fstream>
#include <sstream>
#include <cstdlib>
#include <ctime>
#include <string>
#include <stdio.h>
#include <iostream>
#include <vector>
#include <algorithm>
#include <fstream>
#include <bits/stdc++.h>
using namespace std;
void reset_game(bool ifrun);
bool ifback = false;
bool ifend = false;
#include "headers/Object.h"
SDL_Window* win =NULL;
SDL_Texture* tex=NULL;
int status = 0;
Mix_Music *music=NULL;
SDL_Event e;
int mousex,mousey;
string playername;
TTF_Font* font=NULL;
int playerscore;
bool windowloop = true;
#include "audiomanager.cpp"
#include "about.cpp"
#include "highscore.cpp"
#include "firstmenu.cpp"
#include "settingsmenu.cpp"
#include "game.cpp"
#include "lastmenu.cpp"
#include "scoreboard.cpp"
int main(int argc, char const *argv[]) {
srand(time(NULL));
SDL_Init(SDL_INIT_EVERYTHING);
TTF_Init();
File_Init();
Music_Init();
win = SDL_CreateWindow("Ballz", SDL_WINDOWPOS_CENTERED,SDL_WINDOWPOS_CENTERED,350,600,0);
startaudio();
TTF_CloseFont(font);
TTF_Quit();
while(windowloop) {
switch(status) {
case 0: firstmenu(); break;
case 1: settingsmenu(); break;
case 2: game(); break;
case 3: lastmenu(); break;
case 4: about_us(); break;
case 5: scoreboard(); break;
default: SDL_Quit();
}
}
return 0;
}