-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwave.cpp
61 lines (60 loc) · 2.45 KB
/
wave.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
#include "wave.h"
#include "enemiesfactory.h"
#include<cmath>
Wave::Wave(Type type){
int j = 5;
if(type == Type::Easy){
j = 15;
}
if(type == Type::Middle){
j = 7;
}
if(type == Type::Hard){
j = 8;
}
if(type == Type::SuperHard){
j = 10;
}
for(int i =0; i<j; i++){
std::shared_ptr<Enemy> enemy (EnemiesFactory::newFly(QPoint(0,0) - 40*i*QPoint(1,1),15));
enemy->addRoute(Route::Path::Line,QPoint(400,600) + 40*i*QPoint(1,1));
enemies.push_back(enemy);
}
for(int i =0; i<j; i++){
std::shared_ptr<Enemy> enemy (EnemiesFactory::newWasp(QPoint(-150,-150)+ 40*i*QPoint(-1,-1),5+j));
enemy->addRoute(Route::Path::Line,QPoint(300,400));
enemy->addRoute(Route::Path::HalfCircleRightLeft);
enemy->addRoute(Route::Path::Sin,QPoint(600,400) + 40*i*QPoint(-1,-1));
enemy->addRoute(Route::Path::Sin,QPoint(550,300));
enemy->addRoute(Route::Path::Sin,QPoint(500,300) + 45*i*QPoint(-1,0)+ 20*QPoint(0,i%2+1));
enemy->addRoute(Route::Path::Stay);
enemies.push_back(enemy);
}
for(int i =0; i<j; i++){
std::shared_ptr<Enemy> enemy (EnemiesFactory::newLobster(QPoint(-800,1600) - 40*i*QPoint(-1,1),5+j));
enemy->addRoute(Route::Path::Line,QPoint(550,400));
enemy->addRoute(Route::Path::Line,QPoint(500,400)+ 45*i*QPoint(-1,0) + 40*QPoint(0,i%2));
enemy->addRoute(Route::Path::Stay);
enemies.push_back(enemy);
}
if(type == Type::SuperHard){
for(int i =0; i<j; i++){
std::shared_ptr<Enemy> enemy (EnemiesFactory::newWasp(QPoint(-350,-250)+ 40*i*QPoint(-1,-1),5+j));
enemy->addRoute(Route::Path::Line,QPoint(200,300));
enemy->addRoute(Route::Path::Sin,QPoint(450,200));
enemy->addRoute(Route::Path::Sin,QPoint(400,80) + 45*i*QPoint(-1,0)+ 20*QPoint(0,i%2+1));
enemy->addRoute(Route::Path::Stay);
enemies.push_back(enemy);
}
for(int i =0; i<j; i++){
std::shared_ptr<Enemy> enemy (EnemiesFactory::newLobster(QPoint(-800,1600) - 40*i*QPoint(-1,1),5+j));
enemy->addRoute(Route::Path::Line,QPoint(450,300));
enemy->addRoute(Route::Path::Line,QPoint(400,300)+ 45*i*QPoint(-1,0) + 40*QPoint(0,i%2));
enemy->addRoute(Route::Path::Stay);
enemies.push_back(enemy);
}
}
}
QVector<std::shared_ptr<Enemy>>& Wave::getEnemies(){
return enemies;
}