rendering
This commit is contained in:
60
Bird.h
60
Bird.h
@@ -1,30 +1,30 @@
|
||||
#ifndef FLOPPY_BIRD_BIRD_H
|
||||
#define FLOPPY_BIRD_BIRD_H
|
||||
|
||||
#include <SFML/Graphics/Sprite.hpp>
|
||||
#include <SFML/Graphics/Texture.hpp>
|
||||
#include <SFML/Graphics/RenderTarget.hpp>
|
||||
#include <memory>
|
||||
|
||||
const float gravity = 9.8;
|
||||
|
||||
class Bird : public sf::Drawable {
|
||||
|
||||
sf::Sprite sprite;
|
||||
std::shared_ptr<std::vector<sf::Texture>> texture_list;
|
||||
|
||||
sf::Vector2f position;
|
||||
float momentum;
|
||||
|
||||
public:
|
||||
Bird(float x, float y, const std::shared_ptr<std::vector<sf::Texture>> texture_list);
|
||||
|
||||
void impulse(float p);
|
||||
void tick(float step);
|
||||
bool collides(sf::FloatRect bounds);
|
||||
|
||||
virtual void draw(sf::RenderTarget& target, sf::RenderStates states) const;
|
||||
};
|
||||
|
||||
|
||||
#endif //FLOPPY_BIRD_BIRD_H
|
||||
//#ifndef FLOPPY_BIRD_BIRD_H
|
||||
//#define FLOPPY_BIRD_BIRD_H
|
||||
//
|
||||
//#include <SFML/Graphics/Sprite.hpp>
|
||||
//#include <SFML/Graphics/Texture.hpp>
|
||||
//#include <SFML/Graphics/RenderTarget.hpp>
|
||||
//#include <memory>
|
||||
//
|
||||
//const float gravity = 9.8;
|
||||
//
|
||||
//class Bird : public sf::Drawable {
|
||||
//
|
||||
// sf::Sprite sprite;
|
||||
// std::shared_ptr<std::vector<sf::Texture>> texture_list;
|
||||
//
|
||||
// sf::Vector2f position;
|
||||
// float momentum;
|
||||
//
|
||||
//public:
|
||||
// Bird(float x, float y, const std::shared_ptr<std::vector<sf::Texture>> texture_list);
|
||||
//
|
||||
// void impulse(float p);
|
||||
// void tick(float step);
|
||||
// bool collides(sf::FloatRect bounds);
|
||||
//
|
||||
// virtual void draw(sf::RenderTarget& target, sf::RenderStates states) const;
|
||||
//};
|
||||
//
|
||||
//
|
||||
//#endif //FLOPPY_BIRD_BIRD_H
|
||||
|
||||
Reference in New Issue
Block a user