Skip to content

Commit

Permalink
Merge pull request #6 from AviationSFO/development
Browse files Browse the repository at this point in the history
Development
  • Loading branch information
AviationSFO authored Jul 17, 2022
2 parents 435339f + 2706f50 commit 7dd0588
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 11 deletions.
2 changes: 1 addition & 1 deletion install.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Is it possible to have install script clone from latest version rather than the latest commit?

# !!!!MACOS ONLY!!!!
cd ~/Desktop
git clone https://github.com/AviationSFO/SnakeGame

Expand Down
11 changes: 10 additions & 1 deletion prefs.json
Original file line number Diff line number Diff line change
@@ -1 +1,10 @@
{"highscore": 0, "bgcolor": "dark green", "foodcolor": "navy", "foodshape": "square", "foodnum": 2, "mutesound": true, "headcolor": "white", "tailcolor": "blue"}
{
"highscore": 0,
"bgcolor": "dark green",
"foodcolor": "navy",
"foodshape": "square",
"foodnum": 2,
"mutesound": true,
"headcolor": "white",
"tailcolor": "blue"
}
13 changes: 5 additions & 8 deletions turtlesnake.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Python Snake Game by Steven Weinstein on 3-10-2022. Version available in version.txt
# Python Snake Game by Steven Weinstein on 7-17-2022. Version available in version.txt
# import required modules
TK_SILENCE_DEPRECATION = 1
from platform import python_version
Expand Down Expand Up @@ -48,8 +48,7 @@
noplaysound = True
global high_score
global mutesound
with open(path.expanduser(
"~/Desktop/SnakeGame/prefs.json"), "r") as read_file:
with open("prefs.json", "r") as read_file:
prefs = json.load(read_file)
high_score = prefs["highscore"]
bgcolor = prefs["bgcolor"]
Expand All @@ -66,8 +65,7 @@
score = 0
APIon = False
# opening files
datadoc = open(path.expanduser(
"~/Desktop/SnakeGame/data.txt"), "a")
datadoc = open("data.txt", "a")
foodnum = int(foodnum)

if foodnum == 2:
Expand All @@ -83,7 +81,7 @@
print("Error: last highscore is not an integer.")

wn = turtle.Screen()
wn.title("Snake Game Project v1.13.0")
wn.title("Snake Game Project v1.13.1")
wn.bgcolor(bgcolor)
# the width and height can be put as user's choice
wn.setup(width=600, height=600)
Expand Down Expand Up @@ -436,8 +434,7 @@ def exit():
}

if changedcolor == False:
with open(path.expanduser(
"~/Desktop/SnakeGame/prefs.json"), "w") as write_file:
with open("prefs.json", "w") as write_file:
json.dump(prefs, write_file)
else:
quit()
Expand Down
2 changes: 1 addition & 1 deletion version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Version STABLE v1.13.0
Version STABLE v1.13.1

0 comments on commit 7dd0588

Please sign in to comment.