adding files
cc
BIN
assets/images/game/back.png
Normal file
After Width: | Height: | Size: 1.0 KiB |
BIN
assets/images/game/back_hover.png
Normal file
After Width: | Height: | Size: 731 B |
BIN
assets/images/game/num_circle.png
Normal file
After Width: | Height: | Size: 352 B |
BIN
assets/images/game/num_circle_hover.png
Normal file
After Width: | Height: | Size: 279 B |
BIN
assets/images/game/tutorial_circle.png
Normal file
After Width: | Height: | Size: 281 B |
BIN
assets/images/game/tutorial_circle_hover.png
Normal file
After Width: | Height: | Size: 280 B |
BIN
assets/images/general/hashi_logo.ico
Normal file
After Width: | Height: | Size: 127 KiB |
BIN
assets/images/general/hashi_logo.png
Normal file
After Width: | Height: | Size: 99 KiB |
BIN
assets/images/menu/arrow.png
Normal file
After Width: | Height: | Size: 968 B |
BIN
assets/images/menu/arrow_hover.png
Normal file
After Width: | Height: | Size: 805 B |
BIN
assets/images/menu/continue.png
Normal file
After Width: | Height: | Size: 1.9 KiB |
BIN
assets/images/menu/continue_hover.png
Normal file
After Width: | Height: | Size: 1.7 KiB |
BIN
assets/images/menu/custom.png
Normal file
After Width: | Height: | Size: 918 B |
BIN
assets/images/menu/custom_pressed.png
Normal file
After Width: | Height: | Size: 522 B |
BIN
assets/images/menu/fs.png
Normal file
After Width: | Height: | Size: 586 B |
BIN
assets/images/menu/fs_hover.png
Normal file
After Width: | Height: | Size: 509 B |
BIN
assets/images/menu/ms.png
Normal file
After Width: | Height: | Size: 590 B |
BIN
assets/images/menu/ms_hover.png
Normal file
After Width: | Height: | Size: 521 B |
BIN
assets/images/menu/new_game.png
Normal file
After Width: | Height: | Size: 2.0 KiB |
BIN
assets/images/menu/new_game_hover.png
Normal file
After Width: | Height: | Size: 1.8 KiB |
BIN
assets/images/menu/palette.png
Normal file
After Width: | Height: | Size: 1.2 KiB |
BIN
assets/images/menu/palette_hover.png
Normal file
After Width: | Height: | Size: 1.2 KiB |
BIN
assets/images/menu/play.png
Normal file
After Width: | Height: | Size: 2.0 KiB |
BIN
assets/images/menu/play_hover.png
Normal file
After Width: | Height: | Size: 1.6 KiB |
BIN
assets/images/menu/template.png
Normal file
After Width: | Height: | Size: 1.1 KiB |
BIN
assets/images/menu/template_hover.png
Normal file
After Width: | Height: | Size: 560 B |
BIN
assets/images/menu/writing.png
Normal file
After Width: | Height: | Size: 370 B |
0
assets/maps/custom.txt
Normal file
0
assets/maps/easy.txt
Normal file
0
assets/maps/extreme.txt
Normal file
0
assets/maps/hard.txt
Normal file
0
assets/maps/medium.txt
Normal file
5
assets/maps/tutorial.txt
Normal 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
|
BIN
assets/palettes/__pycache__/palette_manager.cpython-39.pyc
Normal file
6
assets/palettes/aqua.json
Normal file
@@ -0,0 +1,6 @@
|
||||
{"background": "#59bdf7",
|
||||
"backgroundShade": "#81ccf7",
|
||||
"outline": "#268cc7",
|
||||
"outline-shade": "#2ba0e3",
|
||||
"addition": "#1575ad",
|
||||
"outline-dark": "#09517a"}
|
6
assets/palettes/emerald.json
Normal file
@@ -0,0 +1,6 @@
|
||||
{"background": "#75ebc2",
|
||||
"backgroundShade": "#4debb4",
|
||||
"outline": "#9baba5",
|
||||
"outline-shade": "#81a195",
|
||||
"addition": "#07db91",
|
||||
"outline-dark": "#60716a"}
|
6
assets/palettes/lavender.json
Normal file
@@ -0,0 +1,6 @@
|
||||
{"background": "#8818c9",
|
||||
"backgroundShade": "#8425ba",
|
||||
"outline": "#dd26e0",
|
||||
"outline-shade": "#7e38a6",
|
||||
"addition": "#a716fa",
|
||||
"outline-dark": "#5b1485"}
|
71
assets/palettes/palette_manager.py
Normal 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
|
6
assets/palettes/reddish.json
Normal file
@@ -0,0 +1,6 @@
|
||||
{"background": "#c9c5c5",
|
||||
"backgroundShade": "#a3a0a0",
|
||||
"outline": "#9e2929",
|
||||
"outline-shade": "#8f6565",
|
||||
"addition": "#a83939",
|
||||
"outline-dark": "#610e0e"}
|
6
assets/palettes/sakura.json
Normal file
@@ -0,0 +1,6 @@
|
||||
{"background": "#ff87df",
|
||||
"backgroundShade": "#f7b2e5",
|
||||
"outline": "#d94db4",
|
||||
"outline-shade": "#fe75db",
|
||||
"addition": "#eb3bbc",
|
||||
"outline-dark": "#97316b"}
|
6
assets/palettes/vanilla.json
Normal 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
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"difficulty": "easy",
|
||||
"palette": "emerald",
|
||||
"tutorial": true,
|
||||
"easy": false,
|
||||
"medium": false,
|
||||
"hard": false,
|
||||
"extreme": false,
|
||||
"custom": false,
|
||||
"custom_num": "22"
|
||||
}
|
1
assets/saves/game_saves/custom.json
Normal file
@@ -0,0 +1 @@
|
||||
{}
|
1
assets/saves/game_saves/easy.json
Normal file
@@ -0,0 +1 @@
|
||||
{}
|
1
assets/saves/game_saves/extreme.json
Normal file
@@ -0,0 +1 @@
|
||||
{}
|
1
assets/saves/game_saves/hard.json
Normal file
@@ -0,0 +1 @@
|
||||
{}
|
1
assets/saves/game_saves/medium.json
Normal file
@@ -0,0 +1 @@
|
||||
{}
|
11
assets/saves/setup.json
Normal 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
BIN
assets/sounds/join.wav
Normal file
BIN
assets/sounds/remove.wav
Normal file
239
assets/tutorial/tutorial.json
Normal 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
|
||||
}
|
||||
]
|
||||
}
|