Ejemplo n.º 1
0
def main(emailContact):
    emailContact = emailContact
    print("Checking Dependencies... One Minute Please")
    notifyemail.main()
    os.system("clear")
    splash.splashScreen()
    questionFun(emailContact)
Ejemplo n.º 2
0
def main():
    global musicOn

    system("mode con cols=95 lines=31")
    splash.splashScreen()

    mixer.init()
    mixer.music.load("racecar.mp3")
    musicOn = True
    sfx = ["ON" if musicOn else "OFF"]

    print(splash.startMenu().format(sfx[0]))
    gameChoice = splash.menuInput()
    finished = False

    while not finished:
        if gameChoice == 1:
            system('cls')

            # Introduction text
            intro.intro1()

            # Make player
            Player1 = characterClass.make_player()

            # Give starting items
            Player1.addItem(itemGen.Weapon("Wooden Sword", 10, 3, 15, 20))
            Player1.addItem(itemGen.Potion("Health Potion", 20))

            # Combat testing lines (normally commented out):
            # combat_loop(Player1, characterClass.Enemy("Zombie", 50, 20))
            # combat_loop(Player1, characterClass.Boss("Leeroy", 100, 50, "Guardian"))

            mixer.music.play(-1)
            if not musicOn:
                mixer.music.pause()

            # Introduction text #2
            intro.intro2()
            finished = True

        elif gameChoice == 2:
            Player1 = loadGame()
            mixer.music.play(-1)

            if not musicOn:
                mixer.music.pause()
            finished = True

        elif gameChoice == 3:
            music_switch()
            sfx = ["ON" if musicOn else "OFF"]
            print(splash.startMenu().format(sfx[0]))
            gameChoice = splash.menuInput()

        else:
            quit()

    # Build map
    refresh_map(Player1)
    map_setup()

    # Gameplay loop
    while True:
        mapList.print_map(Player1, gameMap)
        player_move(Player1)
