Skip to content

Commit

Permalink
Merge pull request #8 from AviationSFO/development
Browse files Browse the repository at this point in the history
Development
  • Loading branch information
AviationSFO authored Aug 9, 2022
2 parents 7dd0588 + 004f092 commit bf40a84
Show file tree
Hide file tree
Showing 9 changed files with 53 additions and 188 deletions.
113 changes: 0 additions & 113 deletions CHANGELOG.txt

This file was deleted.

13 changes: 5 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# Snake Game
# Snake Game v2
## Instructions
### Requirements
#### Python

Version 3.6 or newer, (Python 2 does not work, same as python 3 earlier than 3.6).
Version 3.6 or newer, (Python 2 does not work, same as Python 3 earlier than 3.6).
#### Tested versions:
3.5.10 (not working)

Expand All @@ -22,12 +22,12 @@ Version 3.6 or newer, (Python 2 does not work, same as python 3 earlier than 3.6
3.11a5+
#### OS

Tested on Mac OS and Windows 10 only.
Tested on Mac OS and Windows 10 and 11 only.
### Launching Game
To run game:
MACOS: Open launcher

Windows: Open turtlesnake.py with python
Windows: Open launch-win.exe

### Configuring prefrences

Expand All @@ -49,7 +49,4 @@ curl https://raw.githubusercontent.com/AviationSFO/SnakeGame/master/install.sh |
```

## Windows
Copy and paste the following code into the windows terminal to install
```shell
curl https://raw.githubusercontent.com/AviationSFO/SnakeGame/master/wininstall.sh | bash
```
Download source code from latest release
9 changes: 9 additions & 0 deletions launch-win.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#include <iostream>

using namespace std;

int main()
{
system("python turtlesnake.py");
return 0;
}
Binary file added launch-win.exe
Binary file not shown.
11 changes: 1 addition & 10 deletions prefs.json
Original file line number Diff line number Diff line change
@@ -1,10 +1 @@
{
"highscore": 0,
"bgcolor": "dark green",
"foodcolor": "navy",
"foodshape": "square",
"foodnum": 2,
"mutesound": true,
"headcolor": "white",
"tailcolor": "blue"
}
{"highscore": 0, "bgcolor": "dark green", "foodcolor": "dark red", "foodshape": "circle", "foodnum": 2, "mutesound": true, "headcolor": "white", "tailcolor": "#13325e"}
39 changes: 9 additions & 30 deletions snakeconfig.py
Original file line number Diff line number Diff line change
@@ -1,62 +1,41 @@
#Turtle Snake Game color and shape congigurator for 1.10.1 and newer on 2-8-2022 By Steven Weinstein
import json
#Turtle Snake Game color and shape congigurator for 2.0.0 and newer on 8-8-2022 By Steven Weinstein


def config():
import os
def config(script_path):
import json
prefs = {
"highscore": 0,
"bgcolor": "dark green",
"foodcolor": "navy",
"foodshape": "square",
"foodnum": 2,
"mutesound": True
}
prefs = {"highscore": 0, "bgcolor": "dark green", "foodcolor": "dark red", "foodshape": "circle", "foodnum": 2, "mutesound": True, "headcolor": "white", "tailcolor": "#13325e"}
print('''Color Configurator
enter a hex code or an accepted color name from this list: https://trinket.io/docs/colors NO RGB VALUES''')
prefs["bgcolor"] = input("What color would you like the background: ")
prefs["foodcolor"] = input("What color would you like the food: ")
prefs["foodshape"] = input("Food shape: circle square triange or turtle: ")
prefs["foodnum"] = input("Would you like to have 1 or 2 foods: ")
with open(os.path.expanduser(
"~/Desktop/SnakeGame/prefs.json"), "w") as write_file:
with open(script_path.joinpath("prefs.json"), "w") as write_file:
json.dump(prefs, write_file)
# writing to text document
print("Succesfuly configured!\nYou will have to restart the game for changes to take effect.")
global changedcolor
changedcolor = True
return

def snakecolor():
import os
def snakecolor(script_path):
import json
prefs = {
"highscore": 0,
"bgcolor": "dark green",
"foodcolor": "navy",
"foodshape": "square",
"foodnum": 2,
"mutesound": True
}
prefs = {"highscore": 0, "bgcolor": "dark green", "foodcolor": "dark red", "foodshape": "circle", "foodnum": 2, "mutesound": True, "headcolor": "white", "tailcolor": "#13325e"}
print('''Color Configurator
enter a hex code or an accepted color name from this list: https://trinket.io/docs/colors NO RGB VALUES''')
prefs["headcolor"] = input("What color would you like the snake head: ")
prefs["tailcolor"] = input("What color would you like the snake tail: ")
with open(os.path.expanduser(
"~/Desktop/SnakeGame/prefs.json"), "w") as write_file:
with open(script_path.joinpath("prefs.json"), "w") as write_file:
json.dump(prefs, write_file)
# writing to text document
print("Succesfuly configured!\nYou will have to restart the game for changes to take effect.")
global changedcolor
changedcolor = True
return

def snakereset():
import os
def snakereset(script_path):
print("\n\n\tvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv\nThere was an error in the snake color file.\nReseting the document...\n\t^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\n")
file = open(os.path.expanduser(
"~/Desktop/SnakeGame/snakeprefs.txt"), "w")
file = open(script_path.joinpath("snakeprefs.txt"), "w")
colorhd = "white"
colortl = "blue"
file.write(f"{colorhd}\n{colortl}")
2 changes: 0 additions & 2 deletions snakeprefs.txt

This file was deleted.

Loading

0 comments on commit bf40a84

Please sign in to comment.