who knows

This commit is contained in:
Benjamin Morgan 2025-09-26 09:18:22 -06:00
parent 60d408a37c
commit f43544d15d
19 changed files with 2379 additions and 2063 deletions

View file

@ -1,35 +1,35 @@
//
// Created by benmo on 9/28/2020.
//
#ifndef SFML_TEMPLATE_ASTEROID_H
#define SFML_TEMPLATE_ASTEROID_H
#include "Entity.h"
class Asteroid : public Entity {
public:
Asteroid(int health, int points, const sf::Texture &texture, float scale, float xPos, float yPos, float velocity, float direction) : Entity(health, points, texture, scale, xPos, yPos, velocity, direction) {
size = health;
type = "asteroid";
}
int getSize() const {
return size;
}
void hit(vector<MySprite> &animations, Sound &sound, Texture &explosion, default_random_engine &gen) {
uniform_int_distribution<int> angle(0, 359);
animations.emplace_back(explosion, getSize()*65, getXPos(), getYPos(), 0, angle(gen));
animations[animations.size() - 1].makeAnimated(5, 5, 0.01,23);
sound.setVolume(100.0/((4-size)/1.5));
sound.play();
}
private:
int size;
};
#endif //SFML_TEMPLATE_ASTEROID_H
//
// Created by benmo on 9/28/2020.
//
#ifndef SFML_TEMPLATE_ASTEROID_H
#define SFML_TEMPLATE_ASTEROID_H
#include "Entity.h"
class Asteroid : public Entity {
public:
Asteroid(int health, int points, const sf::Texture &texture, float scale, float xPos, float yPos, float velocity, float direction) : Entity(health, points, texture, scale, xPos, yPos, velocity, direction) {
size = health;
type = "asteroid";
}
int getSize() const {
return size;
}
void hit(vector<MySprite> &animations, Sound &sound, Texture &explosion, default_random_engine &gen) {
uniform_int_distribution<int> angle(0, 359);
animations.emplace_back(explosion, getSize()*65, getXPos(), getYPos(), 0, angle(gen));
animations[animations.size() - 1].makeAnimated(5, 5, 0.01,23);
sound.setVolume(100.0/(4-size));
sound.play();
}
private:
int size;
};
#endif //SFML_TEMPLATE_ASTEROID_H