-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBacterium.h
52 lines (39 loc) · 1.55 KB
/
Bacterium.h
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
//
// Created by flo on 10/28/2021.
//
#ifndef NOMPROJET_BACTERIUM_H
#define NOMPROJET_BACTERIUM_H
#include<iostream>
#include "Entity.h"
// Bacterium Enemy Entity
class Bacterium: public Entity {
public:
Bacterium(LetterMap &map,int visibility_ray,int delay_move) : Entity(map,visibility_ray,delay_move) {
std::cout << "assurdo!\n";
}
virtual void draw(RenderWindow &window,int pixePerUnit,Camera2D &cam){
CircleShape circle = CircleShape(1.0F/2.0F*pixePerUnit);
circle.setFillColor(Color::Yellow);
circle.setPosition((this->getRealCol()*pixePerUnit)-cam.getX(),(this->getRealRow()*pixePerUnit)-cam.getY());
circle.setPointCount(100);
//circle.move(-circle.getRadius() ,-circle.getRadius());
//circle.setPosition(this->row,this->col);
CircleShape ray2 = circle;
ray2.setFillColor(Color::Transparent);
ray2.setRadius(pixePerUnit * this->getVisibilityRay());
ray2.setOutlineColor(Color(255,255,255,50));
ray2.setOutlineThickness(1);
ray2.move(-ray2.getRadius() ,-ray2.getRadius());
vector<pair<int,int>> folPath = this->getFollowingPath();
window.draw(circle);
window.draw(ray2);
for(pair<int,int> p:folPath){
RectangleShape sq;
sq.setPosition( (p.second*pixePerUnit)- cam.getX(), (p.first*pixePerUnit) -cam.getY() );
sq.setFillColor(Color::Blue);
sq.setSize({0.6F*pixePerUnit,0.6F*pixePerUnit});
window.draw(sq);
}
}
};
#endif //NOMPROJET_BACTERIUM_H