Ejemplo n.º 3
0
    def __init__(self):

        splashScreen()
        pygame.init()
        if not pygame.font.get_init():
            pygame.font.init()
            if not pygame.font.get_init():
                raise RuntimeError("pygame doesn't init")

        self.width = 1000
        self.height = 600
        self.size = self.width, self.height
        self.screen = pygame.display.set_mode(self.size)
        pygame.display.set_caption("Clue-Less!")
        '''This is for a Start menu 
        '''
        WHITE = (255, 255, 255)
        RED = (255, 0, 0)
        menu_items = ('Search', 'Local', 'Enter' 'Quit')
        self.items = []
        self.font = 'freesansbold.ttf'
        self.fontSize = 30
        self.font = pygame.font.Font(self.font, self.fontSize)
        if not self.font:
            print("No font.")
        func = {
            'Search for Game': print("Searching..."),
            'Play Local': print("Playing local..."),
            'Enter server address.': print("Entering address"),
            'Quit': sys.exit
        }
        for item in enumerate(func.keys()):
            # t _h: total height of text block
            t_h = len(func.keys())
            pos_x = (0)
            # This line includes a bug fix by Ariel (Thanks!)
            # Please check the comments section of pt. 2 for an explanation
            pos_y = (0)
            self.fontPos = pos_x, pos_y
            self.items.append(func.keys())
            self.font.render(str(item), True, WHITE, self.fontPos)

        self.mouse_is_visible = True
        self.cur_item = None
        '''End of Start menu
        '''

        self.titleMessage = "Welcome to Clue-Less..."
        self.serverMessage = ""
        self.serverOptions = []
        self.serverOptionsButtons = []
        self.cardsP = []
        self.cardsR = []
        self.cardsW = []

        #initialize pygame clock
        self.clock = pygame.time.Clock()

        #clear the screen
        self.screen.fill(0)

        self.locations = []
        self.locations.append(LocationIcon(530, 130, "study.jpg"))
        self.locations.append(LocationIcon(730, 130, "hall.jpg"))
        self.locations.append(LocationIcon(930, 130, "lounge.jpg"))

        self.locations.append(LocationIcon(530, 330, "library.jpg"))
        self.locations.append(LocationIcon(730, 330, "billiard.jpg"))
        self.locations.append(LocationIcon(930, 330, "dining.jpg"))

        self.locations.append(LocationIcon(530, 530, "conservatory.jpg"))
        self.locations.append(LocationIcon(730, 530, "ballroom.jpg"))
        self.locations.append(LocationIcon(930, 530, "kitchen.jpg"))

        #Hallways
        self.locations.append(LocationIcon(630, 130, "hallway_horiz.jpg"))
        self.locations.append(LocationIcon(830, 130, "hallway_horiz.jpg"))

        self.locations.append(LocationIcon(530, 230, "hallway_vert.jpg"))
        self.locations.append(LocationIcon(730, 230, "hallway_vert.jpg"))
        self.locations.append(LocationIcon(930, 230, "hallway_vert.jpg"))

        self.locations.append(LocationIcon(630, 330, "hallway_horiz.jpg"))
        self.locations.append(LocationIcon(830, 330, "hallway_horiz.jpg"))

        self.locations.append(LocationIcon(530, 430, "hallway_vert.jpg"))
        self.locations.append(LocationIcon(730, 430, "hallway_vert.jpg"))
        self.locations.append(LocationIcon(930, 430, "hallway_vert.jpg"))

        self.locations.append(LocationIcon(630, 530, "hallway_horiz.jpg"))
        self.locations.append(LocationIcon(830, 530, "hallway_horiz.jpg"))

        self.playerIcons = []
        self.playerIcons.append(PlayerIcon("scarlet.jpg"))
        self.playerIcons.append(PlayerIcon("mustard.jpg"))
        self.playerIcons.append(PlayerIcon("white.jpg"))
        self.playerIcons.append(PlayerIcon("green.jpg"))

        self.gameStarted = False

        self.numPlayers = 0

        try:
            #To use local active IP address
            s = socket(AF_INET, SOCK_DGRAM)
            s.connect(('8.8.8.8', 80))
            localIP = s.getsockname()
            #print(localIP)
            s.close()
            splitIP = str(localIP).split('.')
            onlyIP = str(localIP).split('\'')
            splitIP[3:] = (['0/24'])
            IPRange = ".".join(splitIP)
            #Not needed but saving it
            splitFields = str(localIP).split(',')
            splitIP[1:] = (['55123'])
            newAddress = ",".join(splitFields)
            myLink = (str(onlyIP[1]), 55123)
        except:
            print("No network connection found, trying localhost.")
            myLink = ('localhost', 55123)

        ##wanLink for testing remote game
        wanLink = ('10.10.4.176', 55123)

        #Use this for above ip
        print("STARTING CLIENT ON " + str(myLink))
        #self.Connect(wanLink)
        #The following uses localhost ip
        #print("STARTING CLIENT ON " + str(myLink))
        self.Connect(myLink)
        '''
Ejemplo n.º 4
0
#!/usr/bin/env python
"""Clone wars simulator.

Simulates the growth of clones in a 2D space.
Mutations are induced by button presses.

Currently untested.
"""

import splash
splash.splashScreen("CloneWars!", rotation=270)

import signal
import sys
import RPi.GPIO as GPIO

try:
    import numpy as np
except ImportError:
    import numpyReplace as np

from UnicornWF import UnicornSimulator

# Need to check the pin numbers
RED_BUTTON_GPIO = 21
BLUE_BUTTON_GPIO = 16
GREEN_BUTTON_GPIO = 12
BLACK_BUTTON_GPIO = 25

GPIO.setmode(GPIO.BCM)
buttons = [
Ejemplo n.º 5
0
        helpMenu = Menu(menuBar, tearoff=0)
        helpMenu.add_command(label="Context Help",
                             command=lambda: notImplementedHelp(self))
        helpMenu.add_command(label="Documentation",
                             command=lambda: notImplementedHelp(self))
        helpMenu.add_command(label="About", command=lambda: info(self))
        menuBar.add_cascade(label="Help", menu=helpMenu)


if __name__ == '__main__':
    '''
    Main Method, OpenAccounting application start-up
    @summary: Starts the splash screen the when that is closed, the application window opens 
    @warning: the application starts with what ever data is in the app directory, AccountDB.db
        If no such database files exist they can be created as new.
        @author: David York 11/7/2018
        @version: 0.20
    '''
    spl = splash.splashScreen()
    asys = AccountingSystem()
    w = (2 * asys.win.winfo_screenwidth()) / 3
    h = (3 * asys.win.winfo_screenheight()) / 4
    asys.win.geometry("%dx%d+0+0" % (w, h))
    '''
    @attention: the following solution to center the app comes from stackoverflow:
    @author:  idbrii Jan 17 '17 at 19:11, 
    https://stackoverflow.com/questions/3352918/how-to-center-a-window-on-the-screen-in-tkinter
    @accessed: 11/7/2018 12:35PM
    '''
    asys.win.eval('tk::PlaceWindow %s center' % asys.win.winfo_toplevel())
    asys.win.mainloop()