diff --git a/BlankProjectTemplate/src/Gameplay.py b/BlankProjectTemplate/src/Gameplay.py index 92048beb2deffa0eef1de4103f5f51d1bf64b993..b5daf951335b15428375111af69d477c4d87cce8 100644 --- a/BlankProjectTemplate/src/Gameplay.py +++ b/BlankProjectTemplate/src/Gameplay.py @@ -74,36 +74,43 @@ def game(speed, colour, backgroundColour): y += (size)*snake.direct else: x += (size)*snake.direct - - #Boundary conditions for snake hitting window edge - if (x < 0 or - y < 0 or - y > screenSize - size or - x > screenSize - size): - - pygame.quit() #for now, quit the game when snake hits boundary + + + if (speed == 100): + if x < 0: + #x = 0 + x = screenSize - size + if y < 0: + #y = 0 + y = screenSize - size + if y > screenSize - size: + #y = 500 - size + y = 0 + if x > screenSize - size: + #x = 500 - size + x = 0 + else: + #Boundary conditions for snake hitting window edge + if (x < 0 or + y < 0 or + y > screenSize - size or + x > screenSize - size): + + pygame.quit() #for now, quit the game when snake hits boundary ## snake.die() - #---------------------FOR WRAPING SNAKE AROUND WINDOW--------------------- - - ## if x < 0: - ## #x = 0 - ## x = screenSize - size - ## if y < 0: - ## #y = 0 - ## y = screenSize - size - ## if y > screenSize - size: - ## #y = 500 - size - ## y = 0 - ## if x > screenSize - size: - ## #x = 500 - size - ## x = 0 + #------------------------------------------------- if(abs(x - food_location[0]) < 15 and abs(y - food_location[1]) < 15): - score += 10 + if (speed == 100): + score += 5 + elif (speed == 70): + score += 7 + else: + score += 10 #increment the length by 3 unit every time snake_length += 3 diff --git a/BlankProjectTemplate/src/__pycache__/Food.cpython-37.pyc b/BlankProjectTemplate/src/__pycache__/Food.cpython-37.pyc index ec566ebd5cc12c0c770e1b2c5e4bfdd7779962e9..74b11249499f01e6fd3af8d5868fb1123ee7b2f3 100644 Binary files a/BlankProjectTemplate/src/__pycache__/Food.cpython-37.pyc and b/BlankProjectTemplate/src/__pycache__/Food.cpython-37.pyc differ diff --git a/BlankProjectTemplate/src/__pycache__/Gameplay.cpython-37.pyc b/BlankProjectTemplate/src/__pycache__/Gameplay.cpython-37.pyc index 5ef139510bee34ec910d8edd8a3c9208b68080df..95c0fdcd920453e7a22e9ecd712c4d9a867f1667 100644 Binary files a/BlankProjectTemplate/src/__pycache__/Gameplay.cpython-37.pyc and b/BlankProjectTemplate/src/__pycache__/Gameplay.cpython-37.pyc differ diff --git a/BlankProjectTemplate/src/__pycache__/Interface.cpython-37.pyc b/BlankProjectTemplate/src/__pycache__/Interface.cpython-37.pyc index cdf91be755451fac4db284c259b8a719f3f58eaa..1a4b892b56bd8ac8b8fbddb02594e7d7d2c7ddb9 100644 Binary files a/BlankProjectTemplate/src/__pycache__/Interface.cpython-37.pyc and b/BlankProjectTemplate/src/__pycache__/Interface.cpython-37.pyc differ diff --git a/BlankProjectTemplate/src/__pycache__/Snake.cpython-37.pyc b/BlankProjectTemplate/src/__pycache__/Snake.cpython-37.pyc index b5a5fed23cd43852f47011b2efddf58c2d9e9048..3dedbbe50f33ad4d08eb11ce411301ab4e49bd92 100644 Binary files a/BlankProjectTemplate/src/__pycache__/Snake.cpython-37.pyc and b/BlankProjectTemplate/src/__pycache__/Snake.cpython-37.pyc differ diff --git a/BlankProjectTemplate/src/__pycache__/highscore.cpython-37.pyc b/BlankProjectTemplate/src/__pycache__/highscore.cpython-37.pyc index 2af85ea658dcf9e7746d7d4c0ff3f1d91085d134..b54b7599ad8d9e8979d97adfde77edd319d5c62e 100644 Binary files a/BlankProjectTemplate/src/__pycache__/highscore.cpython-37.pyc and b/BlankProjectTemplate/src/__pycache__/highscore.cpython-37.pyc differ diff --git a/BlankProjectTemplate/src/__pycache__/init.cpython-37.pyc b/BlankProjectTemplate/src/__pycache__/init.cpython-37.pyc index cce923f0e289ed3fb9a8cb0638c6cb526bac5e44..62ac970de3e2e1265e1a2d428016c65026a0f51b 100644 Binary files a/BlankProjectTemplate/src/__pycache__/init.cpython-37.pyc and b/BlankProjectTemplate/src/__pycache__/init.cpython-37.pyc differ diff --git a/BlankProjectTemplate/src/__pycache__/theme.cpython-37.pyc b/BlankProjectTemplate/src/__pycache__/theme.cpython-37.pyc index 1fa157e9e2fc56fcd1c638e9cbd18a947511d05f..a53346a2afcf54be0ff1142c8e096f69f9f93434 100644 Binary files a/BlankProjectTemplate/src/__pycache__/theme.cpython-37.pyc and b/BlankProjectTemplate/src/__pycache__/theme.cpython-37.pyc differ