This repository has been archived on 2019-12-07. You can view files and clone it, but cannot push or open issues or pull requests.
2012-09-14 18:33:32 +00:00
|
|
|
/*
|
|
|
|
* Enemy.cpp
|
|
|
|
*
|
|
|
|
* Created on: 10.09.2012
|
|
|
|
* Author: Felix
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "Enemy.h"
|
|
|
|
|
|
|
|
#include "Body.h"
|
|
|
|
|
2012-10-04 17:10:12 +00:00
|
|
|
Enemy::Enemy(const Instances& instances, const Vector2f& position) :
|
|
|
|
Character("enemy.png", PhysicalData(position, Vector2i(50, 50), instances.world,
|
2012-10-01 09:13:26 +00:00
|
|
|
CATEGORY_ACTOR, MASK_ALL, true, false, true), 100),
|
2012-10-04 17:10:12 +00:00
|
|
|
mWorld(instances.world),
|
|
|
|
mCollection(instances.collection) {
|
2012-09-14 18:33:32 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
Enemy::~Enemy() {
|
|
|
|
// Insert here to avoid altering b2d data during timestep.
|
2012-09-16 18:33:00 +00:00
|
|
|
mCollection.insert(std::shared_ptr<Sprite>(new Body(mWorld, getPosition())));
|
2012-09-14 18:33:32 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
Enemy::onThink(float elapsedTime) {
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
Enemy::onDeath() {
|
|
|
|
setDelete(true);
|
|
|
|
}
|