-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMain.cpp
More file actions
76 lines (66 loc) · 2.74 KB
/
Copy pathMain.cpp
File metadata and controls
76 lines (66 loc) · 2.74 KB
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
64
65
66
67
68
69
70
71
72
73
74
75
76
#include <SFML/Graphics.hpp>
#include <vector>
#include "Player.h"
#include "VideoStudio.h"
#include "Textures.h"
#include <ctime>
#include <list>
using namespace sf;
const int objCount = 11;
const int countOfHimers = 4;
float getPosition(int i, int count)
{
float delta = (End.x - Begin.x -200) / count;
float result = Begin.x + 200 + delta*i + delta* float(rand()) / float(RAND_MAX);
return result;
}
float Track(float Track)
{
return 4.0 + Track;
}
int main()
{
Begin = { -30000, 10000 };
End = { 30000, 0 };
Camera camera(0, 0, VideoMode(1920, 1080), "Dark Souls", Style::Fullscreen);
bool isRepeat = false;
do
{ srand(time(0));
new Moon(-90000, 100, Track(26));
new Decor(-9000, 45000, Track(16), Mountain);
new Hills(0, 1000, Track(4));
for (int i = 0; i < 2; i++) new Decor(getPosition(i, 2), 1950, Track(3.5), THouse4);
for (int i = 0; i < 3; i++) new Decor(getPosition(i, 3), 1700, Track(3.2), THouse3);
new Dragon(End.x + 1000, 5000, Track(4));
for (int i = 0; i < 4; i++) new Decor(getPosition(i, 4), 1550, Track(3.1), THouse2);
for (int i = 0; i < 5; i++) new Decor(getPosition(i, 5), 1000, Track(2.9), THouse1);
new Forest(0, 100, Track(1));
new Road(0, 0, Track(0));
new Decor(End.x + 1500, 250, Track(0.5), TDeleganse2);
DlgBox* DlgWelcome = new DlgBox(TMap, camera.getSize().x / 2, camera.getSize().y - 150, 0);
DlgBox* DlgWin = new DlgBox(TWin, camera.getSize().x / 2, camera.getSize().y , 0);
DlgBox* DlgLose = new DlgBox(TLose, camera.getSize().x / 2, camera.getSize().y - 200, 0);
new Samurai(0, 100, Track(0));
(new Samurai(0, 100, Track(0)))->SetDirection(-1);
(new Mage(0, 500, Track(0)))->SetDirection(-1);
for (int i = 0; i < 2; i++) new Samurai2(getPosition(i, 2), 25, Track(0));
new Boss(End.x - 1000, 90, Track(0));
new Decor(Begin.x - 1500, 70, Track(0), TDeleganse);
new Decor(End.x + 600, 90, Track(0), TBonefire, 5, 5, 0, 0.2);
Player* player = new Player(Begin.x, 90, Track(0));
camera.SetCadr(player->Locate.x, player->Locate.y);
new Decor(Begin.x - 400, 90, Track(0), TBonefire, 5, 5, 0, 0.2);
player->TurnTo(new Wifi(Begin.x - 800, 90, Track(0)));
for (int i = 0; i < countOfHimers-1; i++) new Himera(getPosition(i, countOfHimers-1), 10, Track(0));
for (int i = 0; i < countOfHimers+1; i++) new Himera2(getPosition(i, countOfHimers+1), 10, Track(0));
for (int i = 0; i < 3; i++) new Bonefire(getPosition(i, 3), 25, Track(0));
new LiveBar(210, 60, 0);
Message Buff;
Event event;
MsgBox(DlgWelcome, &camera);
if (player->Run(&camera) == rs_OK) isRepeat = (MsgBox(DlgWin, &camera) == rs_OK);
else isRepeat = (MsgBox(DlgLose, &camera) == rs_OK);
characters.clear();
Messager::clear();
} while (isRepeat);
}