mirror of
https://github.com/dankamongmen/notcurses.git
synced 2024-11-02 09:40:15 +00:00
tetris: start on level 1
This commit is contained in:
parent
3a7dabd2c8
commit
894c6d15f6
@ -820,6 +820,14 @@ int get_controlling_tty(void);
|
||||
if((nc)->loglevel >= NCLOGLEVEL_INFO){ \
|
||||
nclog("%s:%d:" fmt, __func__, __LINE__, ##__VA_ARGS__); } }while(0);
|
||||
|
||||
#define logverbose(nc, fmt, ...) do{ \
|
||||
if((nc)->loglevel >= NCLOGLEVEL_VERBOSE){ \
|
||||
nclog("%s:%d:" fmt, __func__, __LINE__, ##__VA_ARGS__); } }while(0);
|
||||
|
||||
#define logdebug(nc, fmt, ...) do{ \
|
||||
if((nc)->loglevel >= NCLOGLEVEL_DEBUG){ \
|
||||
nclog("%s:%d:" fmt, __func__, __LINE__, ##__VA_ARGS__); } }while(0);
|
||||
|
||||
// Convert a notcurses log level to some multimedia library equivalent.
|
||||
int ffmpeg_log_level(ncloglevel_e level);
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
static constexpr int MAX_LEVEL = 15;
|
||||
static constexpr int MAX_LEVEL = 16;
|
||||
// the number of milliseconds before a drop is forced at the given level,
|
||||
// using the NES fps counter of 50ms
|
||||
static constexpr int Gravity(int level) {
|
||||
|
@ -26,8 +26,8 @@ bool LockPiece(){ // returns true if game has ended by reaching level 16
|
||||
}
|
||||
linescleared_ += cleared;
|
||||
static constexpr int points[] = {50, 150, 350, 1000};
|
||||
score_ += (level_ + 1) * points[cleared - 1];
|
||||
if((level_ = linescleared_ / 10) > MAX_LEVEL){
|
||||
score_ += (level_) * points[cleared - 1];
|
||||
if((level_ = linescleared_ / 10 + 1) > MAX_LEVEL){
|
||||
return true;
|
||||
}
|
||||
mtx_.lock();
|
||||
|
@ -29,7 +29,7 @@ public:
|
||||
stdplane_(nc_.get_stdplane()),
|
||||
scoreplane_(nullptr),
|
||||
gameover_(gameover),
|
||||
level_(0),
|
||||
level_(1),
|
||||
linescleared_(0),
|
||||
msdelay_(Gravity(level_))
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user