From b89a7a2fae237dac1dcab397a4b9b873a104a8a0 Mon Sep 17 00:00:00 2001 From: Olle Sam Date: Tue, 28 Mar 2017 20:26:20 +0200 Subject: [PATCH 1/2] Combos now also block garbage first, then send to other players --- gamePlay.cpp | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/gamePlay.cpp b/gamePlay.cpp index c852b81..1c161b8 100644 --- a/gamePlay.cpp +++ b/gamePlay.cpp @@ -303,7 +303,28 @@ void gamePlay::delayCheck() { } if (keyclock.getElapsedTime() > comboStart+comboTime && comboCount!=0) { - linesSent = linesSent + comboCount * pow(1.1, comboCount); + sf::Uint16 comboLinesSent = comboCount * pow(1.1, comboCount); + + bool blocked=false; + for (int i=0; i Date: Wed, 29 Mar 2017 16:20:45 +0200 Subject: [PATCH 2/2] New lockdown mechanics The piece lockdown was previously tied to the falling-speed, or if garbage was pushed up into the piece it would instantly lockdown. New system has added a static lockdown-time of 400ms in all cases. This works much more similar to what cultris uses and gives better control for softdroping with high stack or while garbage is being pushed up. --- gamePlay.cpp | 37 +++++++++++++++++++++++++++++-------- gamePlay.h | 5 +++++ 2 files changed, 34 insertions(+), 8 deletions(-) diff --git a/gamePlay.cpp b/gamePlay.cpp index 1c161b8..6734268 100644 --- a/gamePlay.cpp +++ b/gamePlay.cpp @@ -34,6 +34,7 @@ void gamePlay::startGame() { oldbpmCount=0; autoaway=true; position=0; + lockdown=false; for (int i=0; i<10; i++) oldbpm[i]=0; setComboTimer(); @@ -105,9 +106,14 @@ void gamePlay::mDown() { if (possible()) { draw(); dclock.restart(); + lockdown=false; } - else + else { piece.mup(); + if (!lockdown) + lockDownTime=keyclock.getElapsedTime()+sf::milliseconds(400); + lockdown=true; + } } void gamePlay::hd() { @@ -269,13 +275,13 @@ void gamePlay::delayCheck() { piece.mdown(); if (possible()) { draw(); + lockdown=false; } else { piece.mup(); - addPiece(); - sendLines(field.clearlines()); - makeNewPiece(); - draw(); + if (!lockdown) + lockDownTime=keyclock.getElapsedTime()+sf::milliseconds(400); + lockdown=true; } dclock.restart(); } @@ -302,6 +308,21 @@ void gamePlay::delayCheck() { dKeyTime+=options.repeatSpeedDown; } + if (lockdown && keyclock.getElapsedTime() > lockDownTime) { + piece.mdown(); + if (!possible()) { + piece.mup(); + addPiece(); + sendLines(field.clearlines()); + makeNewPiece(); + draw(); + } + else { + piece.mup(); + lockdown=false; + } + } + if (keyclock.getElapsedTime() > comboStart+comboTime && comboCount!=0) { sf::Uint16 comboLinesSent = comboCount * pow(1.1, comboCount); @@ -505,9 +526,9 @@ void gamePlay::pushGarbage() { if (!possible()) { piece.mup(); - addPiece(); - sendLines(field.clearlines()); - makeNewPiece(); + if (!lockdown) + lockDownTime=keyclock.getElapsedTime()+sf::milliseconds(400); + lockdown=true; } } diff --git a/gamePlay.h b/gamePlay.h index 7adac9e..0d29f61 100644 --- a/gamePlay.h +++ b/gamePlay.h @@ -45,6 +45,8 @@ class gamePlay { sendgameover=false; winner=false; + lockdown=false; + rKey=false; lKey=false; dKey=false; @@ -105,6 +107,9 @@ class gamePlay { sf::Time countDownTime; short countDowncount; + sf::Time lockDownTime; + bool lockdown; + sf::Uint16 linesSent; sf::Uint16 linesRecieved; short comboCount;