Removed unneeded YAML attributes, cleaned up Bullet class.
This commit is contained in:
parent
4067d351e5
commit
22bcd8cf13
4 changed files with 2 additions and 7 deletions
|
@ -1,6 +1,5 @@
|
|||
name: Bullet
|
||||
texture: bullet.png
|
||||
size: [20, 20]
|
||||
|
||||
damage: 10
|
||||
radius: 10
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
name: Enemy
|
||||
texture: enemy.png
|
||||
size: [50, 50]
|
||||
|
||||
health: 100
|
||||
speed: 100.0
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
name: Player
|
||||
texture: player.png
|
||||
size: [50, 50]
|
||||
|
||||
health: 100
|
||||
speed: 100.0
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Reference in a new issue