Пример #1
0
# -*- coding: Utf-8 -*

import configparser
from typing import Any
from my_pygame import set_constant_file, set_constant_directory
from my_pygame import Resources
from navy import NavyWindow
from four_in_a_row import FourInARowWindow

RESOURCES = Resources()

RESOURCES_FOLDER = set_constant_directory("resources", "py_game_case", special_msg="Resources folder not present")
IMG_FOLDER = set_constant_directory(RESOURCES_FOLDER, "img", special_msg="Images folder not present")

RESOURCES.IMG = {
    "icon": set_constant_file(IMG_FOLDER, "icon.surface"),
    "logo": set_constant_file(IMG_FOLDER, "logo.surface"),
}

GAMES = {
    "navy":          {"name": "Navy",       "window": NavyWindow},
    "four_in_a_row": {"name": "4 in a row", "window": FourInARowWindow},
}

RESOURCES.IMG |= {game: set_constant_file(IMG_FOLDER, "preview_{}.surface".format(game)) for game in GAMES}

##########################################################################################################################

class Settings:

    def __init__(self):
Пример #2
0
# -*- coding: Utf-8

from my_pygame import set_constant_directory, set_constant_file
from my_pygame import Resources
from my_pygame import BLUE_DARK

WINDOW_CONFIG_FILE = set_constant_file("window", "four_in_a_row.ini", raise_error=False)

RESOURCES = Resources()

RESOURCES_FOLDER = set_constant_directory("resources", "four_in_a_row", special_msg="Resources folder not present")
IMG_FOLDER = set_constant_directory(RESOURCES_FOLDER, "img", special_msg="Images folder not present")
FONT_FOLDER = set_constant_directory(RESOURCES_FOLDER, "font", special_msg="Fonts folder not present")

RESOURCES.IMG = {
    "icon": set_constant_file(IMG_FOLDER, "icon.ico"),
    "logo": set_constant_file(IMG_FOLDER, "logo.surface"),
    "arrow": set_constant_file(IMG_FOLDER, "Right-Arrow.surface")
}

RESOURCES.FONT = {
    "afterglow": set_constant_file(FONT_FOLDER, "Afterglow-Regular.ttf"),
    "heavy": set_constant_file(FONT_FOLDER, "heavy heap.ttf"),
}

BACKGROUND_COLOR = BLUE_DARK

NB_ROWS = 6
NB_COLUMNS = 7

AI = "AI"
# -*- coding: Utf-8 -*

from my_pygame import set_constant_directory, set_constant_file, RESOURCES

#Dossiers
IMG_FOLDER = set_constant_directory("files", "img")
AUDIO_FOLDER = set_constant_directory("files", "sounds")
FONT_FOLDER = set_constant_directory("files", "fonts")

########## Images ##########
RESOURCES.IMG = {
    ########## Icone ##########
    "icon":
    set_constant_file(IMG_FOLDER, "icone.ico"),
    ########## Logo/Image de fond du jeu ##########
    "logo":
    set_constant_file(IMG_FOLDER, "logo.png"),
    "background":
    set_constant_file(IMG_FOLDER, "wallpaper.jpg"),
    ########## Items ##########
    "red_cross":
    set_constant_file(IMG_FOLDER, "croix_rouge.png"),
    "red_cross_hover":
    set_constant_file(IMG_FOLDER, "croix_rouge_over.png"),
    "blue_arrow":
    set_constant_file(IMG_FOLDER, "blue_arrow.png"),
    "green_arrow":
    set_constant_file(IMG_FOLDER, "green_arrow.png"),
    "green_valid":
    set_constant_file(IMG_FOLDER, "valide.png"),
    "left_arrow":
Пример #4
0
# -*- coding: Utf-8

import os
import sys
from my_pygame import set_constant_directory, set_constant_file
from my_pygame import RESOURCES

RESOURCES_FOLDER = set_constant_directory("resources", special_msg="Resources folder not present")
IMG_FOLDER = set_constant_directory(RESOURCES_FOLDER, "img", special_msg="Images folder not present")
SOUNDS_FOLDER = set_constant_directory(RESOURCES_FOLDER, "sounds", special_msg="Sounds folder not present")

RESOURCES.IMG = {
    "icon": set_constant_file(IMG_FOLDER, "icon.png"),
    "menu_bg": set_constant_file(IMG_FOLDER, "menu_background.jpg"),
    "logo": set_constant_file(IMG_FOLDER, "logo.png"),
    "settings": set_constant_file(IMG_FOLDER, "build_512px.png"),
    "arrow_blue": set_constant_file(IMG_FOLDER, "arrow.png"),
    "reload_blue": set_constant_file(IMG_FOLDER, "reload_blue.png"),
    "random": set_constant_file(IMG_FOLDER, "random.png"),
    "battleship": set_constant_file(IMG_FOLDER, "battleship.png"),
    "destroyer": set_constant_file(IMG_FOLDER, "destroyer.png"),
    "patroal_boat": set_constant_file(IMG_FOLDER, "patroal_boat.png"),
    "carrier": set_constant_file(IMG_FOLDER, "carrier.png"),
    "red_triangle": set_constant_file(IMG_FOLDER, "red_triangle.png"),
    "green_triangle": set_constant_file(IMG_FOLDER, "green_triangle.png"),
    "hatch": set_constant_file(IMG_FOLDER, "hatch.png"),
    "cross": set_constant_file(IMG_FOLDER, "cross.png")
}

RESOURCES.MUSIC = {
    "menu": set_constant_file(SOUNDS_FOLDER, "Move-it-Out.mp3"),