def credits(): clock = pygame.time.Clock() pygame.mixer.music.load('resources/bgmusic.mp3') pygame.mixer.music.play(-1, 0.0) pygame.mixer.music.set_volume(1) screen = pygame.display.set_mode((640, 480)) screen.fill((0, 0, 0)) me = pygame.image.load("resources/me.png") me = pygame.transform.scale(me, (200, 200)) screen.blit(me, (440, 280)) text = "Credits \n _ _ _ _ _ _ _ _ _ _ _ _ \n\n\n Designer /n Creator /n/n Manikiran P" color = 0xa0a0a000 credit(text, pygame.font.Font("resources/captureit.ttf", 32), color) screen.fill((0, 0, 0)) pygame.display.flip() Mainmenu() while 1: clock.tick(30) for event in pygame.event.get(): if event.type == pygame.QUIT: screen.fill((0, 0, 0)) pygame.display.flip() Mainmenu() if event.type == pygame.KEYDOWN and event.key == pygame.K_ESCAPE: screen.fill((0, 0, 0)) pygame.display.flip() Mainmenu() pygame.display.flip()
def credits(): from credit import credit text = """CREDITSS _ _ INVASORES _Creado por_\\Obed Guevara _Sonido_\\http://soundfxnow.com/ \\http://musicaq.net/ _Imagenes_\\http://www.bghq.com/ GRACIAS POR JUGAR!! _ _ ©Copyright 2014""" #~ utiliser '\\' pour aligner les lignes de texte font = pygame.font.Font('font/Dirty Harry.ttf', 13) color = 0xa0a0a000 credit(text,font,color)
def action(self): pygame.mixer.music.stop() acercade_w = pygame.display.set_mode((800,600)) pygame.display.set_caption("Place of dead - [Creditos y mas] ", 'Spine Runtime') text = """CREDITOS _ _ •Historia del juego:\\Juan Diego Hoyos Monroy \\Carolina Jimenez Gomez •Desarrolladores:\\Juan Diego Hoyos Monroy \\Carolina Jimenez Gomez Mayor informacion acerca del juego: https://github.com/jdiegoh3/gameproyect_pygame _ _ ©Copyright 2016""" font = pygame.font.Font("Roboto-MediumItalic.ttf",20) color = 0xa0a0a000 credit(text,font,color) pygame.mixer.music.play(-1)
def test_crediting(self): """ Test the credit function :return: """ self.log.debug('running test_crediting') # calculate the correct values total = { 'tier_1': { 'bid': 0.00, 'ask': 0.00 }, 'tier_2': { 'bid': 0.00, 'ask': 0.00 } } for tier in self.test_data: for user in self.test_data[tier]: for side in self.test_data[tier][user]: total[tier][side] += self.test_data[tier][user][side] # Run the credit on the inserted data credit.credit(self.app, None, self.log, False) # get the credit details from the database conn = sqlite3.connect('pool.db') c = conn.cursor() credit_data = c.execute("SELECT * FROM credits").fetchall() # self.log.debug(credit_data) # check the credits are correct for cred in credit_data: # check the total liquidity is correct this_total = total[cred[5]][cred[6]] self.assertEqual(cred[8], this_total) # check the amount provided is correct this_amount = self.test_data[cred[5]][cred[2]][cred[6]] self.assertEqual(cred[7], this_amount) # check the percentage is correct this_percentage = (this_amount / this_total) * 100 self.assertEqual(cred[9], this_percentage) # check the reward is credited correctly this_reward = (this_percentage / 100) * self.app.config[ '{}.{}.' '{}.{}.reward' ''.format('test_exchange', 'btc', cred[6], cred[5])] # Asert almost equal to avoid rounding errors at 10 d.p. self.assertAlmostEqual(cred[10], this_reward, 15) self.log.debug('ending test_crediting')
def button(message, x, y, w, h, ic, ac, action=None): mouse = p.mouse.get_pos() click = p.mouse.get_pressed() # Define if the mouse is in a rectangle's button # mouse [0] = x-coordinate of the mouse if x + w > mouse[0] > x and y + h > mouse[1] > y: # create active button p.draw.rect(screen, ac, (x, y, w, h)) # click[0] = left click if click[0] == 1 and action is not None: if action == "play": parameter_loop() elif action == "launch": init_simulation(s) elif action == "exit": sys.exit() elif action == "quit": p.quit() quit() elif action == "setting": main() elif action == "credit": c.credit() elif action == "return": game_intro() elif action == "Default": msonde_t0 = 3038 * 10**3 msonde_t1 = msonde_t0 - 2286e3 # After 150sec msonde_t2 = msonde_t1 - 464e3 # After 360sec msonde_t3 = msonde_t2 - 114e3 # After 500sec source(nasa.wikibis.com) s.MASS[0] = 2e30 s.MASS[1] = 5.974e24 s.MASS[2] = 6.419e23 s.MASS[3] = 1.9e27 s.MASS[4] = 5.685e26 s.G = 6.674e-20 s.TIME_STEP = 3600 * 24 parameter_loop() # if the mouse isn't in a rectangle, the color will change else: p.draw.rect(screen, ic, (x, y, w, h)) textSurf, textRect = text_objects(message, smallText) textRect.center = ((x + (w / 2)), ((y + (h / 2)))) screen.blit(textSurf, textRect)
def open_sub_section(self): if self.position_fire==245: self.root.destroy() jeu.jeu(self.email) elif self.position_fire==310: self.root.destroy() import rules as ru ru.rules(self.email) elif self.position_fire==375: self.root.destroy() import score as sc sc.score(self.email) elif self.position_fire==440: self.root.destroy() import credit as cd cd.credit(self.email) elif self.position_fire==505: self.root.destroy()
def test_crediting(self): """ Test the credit function :return: """ self.log.debug('running test_crediting') # calculate the correct values total = { 'tier_1': {'bid': 0.00, 'ask': 0.00}, 'tier_2': {'bid': 0.00, 'ask': 0.00}} for tier in self.test_data: for user in self.test_data[tier]: for side in self.test_data[tier][user]: total[tier][side] += self.test_data[tier][user][side] # Run the credit on the inserted data credit.credit(self.app, None, self.log, False) # get the credit details from the database conn = sqlite3.connect('pool.db') c = conn.cursor() credit_data = c.execute("SELECT * FROM credits").fetchall() # self.log.debug(credit_data) # check the credits are correct for cred in credit_data: # check the total liquidity is correct this_total = total[cred[5]][cred[6]] self.assertEqual(cred[8], this_total) # check the amount provided is correct this_amount = self.test_data[cred[5]][cred[2]][cred[6]] self.assertEqual(cred[7], this_amount) # check the percentage is correct this_percentage = (this_amount / this_total) * 100 self.assertEqual(cred[9], this_percentage) # check the reward is credited correctly this_reward = (this_percentage / 100) * self.app.config['{}.{}.' '{}.{}.reward' ''.format( 'test_exchange', 'btc', cred[6], cred[5])] # Asert almost equal to avoid rounding errors at 10 d.p. self.assertAlmostEqual(cred[10], this_reward, 15) self.log.debug('ending test_crediting')
def parseCredit(self): doc = xml.dom.minidom.parse(self.filename) credits = doc.getElementsByTagName("credit") for Credit in credits: id = Credit.getAttribute("id") clientId = Credit.getAttribute("client") typeOfCreditId = Credit.getAttribute("typeOfCredit") data = Credit.getAttribute("data") cost = Credit.getAttribute("cost") client = self.clientsList[clientId] typeOfCredit = self.typeOfCreditsList[typeOfCreditId] newCredit = credit(typeOfCredit,client,data,cost) newCredit.setId(id) self.creditList[id] = newCredit print(self.creditList)
text = """CREDITS _ _ _Programming_\\John Taylor _Artwork_\\Aaron Guishard \\John Taylor _Game Idea_\\NES Punch Out! _Reddit Pygame_\\metulburr \\iminurnamez \\Mekire _Special Thanks_\\ Jonathan Taylor \\Christian Taylor Visit Our Website for more on Python Gaming. http://www.pythongaming.com _ _ No © Copyright 2015""" font = font.Font("Roboto-MediumItalic.ttf",20) color = 0xa0a0a000 credit(text,font,color)
text = """CREDITS _ _ _Programming_\\John Taylor _Artwork_\\Aaron Guishard \\John Taylor _Game Idea_\\NES Punch Out! _Reddit Pygame_\\metulburr \\iminurnamez \\Mekire _Special Thanks_\\ Jonathan Taylor \\Christian Taylor Visit Our Website for more on Python Gaming. http://www.pythongaming.com _ _ No © Copyright 2015""" font = font.Font("Roboto-MediumItalic.ttf", 20) color = 0xa0a0a000 credit(text, font, color)
from typeOfCredit import types from client import client from credit import credit t = types("Деловой","Быть Деловым Мальчиком",15,"12.10.2020") c = client("Сгу","Государственная","Астраханская 83","500-599","Чумаченко Алексей Николаевич") cr = credit(t,c,"152154","9.10.2018") print(t) print(c) print(cr)