-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathEnemy.h
33 lines (29 loc) · 989 Bytes
/
Enemy.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
#pragma once // Specifica che il compilatore include il file di intestazione una sola volta, durante la compilazione di un file di codice sorgente
#include "Entity.h"
#include "Platform.h"
#include "Player.h"
#include "Bullet.h"
struct enemy
{
int x;
int y;
int type;
int direction; // Direzione verso cui si muovera' il nemico ('0' = basso; '1' = alto; '2' = destra; '3' = sinistra)
int movementSleepCount_UpDown = -1;
int movementSleepCount_RightLeft = -1;
int fireBallX;
int fireBallY;
enemy* nextEnemy;
};
typedef enemy* enemyPosition;
class Enemy : public Entity
{
protected:
enemyPosition enemies;
bool directionUp, touched;
public:
Enemy (int x = -1, int y = -1, int type = -1, char symbol = 'S');
void generateEnemies (int enemyNumber, Platform generablePositions); // Genera i nemici
void print(Platform generablePositions);
bool enemyHandler(Player player, Bullet bullet); // Gestisce le azioni riguardanti i nemici
};