Removed unneeded YAML attributes, cleaned up Bullet class.

This commit is contained in:
Felix Ableitner 2013-05-04 23:00:45 +02:00
parent 4067d351e5
commit 22bcd8cf13
4 changed files with 2 additions and 7 deletions

View file

@ -1,6 +1,5 @@
name: Bullet
texture: bullet.png
size: [20, 20]
damage: 10
radius: 10

View file

@ -1,6 +1,5 @@
name: Enemy
texture: enemy.png
size: [50, 50]
health: 100
speed: 100.0

View file

@ -1,6 +1,5 @@
name: Player
texture: player.png
size: [50, 50]
health: 100
speed: 100.0

View file

@ -22,14 +22,12 @@
*/
Bullet::Bullet(const sf::Vector2f& position, Sprite& shooter,
sf::Vector2f direction, const Yaml& config) :
Particle(config, Data(position, CATEGORY_PARTICLE,
~CATEGORY_PARTICLE)),
Particle(config, Data(position, CATEGORY_PARTICLE, ~CATEGORY_PARTICLE,
thor::rotatedVector(direction, -90.0f))),
mShooter(shooter),
mDamage(config.get(YAML_KEY::DAMAGE, YAML_DEFAULT::DAMAGE)),
mSpeed(config.get(YAML_KEY::SPEED, YAML_DEFAULT::SPEED)) {
thor::rotate(direction, - 90.0f);
setSpeed(direction, mSpeed);
setDirection(direction);
}
/**