diff --git a/composer.lock b/composer.lock new file mode 100644 index 0000000..b7ca55c --- /dev/null +++ b/composer.lock @@ -0,0 +1,19 @@ +{ + "_readme": [ + "This file locks the dependencies of your project to a known state", + "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", + "This file is @generated automatically" + ], + "content-hash": "83e517bf36ce6cd988a8b08e1ff8f7f2", + "packages": [], + "packages-dev": [], + "aliases": [], + "minimum-stability": "stable", + "stability-flags": [], + "prefer-stable": false, + "prefer-lowest": false, + "platform": { + "ext-readline": "*" + }, + "platform-dev": [] +} diff --git a/Game.php b/main.php similarity index 98% rename from Game.php rename to main.php index 6a533bb..c4eb769 100644 --- a/Game.php +++ b/main.php @@ -35,7 +35,7 @@ while ($gameRuntime) echo 'Got it ' . $playerName . '! Let\'s start, shall we? ' . PHP_EOL; echo PHP_EOL; echo 'Each player starts with 20 points and 4 lives;' . PHP_EOL; - echo 'Each time you win, your score is multiplied by 3;' . PHP_EOL; + echo 'Each time you win, your score is multiplied by 2;' . PHP_EOL; echo 'Each time you lose, your score is subtracted from the result of the score multiplier (which is 3) times 2.' . PHP_EOL; echo 'This also applies for the bot. Good luck! Starting in 15 seconds.' . PHP_EOL; sleep(15); @@ -123,14 +123,14 @@ while ($gameRuntime) echo 'Computer\'s lives: ' . $robot->getLives() . PHP_EOL; echo PHP_EOL; echo PHP_EOL; - echo 'Continuing in 10 seconds...'; + echo 'Continuing in 5 seconds...'; if ($human->getLives() == 0 || $robot->getLives() == 0) { $gameOver = true; } - sleep(10); + sleep(5); Menu::clearScreen(); } while (!$gameOver); diff --git a/src/Base/Player.php b/src/Base/Player.php index 6bfd825..f2ad3c9 100644 --- a/src/Base/Player.php +++ b/src/Base/Player.php @@ -12,7 +12,7 @@ class Player private $initialScore = 20; - private $multiplier = 3; + private $multiplier = 2; private $lives = 4; @@ -73,7 +73,7 @@ class Player public function registerWin() { - if ($this->initialScore > 500) + if ($this->initialScore >= 1000) { $this->increaseLives(); } @@ -83,16 +83,16 @@ class Player public function registerLoss() { - if ($this->initialScore <= 0) + $score = $this->initialScore; + + if ($score <= 1) { - $this->decreaseLives(); + $this->decreaseLives(); } else { - $this->initialScore = $this->initialScore - ($this->multiplier * 2); + $this->initialScore = $score - ($this->multiplier * 6); } - - } }