Ajout score + score multiplier
This commit is contained in:
parent
58f3e7d4fb
commit
9d6c4eaa23
4 changed files with 48 additions and 9 deletions
|
@ -33,27 +33,30 @@ bool NoteTile::checkPress(float press_time, NotePlaceEnum key_pressed) {
|
|||
if (note_tile->play_time - note_tile->good_interval / 2 < press_time &&
|
||||
note_tile->play_time + note_tile->good_interval / 2 > press_time &&
|
||||
note_tile->place == key_pressed) {
|
||||
printf("good touch \n");
|
||||
/*printf("good touch \n");*/
|
||||
tiles.erase(it);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
printf("badd touch \n");
|
||||
/*printf("badd touch \n");*/
|
||||
return false;
|
||||
}
|
||||
|
||||
void NoteTile::update(float dtime, sf::RenderWindow &window) {
|
||||
bool NoteTile::update(float dtime, sf::RenderWindow &window) {
|
||||
bool no_miss = true;
|
||||
auto &tiles = NoteTile::existing_tiles;
|
||||
|
||||
for (auto it = tiles.begin(); it != tiles.end();) {
|
||||
auto ¬e_tile = *it;
|
||||
|
||||
if (note_tile->note_sprite.sprite.getPosition().y > SCREEN_HEIGHT) {
|
||||
printf("missed tile \n");
|
||||
/*printf("missed tile \n");*/
|
||||
no_miss = false;
|
||||
it = tiles.erase(it);
|
||||
} else {
|
||||
note_tile->note_sprite.update(dtime, window);
|
||||
++it;
|
||||
}
|
||||
}
|
||||
return no_miss;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue