rendering
This commit is contained in:
66
Pipe.h
66
Pipe.h
@@ -1,33 +1,33 @@
|
||||
#ifndef FLOPPY_BIRD_PIPE_H
|
||||
#define FLOPPY_BIRD_PIPE_H
|
||||
|
||||
|
||||
#include <SFML/Graphics/Sprite.hpp>
|
||||
#include <SFML/Graphics/Texture.hpp>
|
||||
#include <SFML/Graphics/RenderTarget.hpp>
|
||||
#include <memory>
|
||||
|
||||
class Pipe : public sf::Drawable {
|
||||
|
||||
sf::Sprite pipe_top;
|
||||
sf::Sprite pipe_shaft;
|
||||
|
||||
std::shared_ptr<sf::Texture> pipe_top_texture;
|
||||
std::shared_ptr<sf::Texture> pipe_shaft_texture;
|
||||
|
||||
std::shared_ptr<sf::Shader> pipe_shaft_shader;
|
||||
|
||||
sf::Vector2f position;
|
||||
float momentum;
|
||||
|
||||
public:
|
||||
Pipe(float x, float y, std::shared_ptr<sf::Texture> pipe_top_texture, std::shared_ptr<sf::Texture> pipe_shaft_texture, std::shared_ptr<sf::Shader> shader);
|
||||
|
||||
void tick(float step, float speed);
|
||||
bool collides(sf::FloatRect bounds);
|
||||
|
||||
virtual void draw(sf::RenderTarget& target, sf::RenderStates states) const;
|
||||
};
|
||||
|
||||
|
||||
#endif //FLOPPY_BIRD_PIPE_H
|
||||
//#ifndef FLOPPY_BIRD_PIPE_H
|
||||
//#define FLOPPY_BIRD_PIPE_H
|
||||
//
|
||||
//
|
||||
//#include <SFML/Graphics/Sprite.hpp>
|
||||
//#include <SFML/Graphics/Texture.hpp>
|
||||
//#include <SFML/Graphics/RenderTarget.hpp>
|
||||
//#include <memory>
|
||||
//
|
||||
//class Pipe : public sf::Drawable {
|
||||
//
|
||||
// sf::Sprite pipe_top;
|
||||
// sf::Sprite pipe_shaft;
|
||||
//
|
||||
// std::shared_ptr<sf::Texture> pipe_top_texture;
|
||||
// std::shared_ptr<sf::Texture> pipe_shaft_texture;
|
||||
//
|
||||
// std::shared_ptr<sf::Shader> pipe_shaft_shader;
|
||||
//
|
||||
// sf::Vector2f position;
|
||||
// float momentum;
|
||||
//
|
||||
//public:
|
||||
// Pipe(float x, float y, std::shared_ptr<sf::Texture> pipe_top_texture, std::shared_ptr<sf::Texture> pipe_shaft_texture, std::shared_ptr<sf::Shader> shader);
|
||||
//
|
||||
// void tick(float step, float speed);
|
||||
// bool collides(sf::FloatRect bounds);
|
||||
//
|
||||
// virtual void draw(sf::RenderTarget& target, sf::RenderStates states) const;
|
||||
//};
|
||||
//
|
||||
//
|
||||
//#endif //FLOPPY_BIRD_PIPE_H
|
||||
|
||||
Reference in New Issue
Block a user