def main(): pygame.init() fpsClock = pygame.time.Clock() surf = pygame.display.set_mode((WIDTH, HEIGHT), 0, 32) my_launcher = launcher.Launcher(0, HEIGHT - 20) my_rock = rock.Rock(0, HEIGHT - 20) #TODO while True: for event in pygame.event.get(): if event.type == pygame.KEYDOWN: if event.key == pygame.K_UP: my_launcher.changeAngle(3) if event.key == pygame.K_DOWN: my_launcher.changeAngle(-3) if event.key == pygame.K_RIGHT: my_launcher.changeMagnitude(5) if event.key == pygame.K_LEFT: my_launcher.changeMagnitude(-5) if (event.key == pygame.K_SPACE) and (not my_rock.ismoving()): my_launcher.fire(my_rock) if event.type == QUIT: pygame.quit() sys.exit() #2. Do game logic my_rock.move(1.0 / FPS) # 3. Draw everything draw_world(surf) my_launcher.draw_launcher(surf) my_rock.draw(surf) pygame.display.update() fpsClock.tick(FPS)
def __init__(self): super(MainWindow, self).__init__() self.launcher = hexine.Launcher() self.ui = uic.loadUi("hexine.ui", self) self.initUI() self.selectedPlace = None self.username = ""
def main(): pygame.init() fpsClock = pygame.time.Clock() my_serial = serial.Serial("/dev/ttyACM0") my_launcher = launcher.Launcher(0, 400) my_rock = rock.Rock(0, 400) my_target = target.Target(random.random() * 280 + 100, 390) window = pygame.display.set_mode((500, 400)) pygame.display.set_caption('Lab 2 Stone') while (True): draw_world(window) mag_alt = read_arduino(my_serial) for event in pygame.event.get(): if event.type == pygame.KEYDOWN: if event.key == pygame.K_UP: my_launcher.changeAngle(.05236) elif event.key == pygame.K_DOWN: my_launcher.changeAngle(-.05236) elif event.key == pygame.K_LEFT: my_launcher.changeMagnitude(-3) elif event.key == pygame.K_RIGHT: my_launcher.changeMagnitude(3) elif event.key == pygame.K_SPACE and not my_rock.isMoving( ) and not my_target.hit(my_rock, window): my_launcher.fire(my_rock) elif event.key == pygame.K_r: my_serial.write('r') elif event.key == pygame.K_g: my_serial.write('g') if event.type == QUIT: pygame.quit() sys.exit() my_rock.move(1.0 / FPS) my_launcher.Alt_Mag(mag_alt) if (my_rock.y > 400): my_rock.moveto(0, 400, window) displaytxt("You Missed!!", window) if my_target.hit == True: my_rock.moveto(0, 400, window) displaytxt("Good Hit!!", window) my_target.moveTo(random.random() * 280 + 100, 390) my_launcher.draw(window) my_rock.draw(window) my_target.draw(window) pygame.display.update() fpsClock.tick(FPS)
def main(): pygame.init() pygame.display.init() fpsClock = pygame.time.Clock() # clock object SURF = pygame.display.set_mode((WIDTH, HEIGHT)) # creates game box pygame.display.set_caption('Launchr') # window title my_launcher = launcher.Launcher(0, (HEIGHT - 20)) my_rock = rock.Rock(0, (HEIGHT - 20)) my_target = target.Target(100 + (random.random() * WIDTH - 100), HEIGHT - 20, TARGET_WIDTH) while True: # main game loop for event in pygame.event.get(KEYUP): if event.key == pygame.K_UP: my_launcher.changeAngle(3) if event.key == pygame.K_DOWN: my_launcher.changeAngle(-3) if event.key == pygame.K_RIGHT: my_launcher.changeMagnitude(5) if event.key == pygame.K_LEFT: my_launcher.changeMagnitude(-5) if (event.key == pygame.K_SPACE) and (my_rock.isMoving() == False): my_launcher.fire(my_rock) if event.type == QUIT: pygame.quit() sys.exit() # game logic my_rock.move(1.0 / FPS) if (my_rock.y > HEIGHT - 19): my_rock.moveTo(0, HEIGHT - 20) displayText("You missed!", SURF) if my_target.hitBy(my_rock): my_rock.moveTo(0, HEIGHT - 20) displayText("Got eeeem", SURF) # Updates game screen draw_world(SURF) my_launcher.draw_launcher(SURF) my_target.draw_target(SURF) my_rock.draw_rock(SURF) pygame.display.update() fpsClock.tick(FPS)
import statusVars as status import launcher import sys sys.path.insert(0, '../../userData') from activeUsers import activeUsers gameLauncher = launcher.Launcher() class AbsenceModule: memory = dict() def getAnswer(self, answers, quickAnswers): resultQuery = list() for answer in answers: curQuery = {} curQuery['answered'] = True curQuery['generatedText'] = answer resultQuery.append(curQuery) resultQuery[-1]['quickAnswers'] = quickAnswers return resultQuery def nextStep(self, userId, userText): if (self.memory.get(userId) == None): self.memory[userId] = 1 return ("COUNTINUE", self.getAnswer(["Вы уверены?"], ["Да", "Нет"]))
def createLauncher(self): self.launcher = launcher.Launcher(socket.gethostname().lower(), session=self.session, managerlocation=self.location()) self.onAddLauncherPanel(self.launcher)
# or RCSL, indicate your decision by deleting Paragraph 1 above # and replace them with the notice and other provisions required by # the GPL. If you do not delete Paragraph 1 above, a recipient may # use your version of this file under the terms of any one of the # RPSL, the RCSL or the GPL. # # This file is part of the Helix DNA Technology. RealNetworks is the # developer of the Original Code and owns the copyrights in the # portions it created. Copying, including reproducing, storing, # adapting or translating, any or all of this material other than # pursuant to the license terms referred to above requires the prior # written consent of RealNetworks and its licensors # # This file, and the files included with this file, is distributed # and made available by RealNetworks on an 'AS IS' basis, WITHOUT # WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, AND REALNETWORKS # AND ITS LICENSORS HEREBY DISCLAIM ALL SUCH WARRANTIES, INCLUDING # WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, FITNESS # FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. # # Technology Compatibility Kit Test Suite(s) Location: # http://www.helixcommunity.org/content/tck # # Contributor(s): # # ***** END LICENSE BLOCK ***** # import launcher tool = launcher.Launcher('armerge') tool.run()
#!/usr/bin/python import random import pygame from colors import * from pygame.locals import * #needed for QUIT function to work from game_func import * #object modules import launcher import rock import target pygame.init() fpsClock = pygame.time.Clock() window = pygame.display.set_mode((WINDOWWIDTH, WINDOWHEIGHT)) my_launcher = launcher.Launcher(0, WINDOWHEIGHT - 20) my_rock = rock.Rock(0, WINDOWHEIGHT - 20) #my_target = target.Target((random.random()*280)+100, WINDOWHEIGHT-20) my_target = target.Target(150, WINDOWHEIGHT - 20) FIRED = False #and ((my_target.y+5)<my_rock.y and my_rock.y < (my_target.y-5) ) def isHit(): if (((my_target.x - 20) < my_rock.x and my_rock.x < (my_target.x + 20)) and ((my_target.y - 5) > my_rock.y and my_rock.y < (my_target.y + 5))): return True else: return False
# and replace them with the notice and other provisions required by # the GPL. If you do not delete Paragraph 1 above, a recipient may # use your version of this file under the terms of any one of the # RPSL, the RCSL or the GPL. # # This file is part of the Helix DNA Technology. RealNetworks is the # developer of the Original Code and owns the copyrights in the # portions it created. Copying, including reproducing, storing, # adapting or translating, any or all of this material other than # pursuant to the license terms referred to above requires the prior # written consent of RealNetworks and its licensors # # This file, and the files included with this file, is distributed # and made available by RealNetworks on an 'AS IS' basis, WITHOUT # WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, AND REALNETWORKS # AND ITS LICENSORS HEREBY DISCLAIM ALL SUCH WARRANTIES, INCLUDING # WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, FITNESS # FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. # # Technology Compatibility Kit Test Suite(s) Location: # http://www.helixcommunity.org/content/tck # # Contributor(s): # # ***** END LICENSE BLOCK ***** # import launcher tool = launcher.Launcher('pyar') tool.run()
# or RCSL, indicate your decision by deleting Paragraph 1 above # and replace them with the notice and other provisions required by # the GPL. If you do not delete Paragraph 1 above, a recipient may # use your version of this file under the terms of any one of the # RPSL, the RCSL or the GPL. # # This file is part of the Helix DNA Technology. RealNetworks is the # developer of the Original Code and owns the copyrights in the # portions it created. Copying, including reproducing, storing, # adapting or translating, any or all of this material other than # pursuant to the license terms referred to above requires the prior # written consent of RealNetworks and its licensors # # This file, and the files included with this file, is distributed # and made available by RealNetworks on an 'AS IS' basis, WITHOUT # WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, AND REALNETWORKS # AND ITS LICENSORS HEREBY DISCLAIM ALL SUCH WARRANTIES, INCLUDING # WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, FITNESS # FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. # # Technology Compatibility Kit Test Suite(s) Location: # http://www.helixcommunity.org/content/tck # # Contributor(s): # # ***** END LICENSE BLOCK ***** # import launcher tool = launcher.Launcher('rlink') tool.run()
# or RCSL, indicate your decision by deleting Paragraph 1 above # and replace them with the notice and other provisions required by # the GPL. If you do not delete Paragraph 1 above, a recipient may # use your version of this file under the terms of any one of the # RPSL, the RCSL or the GPL. # # This file is part of the Helix DNA Technology. RealNetworks is the # developer of the Original Code and owns the copyrights in the # portions it created. Copying, including reproducing, storing, # adapting or translating, any or all of this material other than # pursuant to the license terms referred to above requires the prior # written consent of RealNetworks and its licensors # # This file, and the files included with this file, is distributed # and made available by RealNetworks on an 'AS IS' basis, WITHOUT # WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, AND REALNETWORKS # AND ITS LICENSORS HEREBY DISCLAIM ALL SUCH WARRANTIES, INCLUDING # WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, FITNESS # FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. # # Technology Compatibility Kit Test Suite(s) Location: # http://www.helixcommunity.org/content/tck # # Contributor(s): # # ***** END LICENSE BLOCK ***** # import launcher tool = launcher.Launcher( 'pylink' ) tool.run()
del balls[i] return balls plane1 = 'Y' plane2 = 'Z' screen = ph.get_screen(params.length, params.width) clock = pygame.time.Clock() screw = sf.get_screws_mats(params.omegas, params.qs_or_vs, params.rot_joints) screw = sf.sep_screws_to_one_mat(screw) robot = arm.Robot(params.Ms, screw, screen) launcher = launcher.Launcher(screen) balls = [] cooldown = 1.5 last_shot = time.time() time_steps_needed = 5 times = [] while True: ph.fill_screen(screen, params.background_color) for event in pygame.event.get(): if event.type == pygame.QUIT: break pygame.quit()
import serial import pygame, sys, random, time from pygame.locals import * import launcher import rock import target from color import * #Set up Window pygame.init() surf = pygame.display.set_mode((400, 400), 0, 32) #Set up launcher my_launcher = launcher.Launcher(0, 380) my_rock = rock.Rock(0, 380) my_target = target.Target((random.random() * 280) + 100, 380) objs = [my_launcher, my_rock, my_target] #Set up FPS FPS = 120 fpsClock = pygame.time.Clock() #Drawing world def draw_world(surf): surf.fill(BLUE) fontObj = pygame.font.Font('freesansbold.ttf', 32) textSurfaceObj = fontObj.render('Launchr 1.0', True, GREEN, BLUE)
# or RCSL, indicate your decision by deleting Paragraph 1 above # and replace them with the notice and other provisions required by # the GPL. If you do not delete Paragraph 1 above, a recipient may # use your version of this file under the terms of any one of the # RPSL, the RCSL or the GPL. # # This file is part of the Helix DNA Technology. RealNetworks is the # developer of the Original Code and owns the copyrights in the # portions it created. Copying, including reproducing, storing, # adapting or translating, any or all of this material other than # pursuant to the license terms referred to above requires the prior # written consent of RealNetworks and its licensors # # This file, and the files included with this file, is distributed # and made available by RealNetworks on an 'AS IS' basis, WITHOUT # WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, AND REALNETWORKS # AND ITS LICENSORS HEREBY DISCLAIM ALL SUCH WARRANTIES, INCLUDING # WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, FITNESS # FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. # # Technology Compatibility Kit Test Suite(s) Location: # http://www.helixcommunity.org/content/tck # # Contributor(s): # # ***** END LICENSE BLOCK ***** # import launcher tool = launcher.Launcher('rebase') tool.run()
def test_init(self): launcher.Launcher()
def main(): # start up pygame and build a game window pygame.init() fpsClock=pygame.time.Clock() window = pygame.display.set_mode((WIDTH,HEIGHT),0,32) pygame.display.set_caption('Launchr') s = serial.Serial("/dev/ttyACM1",timeout=0.5) # create custom objects my_launcher = launcher.Launcher(0,HEIGHT-20) my_rock = rock.Rock(0,HEIGHT-20) my_target = target.Target((random.random()*280)+50, HEIGHT-20, TARGET_WIDTH) objs = [my_launcher, my_rock, my_target] # Main game loop while(True): # 1 Process Events for event in pygame.event.get(): if event.type == pygame.KEYDOWN: """arduino controls launcher mag/angle if event.key == pygame.K_UP: my_launcher.changeAngle(3) if event.key == pygame.K_DOWN: my_launcher.changeAngle(-3) if event.key == pygame.K_RIGHT: my_launcher.changeMag(5) if event.key == pygame.K_LEFT: my_launcher.changeMag(-5) """ if ((event.key == pygame.K_SPACE) and not my_rock.isMoving()): my_launcher.fire(my_rock) if event.type == QUIT: pygame.quit() sys.exit() # 2 Update Game State # read from arduino s.write('p') str_data = s.readline() if(len(str_data)>0): data = [int(x) for x in str_data.split(',')] my_launcher.setAngle((data[0]/1024.0)*90) my_launcher.setMag((data[1]/1024.0)*100) my_rock.move(1.0/FPS) # force floating point division if(my_rock.y>HEIGHT): # rock is below the screen my_rock.moveTo(0,HEIGHT-20) s.write('r') displayMessage(window,"Miss!") if(my_target.hitBy(my_rock.getRect())): # rock hit the target! my_rock.moveTo(0,HEIGHT-20) s.write('g') displayMessage(window,"Hit!") my_target.moveTo((random.random()*280)+50) # 3 Update Display drawWorld(window) for obj in objs: obj.draw(window) pygame.display.update() fpsClock.tick(FPS)
from pygame.locals import * import sys import launcher import rock pygame.init() SURF = pygame.display.set_mode((500, 400)) Black = (0, 0, 0) Green = (0, 128, 0) Sky_Blue = (135, 206, 235) FPS = 30 fpsClock = pygame.time.Clock() x = 0 y = 380 my_launcher = launcher.Launcher(x, y) my_rock = rock.Rock(x, y) def main(): while (True): #1. Pygame events for event in pygame.event.get(): if event.type == pygame.KEYDOWN: if event.key == pygame.K_UP: my_launcher.changeAngle(3) if event.key == pygame.K_DOWN: my_launcher.changeAngle(-3) if event.key == pygame.K_LEFT: my_launcher.changeMagnitude(-5) if event.key == pygame.K_RIGHT:
fd = os.open(TRIGGER_FIFO, os.O_WRONLY) if len(sys.argv) > 1: os.write(fd, sys.argv[1]) else: os.write(fd, "show") os.close(fd) exit() if not (len(sys.argv) == 1 or sys.argv[1] == "daemon"): print("no instance running") exit() # globals ENTRY_LAUNCHER = launcher.Launcher() SELECTED_INDEX = -1 # gui globals MAIN_WINDOW = Gtk.Window() SEARCH_BOX = Gtk.Box(orientation=Gtk.Orientation.VERTICAL, spacing=0) RESULT_BOX = Gtk.Box(orientation=Gtk.Orientation.VERTICAL, spacing=0) SEARCH_ENTRY = Gtk.Entry() def exit_by_hide(): MAIN_WINDOW.hide() SEARCH_ENTRY.set_text("") def clicked_label(label_with_entry, _):
# # Copyright (c) 2020 by Alexis LEBEL, BOUDRY Hugo and PEDROSA Théo. All Rights Reserved. # import sys sys.path.insert(0, "ioactions") sys.path.insert(0, "gui/launcher") import csvactions as csvactions import settings as settings import launcher sett = settings.Settings('settings.yaml') launch = launcher.Launcher() #csvpath = "" #settingspath = "" def isFirstRun() -> bool: if sett.isAdminIdNull() and sett.isAdminPWNull(): return True else: return False if isFirstRun(): launch.startFirstRun() else: launch.startLauncher()
# or RCSL, indicate your decision by deleting Paragraph 1 above # and replace them with the notice and other provisions required by # the GPL. If you do not delete Paragraph 1 above, a recipient may # use your version of this file under the terms of any one of the # RPSL, the RCSL or the GPL. # # This file is part of the Helix DNA Technology. RealNetworks is the # developer of the Original Code and owns the copyrights in the # portions it created. Copying, including reproducing, storing, # adapting or translating, any or all of this material other than # pursuant to the license terms referred to above requires the prior # written consent of RealNetworks and its licensors # # This file, and the files included with this file, is distributed # and made available by RealNetworks on an 'AS IS' basis, WITHOUT # WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, AND REALNETWORKS # AND ITS LICENSORS HEREBY DISCLAIM ALL SUCH WARRANTIES, INCLUDING # WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, FITNESS # FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. # # Technology Compatibility Kit Test Suite(s) Location: # http://www.helixcommunity.org/content/tck # # Contributor(s): # # ***** END LICENSE BLOCK ***** # import launcher tool = launcher.Launcher( 'mkdepend' ) tool.run()
# or RCSL, indicate your decision by deleting Paragraph 1 above # and replace them with the notice and other provisions required by # the GPL. If you do not delete Paragraph 1 above, a recipient may # use your version of this file under the terms of any one of the # RPSL, the RCSL or the GPL. # # This file is part of the Helix DNA Technology. RealNetworks is the # developer of the Original Code and owns the copyrights in the # portions it created. Copying, including reproducing, storing, # adapting or translating, any or all of this material other than # pursuant to the license terms referred to above requires the prior # written consent of RealNetworks and its licensors # # This file, and the files included with this file, is distributed # and made available by RealNetworks on an 'AS IS' basis, WITHOUT # WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, AND REALNETWORKS # AND ITS LICENSORS HEREBY DISCLAIM ALL SUCH WARRANTIES, INCLUDING # WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, FITNESS # FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. # # Technology Compatibility Kit Test Suite(s) Location: # http://www.helixcommunity.org/content/tck # # Contributor(s): # # ***** END LICENSE BLOCK ***** # import launcher tool = launcher.Launcher('umake') tool.run()
# and replace them with the notice and other provisions required by # the GPL. If you do not delete Paragraph 1 above, a recipient may # use your version of this file under the terms of any one of the # RPSL, the RCSL or the GPL. # # This file is part of the Helix DNA Technology. RealNetworks is the # developer of the Original Code and owns the copyrights in the # portions it created. Copying, including reproducing, storing, # adapting or translating, any or all of this material other than # pursuant to the license terms referred to above requires the prior # written consent of RealNetworks and its licensors # # This file, and the files included with this file, is distributed # and made available by RealNetworks on an 'AS IS' basis, WITHOUT # WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, AND REALNETWORKS # AND ITS LICENSORS HEREBY DISCLAIM ALL SUCH WARRANTIES, INCLUDING # WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, FITNESS # FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. # # Technology Compatibility Kit Test Suite(s) Location: # http://www.helixcommunity.org/content/tck # # Contributor(s): # # ***** END LICENSE BLOCK ***** # import launcher tool = launcher.Launcher('sign') tool.run()