-
Notifications
You must be signed in to change notification settings - Fork 0
/
Turtle.h
51 lines (42 loc) · 1.22 KB
/
Turtle.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
#pragma once
#include <SFML/Graphics.hpp>
#include <SFML/System.hpp>
#include <SFML/Window.hpp>
#include<vector>
#include<iostream>
#include"global_stuff.h"
#include"Collision_type.h"
#include"Enemy.h"
using namespace sf;
using namespace std;
class Turtle
{
private:
Sprite shape_of_turtle;
Texture texture;
float vertical_speed;
float x;
float y;
float portal_x;
float portal_y;
int turtle_live;
int score;
bool can_kill_enemy;
void init_variables(float i_x, float i_y);
void init_shape();
public:
Turtle(float x = 100.f, float y = 100.f);
float get_x(){return x;}
float get_y(){return y;}
bool is_alive(){return (turtle_live > 0);}
Sprite get_shape_of_turtle(){return shape_of_turtle;}
void set_cordinate(float i_x, float i_y){x = i_x; y = i_y;}
void set_portal_cordinate(float i_x, float i_y){portal_x = i_x; portal_y = i_y;}
void update(vector<vector<Cell>>& map, vector<Enemy*>enemies);
void render(RenderTarget * target);
void update_input(vector<vector<Cell>>& map);
void gravity(vector<vector<Cell>>& map);
void get_points(vector<vector<Cell>>& map);
void damage();
void behave_with_enemy(vector<Enemy*>enemies);
};