From fb11ece1676d6a66f077a55189b0959988260289 Mon Sep 17 00:00:00 2001 From: Fransheska Colon Date: Fri, 5 Nov 2021 02:32:22 -0700 Subject: [PATCH] Fix color on restart --- src/SnakeGame.jsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/SnakeGame.jsx b/src/SnakeGame.jsx index 913ae8e..43079fe 100644 --- a/src/SnakeGame.jsx +++ b/src/SnakeGame.jsx @@ -146,8 +146,8 @@ class SnakeGame extends React.Component { directionChanged: false, isGameOver: false, gameLoopTimeout: 50, - snakeColor: this.getRandomColor(), - appleColor: this.getRandomColor(), + snakeColor: this.props.snakeColor || this.getRandomColor(), + appleColor: this.props.appleColor || this.getRandomColor(), score: 0, newHighScore: false, })