-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathEnemy.cpp
More file actions
37 lines (27 loc) · 698 Bytes
/
Enemy.cpp
File metadata and controls
37 lines (27 loc) · 698 Bytes
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
#include "stdafx.h"
#include "Enemy.h"
//Comstructors amd Destructor:
//Enemy::Enemy(EnemySpawner& enemy_spawner, float x, float y, sf::Texture& texture_sheet)
// : enemySpawner(enemy_spawner)
Enemy::Enemy(EnemySpawnerTile& enemy_spawner_tile)
: enemySpawnerTile(enemy_spawner_tile)
{
this->expReward = 100;
}
Enemy::~Enemy()
{
}
//Accessors:
EnemySpawnerTile& Enemy::getEnemySpawnerTile() const
{
return this->enemySpawnerTile;
}
//Functions:
void Enemy::generateAttributes(const int level)
{
this->expReward = level * 10 + (std::rand() % (level)+1);
}
void Enemy::playAnimation(std::string key, const float& dt, bool priority)
{
this->animationComponent->play(key, dt, priority);
}