NoteTile create
This commit is contained in:
parent
607edc1d48
commit
e429118bc9
3 changed files with 54 additions and 0 deletions
1
SimpleGame/src/Include/NotePlaceEnum.hpp
Normal file
1
SimpleGame/src/Include/NotePlaceEnum.hpp
Normal file
|
@ -0,0 +1 @@
|
|||
enum NotePlaceEnum { Left, Middle, Right };
|
28
SimpleGame/src/Include/NoteTile.hpp
Normal file
28
SimpleGame/src/Include/NoteTile.hpp
Normal file
|
@ -0,0 +1,28 @@
|
|||
#include <NotePlaceEnum.hpp>
|
||||
#include <SFML/Graphics/StencilMode.hpp>
|
||||
#include <SFML/System/Vector2.hpp>
|
||||
#include <memory>
|
||||
#include <vector>
|
||||
|
||||
class NoteTile {
|
||||
private:
|
||||
static std::vector<std::unique_ptr<NoteTile>> existing_tiles;
|
||||
// logic things
|
||||
float play_time;
|
||||
float good_interval;
|
||||
NotePlaceEnum place;
|
||||
// used for Graphics
|
||||
sf::Vector2f position;
|
||||
// probably some tileSprite class here in the future <-
|
||||
|
||||
// Constructor private, use create to create
|
||||
NoteTile(float play_time, float good_interval, NotePlaceEnum place);
|
||||
|
||||
public:
|
||||
// Good key press for this note, is if player press good place, within
|
||||
// [play_time - good_interval/2, play_time + good_interval/2]
|
||||
static void create(float play_time, float good_interval, NotePlaceEnum place);
|
||||
// Should be called when one of arrows key pressed, return True if it's a good
|
||||
// press
|
||||
bool CheckPress(float press_time, NotePlaceEnum key_pressed);
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue