-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathEnemy1.h
37 lines (34 loc) · 777 Bytes
/
Enemy1.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
#pragma once
#include <SFML/Graphics.hpp>
#include <SFML/Network.hpp>
#include <SFML/System.hpp>
#include <SFML/Window.hpp>
#include <SFML/Audio.hpp>
#include <iostream>
#include <fstream>
#include <string>
#include <vector>
#define RIGHT 1
#define LEFT -1
class Enemy1
{
private:
sf::Sprite enemy;
int direction;
float speed;
int health;
public:
Enemy1();
~Enemy1();
void set_texture(sf::Sprite new_texture);
void update_health();
void move();
bool is_on_ground(sf::Sprite ground);
void go_back();
void render(sf::RenderTarget &target);
int get_dir();
bool collided(sf::Sprite target);
bool is_in_world(sf::Sprite world);
int get_health() { return health; }
sf::Sprite get_sprite() { return enemy; }
};