-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.cpp
More file actions
107 lines (95 loc) · 2.33 KB
/
script.cpp
File metadata and controls
107 lines (95 loc) · 2.33 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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
#include "script.h"
using namespace std;
using namespace sf;
Script::Script(short const id):
id(id),
finished(false),
currentLevel(1)
{
timer.start();
}
/*
*****************************************************************
Liste des ennemis disponibles :
- ship
- flyingSaucer
Liste des boss :
-Lily
*****************************************************************
*/
void Script::Run()
{
cout << m_launchLevel << endl;
switch(m_launchLevel)
{
case 1:
{
niveau1();
break;
}
case 2:
{
niveau2();
break;
}
}
}
void Script::niveau1()
{
int i(0);
while(i < 5)
{
finished = false;
currentLevel = 1;
//Variables enemy :
Vector2f positionEnemy(50, 150);
/*
Population::getInstance()->createShip(positionEnemy, "roundtrip",true);
positionEnemy.x +=100;
m_population.createShip(positionEnemy, "roundtrip");
positionEnemy.x +=100;
m_population.createShip(positionEnemy, "roundtrip");
positionEnemy.x +=100;
m_population.createFlyingSaucer(positionEnemy, "roundtrip");
positionEnemy.x +=100;
m_population.createShip(positionEnemy, "roundtrip");
positionEnemy.x +=100;
m_population.createShip(positionEnemy, "roundtrip");
positionEnemy.x +=100;
//population.createFlyingSaucer(positionEnemy, player, m_imageManager);
positionEnemy.x +=100;
m_population.createShip(positionEnemy, "roundtrip");
positionEnemy.x +=100;
//population.createFlyingSaucer(positionEnemy, player, m_imageManager);
m_population.createBoss(positionEnemy, "roundtrip", "lily");*/
timer.sleep(10000);
i++;
}
finished = true;
timer.sleep(1000);
}
void Script::niveau2()
{
finished = false;
currentLevel = 1;
//Variables enemy :
Vector2f positionEnemy(500, 300);
// Population::getInstance()->createShip(positionEnemy, "Down",true);
timer.sleep(10000);
finished = true;
}
bool Script::isFinished()
{
if(finished)
return true;
else
return false;
}
short Script::nextLevel()
{
return currentLevel + 1;
}
void Script::setLaunchLevel(short launchLevel)
{
m_launchLevel = launchLevel;
}