adding files

cc
This commit is contained in:
2020-12-16 20:47:09 +01:00
commit fa3353c471
62 changed files with 3384 additions and 0 deletions

BIN
assets/images/game/back.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 731 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 352 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 279 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 281 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 280 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 127 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 99 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 968 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 805 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 918 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 522 B

BIN
assets/images/menu/fs.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 586 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 509 B

BIN
assets/images/menu/ms.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 590 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 521 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

BIN
assets/images/menu/play.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 560 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 370 B

0
assets/maps/custom.txt Normal file
View File

0
assets/maps/easy.txt Normal file
View File

0
assets/maps/extreme.txt Normal file
View File

0
assets/maps/hard.txt Normal file
View File

0
assets/maps/medium.txt Normal file
View File

5
assets/maps/tutorial.txt Normal file
View File

@@ -0,0 +1,5 @@
0 1 0 0 0
0 0 0 1 0
0 0 0 0 0
0 3 0 5 1
2 0 0 3 0

View File

@@ -0,0 +1,6 @@
{"background": "#59bdf7",
"backgroundShade": "#81ccf7",
"outline": "#268cc7",
"outline-shade": "#2ba0e3",
"addition": "#1575ad",
"outline-dark": "#09517a"}

View File

@@ -0,0 +1,6 @@
{"background": "#75ebc2",
"backgroundShade": "#4debb4",
"outline": "#9baba5",
"outline-shade": "#81a195",
"addition": "#07db91",
"outline-dark": "#60716a"}

View File

@@ -0,0 +1,6 @@
{"background": "#8818c9",
"backgroundShade": "#8425ba",
"outline": "#dd26e0",
"outline-shade": "#7e38a6",
"addition": "#a716fa",
"outline-dark": "#5b1485"}

View File

@@ -0,0 +1,71 @@
import os
import json
import pygame
from itertools import cycle
pygame.init()
class Palettes:
def __init__(self, path):
self.path = path
self.palettes = {}
self.current_palette = "emerald" # set starting palette here
self.load_palettes()
self.palette = self.get_palette()
self.cycle = None
self.changed = False
def load_palettes(self):
current_dir = os.getcwd()
os.chdir(self.path)
files = os.listdir()
files.remove('palette_manager.py')
try:
files.remove("__pycache__")
except:
pass
for file in files:
with open(file, "r") as f:
fileX = json.load(f)
for color in fileX.keys():
fileX[color] = self.rgb(fileX[color])
file = "".join(list(file)[:-5])
self.palettes[file] = fileX
os.chdir(current_dir)
def get_palette(self):
return self.palettes[self.current_palette]
def swap_image(self, image, old_p, new_p):
for color in self.palettes[old_p].keys():
image = swap_color(image, self.palettes[old_p][color], self.palettes[new_p][color])
return image
def create_cycle(self):
names = self.palettes.keys()
self.cycle = cycle(names)
while next(self.cycle) != self.current_palette:
pass
@staticmethod
def rgb(color):
color = color.strip("#")
color = [int(color[i:i+2], 16) for i in range(0, 5, 2)]
return color
def swap_color(imageX, old, new):
image_copy = pygame.Surface(imageX.copy().get_size())
image_copy.fill(new)
imageX.set_colorkey(old)
image_copy.blit(imageX, [0, 0])
return image_copy

View File

@@ -0,0 +1,6 @@
{"background": "#c9c5c5",
"backgroundShade": "#a3a0a0",
"outline": "#9e2929",
"outline-shade": "#8f6565",
"addition": "#a83939",
"outline-dark": "#610e0e"}

View File

@@ -0,0 +1,6 @@
{"background": "#ff87df",
"backgroundShade": "#f7b2e5",
"outline": "#d94db4",
"outline-shade": "#fe75db",
"addition": "#eb3bbc",
"outline-dark": "#97316b"}

View File

