NoteTile create

This commit is contained in:
Crizomb 2025-06-12 15:29:22 +02:00
parent 607edc1d48
commit e429118bc9
3 changed files with 54 additions and 0 deletions

View file

@ -0,0 +1 @@
enum NotePlaceEnum { Left, Middle, Right };

View 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);
};