Exemplo n.º 1
0
Arquivo: iOS.py Projeto: rlecaro2/so
  def crearProcesoNuevo(self):
    cmd = str(self.procesoNuevo.value)
    data = cmd.split(';')
    tipo = int(data[2])
    if tipo == 1:
        proc = realizarLlamada(data)
    elif tipo == 2:
        proc = recibirLlamada(data)
    elif tipo == 3:
        proc = enviarMensaje(data)
    elif tipo == 4:
        proc = recibirMensaje(data)
    elif tipo == 5:
        proc = agregarContacto(data)
    elif tipo == 6:
        proc = otro(data)
    elif tipo == 7:
        proc = enviarPosicion(data)
    elif tipo == 8:
        proc = verPosicion(data)
    elif tipo == 9:
        proc = juego(data)
    elif tipo == 10:
        proc = musica(data)

    self.waiting.append(proc)
    self.procesoNuevo.value = ""
Exemplo n.º 2
0
    def leerInput(self, filename):
        stack = fm.leerInput(filename)
        listaProcesos = []
        #hacer hashtable si hay tiempo
        for data in stack:    
            tipo = int(data[2])
            if tipo == 1:
                proc = realizarLlamada(data)
            elif tipo == 2:
                proc = recibirLlamada(data)
            elif tipo == 3:
                proc = enviarMensaje(data)
            elif tipo == 4:
                proc = recibirMensaje(data)
            elif tipo == 5:
                proc = agregarContacto(data)
            elif tipo == 6:
                proc = otro(data)
            elif tipo == 7:
                proc = enviarPosicion(data)
            elif tipo == 8:
                proc = verPosicion(data)
            elif tipo == 9:
                proc = juego(data)
            elif tipo == 10:
                proc = musica(data)

            if proc:
                listaProcesos.append(proc)

        return listaProcesos
Exemplo n.º 3
0
#====================================
#     ---------IMPORTS---------
#====================================
import pygame, sys
from pygame.locals import *
from constantes import *
import menu
import juego

#====================================
#    ----------INICIO----------
#====================================
#------------------Initialize
pygame.init()
DISPLAYSURF = pygame.display.set_mode((ANCHO_SCREEN, ALTO_SCREEN))
pygame.display.set_caption("Cars Race")
fps_clock = pygame.time.Clock()  # Contador de los FPS a los que correrá el juego

#====================================
#     -----------LOOP-----------
#====================================
while True:  # Bucle del programa, cuando se le das a jugar en el menú de inicio (JUGAR), se rompe la función y pasa al juego y viceversa
    #---------------Menú
    menu.menu_inicio(DISPLAYSURF, fps_clock)

    #---------------Juego
    juego.juego(DISPLAYSURF, fps_clock)
Exemplo n.º 4
0
from descripcion import descripcion
from pregunta_nombre import pregunta_nombre
from edad import edad
from juego import juego

descripcion()  #descripcion del juego, titulo,descripcion,objetivo,reglas...
pregunta_nombre(
)  #Importo funcion de pregunta_nombre desde el archivo pregunta_nombre.py
edad()  #pregunta la edad
juego()  #contiene el juego en sí
Exemplo n.º 5
0
#====================================
#     ---------IMPORTS---------
#====================================
import pygame, sys
from pygame.locals import *
from constantes import *
import menu
import juego

#====================================
#    ----------INICIO----------
#====================================
#------------------Initialize
pygame.init()
DISPLAYSURF = pygame.display.set_mode((ANCHO_SCREEN, ALTO_SCREEN))
pygame.display.set_caption("Cars Race")
fps_clock = pygame.time.Clock(
)  # Contador de los FPS a los que correrá el juego

#====================================
#     -----------LOOP-----------
#====================================
while True:  # Bucle del programa, cuando se le das a jugar en el menú de inicio (JUGAR), se rompe la función y pasa al juego y viceversa
    #---------------Menú
    menu.menu_inicio(DISPLAYSURF, fps_clock)

    #---------------Juego
    juego.juego(DISPLAYSURF, fps_clock)
Exemplo n.º 6
0
				print("------------------------------------")
				print("Bienvenido "+usuario)
				print("Las opciones son: ")
				print("1) Iniciar Partida ")
				print("2) Estadisticas")
				print("3) Borrar Historial ")
				print("4) Salir")
				print("------------------------------------")
				print("\n")
		

				opcion = int(input("Escriba el número de la opción elegida  "))

				if(opcion==1):
					print("¡A jugar!")
					puntuacion=juego()
					jugador.aumentarPartida()
					if(puntuacion==0):
						jugador.aumentarPerdida()
					else:
						jugador.aumentarVictoria()
					
						
					
				elif(opcion==2):
					print("Tu historial es: ")
					jugador.print_estadisticas()
				elif(opcion==3):
					print("Se borro tu historial")
					jugador.borrar_historial()
					jugador.print_estadisticas()
menusnake = menu.menu(window)
menusnake.pintarmenu()
usuarios = usuario.listausuarios(window)
puntuaciones = scoreboard.colapuntuacion(window)

while True:
    event = window.getch()

    if event == 54:
        break
    else:
        if event == 49 and not USUARIOACTIVO:
            USUARIOACTIVO = usuarios.mostrarusuarios()
            if USUARIOACTIVO:
                pantallajuego = juego.juego(window, USUARIOACTIVO, TIMEOUT,
                                            PUNTUACION)
                PUNTUACION = pantallajuego.get_score()
                #print(PUNTUACION)
                puntuaciones.Queue(USUARIOACTIVO, PUNTUACION)
                if puntuaciones.size() > 10:
                    puntuaciones.Unqueued()
                window.clear()
                window.border(0)
                menusnake.pintarmenu()
        else:
            if event == 49 and USUARIOACTIVO:
                pantallajuego = juego.juego(window, USUARIOACTIVO, TIMEOUT,
                                            PUNTUACION)
                PUNTUACION = pantallajuego.get_score()
                #print(PUNTUACION)
                puntuaciones.Queue(USUARIOACTIVO, PUNTUACION)