@@ -0,0 +1,6 @@
{"background": "#faf9de",
"backgroundShade": "#f2f2df",
"outline": "#c7c689",
"outline-shade": "#ccca5e",
"addition": "#fffd6e",
"outline-dark": "#474731"}

11
assets/saves/default.json Normal file
View File

@@ -0,0 +1,11 @@
{
"difficulty": "easy",
"palette": "emerald",
"tutorial": true,
"easy": false,
"medium": false,
"hard": false,
"extreme": false,
"custom": false,
"custom_num": "22"
}

View File

@@ -0,0 +1 @@
{}

View File

@@ -0,0 +1 @@
{}

View File

@@ -0,0 +1 @@
{}

View File

@@ -0,0 +1 @@
{}

View File

@@ -0,0 +1 @@
{}

11
assets/saves/setup.json Normal file
View File

@@ -0,0 +1,11 @@
{
"difficulty": "easy",
"palette": "emerald",
"tutorial": true,
"easy": false,
"medium": false,
"hard": false,
"extreme": false,
"custom": false,
"custom_num": "22"
}

BIN
assets/sounds/click.wav Normal file

Binary file not shown.

BIN
assets/sounds/join.wav Normal file

Binary file not shown.

BIN
assets/sounds/remove.wav Normal file

Binary file not shown.

View File

@@ -0,0 +1,239 @@
{
"difficulty": "tutorial",
"connections": [
{
"pos": [
0,
0
],
"bridges": [
{
"bridge_num": 0,
"connection": null
},
{
"bridge_num": 0,
"connection": null
},
{
"bridge_num": 1,
"connection": [
3,
0
]
},
{
"bridge_num": 0,
"connection": null
}
],
"bridge_occupied": 1,
"locked": true
},
{
"pos": [
1,
0
],
"locked": true
},
{
"pos": [
1,
1
],
"bridges": [
{
"bridge_num": 0,
"connection": null
},
{
"bridge_num": 0,
"connection": null
},
{
"bridge_num": 2,
"connection": [
3,
1
]
},
{
"bridge_num": 0,
"connection": null
}
],
"bridge_occupied": 2,
"locked": true
},
{
"pos": [
1,
4
],
"bridges": [
{
"bridge_num": 0,
"connection": null
},
{
"bridge_num": 0,
"connection": null
},
{
"bridge_num": 0,
"connection": null
},
{
"bridge_num": 0,
"connection": null
}
],
"bridge_occupied": 0,
"locked": true
},
{
"pos": [
2,
0
],
"locked": true
},
{
"pos": [
2,
1
],
"locked": true
},
{
"pos": [
3,
0
],
"bridges": [
{
"bridge_num": 0,
"connection": null
},
{
"bridge_num": 0,
"connection": null
},
{
"bridge_num": 0,
"connection": null
},
{
"bridge_num": 1,
"connection": [
0,
0
]
}
],
"bridge_occupied": 1,
"locked": true
},
{
"pos": [
3,
1
],
"bridges": [
{
"bridge_num": 0,
"connection": null
},
{
"bridge_num": 1,
"connection": [
3,
3
]
},
{
"bridge_num": 1,
"connection": [
4,
1
]
},
{
"bridge_num": 2,
"connection": [
1,
1
]
}
],
"bridge_occupied": 4,
"locked": true
},
{
"pos": [
3,
2
],
"locked": true
},
{
"pos": [
3,
3
],
"bridges": [
{
"bridge_num": 1,
"connection": [
3,
1
]
},
{
"bridge_num": 0,
"connection": null
},
{
"bridge_num": 0,
"connection": null
},
{
"bridge_num": 0,
"connection": null
}
],
"bridge_occupied": 1,
"locked": true
},
{
"pos": [
4,
1
],
"bridges": [
{
"bridge_num": 0,
"connection": null
},
{
"bridge_num": 0,
"connection": null
},
{
"bridge_num": 0,
"connection": null
},
{
"bridge_num": 1,
"connection": [
3,
1
]
}
],
"bridge_occupied": 1,
"locked": true
}
]
}