def __init__(self, colour, pos, text, handler=None, rectSize=None, icon=None): if rectSize == None: image = pygame.image.load("assets/elbow_top.png").convert_alpha() size = (image.get_rect().width, image.get_rect().height) else: size = rectSize image = pygame.Surface(rectSize).convert_alpha() #image.fill(colours.TRANSPARENT) #image=image.convert_alpha() self.colour = colours.TRANSPARENT self.image = image self.font = Font("assets/YukonTech.ttf", 20) textImage = self.font.render(text, False, colours.BLUEDARK) image = image.blit( textImage, (image.get_rect().width - textImage.get_rect().width - 170, image.get_rect().height - textImage.get_rect().height - 10)) GeneralWidget.__init__(self, colour, pos, size, handler) self.highlighted = False self.beep = Sound("assets/audio/panel/202.wav")
def handleEvents(self, event, fpsClock): #UserInterface.lastEventTime = datetime.now().timestamp() + config.SCREENSAVER_TIMEOUT_SECONDS if event.type == pygame.MOUSEBUTTONDOWN: # Play sound self.sound_beep1.play() if event.type == pygame.MOUSEBUTTONUP: if (not self.layer2[0].visible): for sprite in self.layer1: sprite.visible = False for sprite in self.layer2: sprite.visible = True Sound("assets/audio/enter_authorization_code.wav").play() elif (self.pin_i == len(str(config.PIN))): # Ran out of button presses if (self.correct == len(config.PIN)): self.sound_granted.play() #from screens.main import ScreenMain #self.loadScreen(ScreenMain()) UserInterface.Authorised = True self.returnScreen() else: self.sound_deny2.play() self.sound_denied.play() self.reset() return False
def __init__( self, colour, pos, message, textSize=None, background=None, handler=None, fontFace=None ): #textSize=.75 & fontFace="assets/OpenSansCondensed-Light.ttf"): self.colour = colour self.currcolour = colour self.background = background self.togglevalue = False if textSize == None and fontFace == None: self.font = _defaulttextfont else: if textSize == None: textSize = .75 if fontFace == None: fontFace = "assets/OpenSansCondensed-Light.ttf" self.font = Font(fontFace, int(50.0 * textSize)) self.renderText(message) if (pos[1] < 0): pos = (pos[0], (config.RESOLUTION[0] / 2) - self.image.get_rect().width / 2) LcarsWidget.__init__(self, colour, pos, None, handler) self.beep = Sound("assets/audio/panel/202.wav")
def __init__(self, colour, pos, text, handler=None, rectSize=None, icon=None): if rectSize == None: image = pygame.image.load("assets/power_small_cyantest.png") size = (image.get_rect().width, image.get_rect().height) else: size = rectSize image = pygame.Surface(rectSize).convert_alpha() image.fill(colour) self.colour = colour self.image = image.convert_alpha() #font = Font("assets/swiss911.ttf", 8) #textImage = font.render(text, False, colours.BLACK) #image.blit(textImage, # (image.get_rect().width - textImage.get_rect().width - 10, # image.get_rect().height - textImage.get_rect().height - 5)) #if not icon==None: # image.blit(icon, (10,10)) PowerWidget.__init__(self, colour, pos, size, handler) #self.applyColour(colour) self.highlighted = False self.beep = Sound("assets/audio/panel/202.wav")
def __init__(self, colour, pos, text, handler=None, rectSize=None, icon=None): if rectSize == None: image = pygame.image.load("assets/button.png").convert_alpha() size = (image.get_rect().width, image.get_rect().height) else: size = rectSize image = pygame.Surface(rectSize) image.fill(colour) #image=image.convert_alpha() self.colour = colour self.image = image self.font = Font("assets/YukonTech.ttf", 18) textImage = self.font.render(text, False, colours.BLACK) image = image.blit( textImage, (image.get_rect().width - textImage.get_rect().width - 10, image.get_rect().height - textImage.get_rect().height - 5)) LcarsWidget.__init__(self, colour, pos, size, handler) self.applyColour(colour) self.highlighted = False self.beep = Sound("assets/audio/panel/202.wav")
def __init__(self, pos, text=None, colour_set=[colours.WHITE, colours.GREY_BLUE, colours.BLUE], image_set=[None, None, None], text_colour=colours.BLACK, font=None, size=(80, 40), handler=None): #Set button attributes #all buttons self.colour = colour_set[0] self.colour_highlighted = colour_set[1] self.colour_pressed = colour_set[2] self.size = size self.text_colour = text_colour #image buttons only if not image_set[0] == None: self.image_normal = image_set[0].convert_alpha() image = self.image_normal self.image = image self.size = (image.get_rect().width, image.get_rect().height) if not image_set[1] == None: self.image_highlighted = image_set[1].convert_alpha() if not image_set[2] == None: self.image_pressed = image_set[2].convert_alpha() self.imageonly = True #Create surface for non-image button if not self.imageonly: if image_set[0] == None: image = pygame.Surface(self.size) image.fill(self.colour) self.image = image #apply colour to white button else: self.image = image self.applyColour(self.colour) #Create text image if text included if not text == None: if font == None: self.font = Font("assets/MicroTech.ttf", 18) else: self.font = font textImage = self.font.render(text, False, self.text_colour) textrect = textImage.get_rect() image = image.blit( textImage, (image.get_rect().width - textImage.get_rect().width - 52, image.get_rect().height - textImage.get_rect().height - 10)) #Make widget LcarsWidget.__init__(self, self.colour, pos, self.size, handler) if image_set[2] == None: self.applyColour(self.colour) else: self.imageonly = True self.highlighted = False self.beep = Sound("assets/audio/panel/202.wav")
def __init__(self, colour, pos, text, handler=None, rectSize=None, icon=None): if rectSize == None: image = pygame.image.load( "assets/reset_small_cyantest.png").convert_alpha() size = (image.get_rect().width, image.get_rect().height) else: size = rectSize image = pygame.Surface(rectSize).convert_alpha() image.fill(colour) self.colour = colour self.image = image PowerWidget.__init__(self, colour, pos, size, handler) self.highlighted = False self.beep = Sound("assets/audio/panel/202.wav")
def __init__(self, colour, pos, text, handler=None, rectSize=None, textSize=None, fontFace=None): if rectSize == None: image = _buttonimage.copy() #image = pygame.image.load("assets/button2.png").convert_alpha() size = (image.get_rect().width, image.get_rect().height) else: size = rectSize image = pygame.Surface(rectSize).convert_alpha() image.fill(colour) self.currcolour = colour self.colour = colour self.image = image self.togglevalue = False if textSize == None and fontFace == None: self.font = _defaultbuttonfont else: if textSize == None: textSize = .75 if fontFace == None: fontFace = "assets/OpenSansCondensed-Bold.ttf" self.font = Font(fontFace, int(50.0 * textSize)) textImage = self.font.render(text, False, colours.BLACK) image.blit(textImage, (image.get_rect().width - textImage.get_rect().width - 21, image.get_rect().height - textImage.get_rect().height - 3)) LcarsWidget.__init__(self, colour, pos, size, handler) self.applyColour(colour) self.highlighted = False self.beep = Sound("assets/audio/panel/202.wav")
def setup(self, all_sprites): all_sprites.add(LcarsBackgroundImage("assets/lcars_screen_2.png"), layer=0) all_sprites.add(LcarsGifImage("assets/gadgets/stlogorotating.gif", (103, 369), 50), layer=0) all_sprites.add(LcarsText(colours.ORANGE, (270, -1), "AUTHORIZATION REQUIRED", 2), layer=0) all_sprites.add(LcarsText(colours.BLUE, (330, -1), "ONLY AUTHORIZED PERSONNEL MAY ACCESS THIS TERMINAL", 1.5), layer=1) all_sprites.add(LcarsText(colours.BLUE, (360, -1), "TOUCH TERMINAL TO PROCEED", 1.5), layer=1) #all_sprites.add(LcarsText(colours.BLUE, (390, -1), "FAILED ATTEMPTS WILL BE REPORTED", 1.5),layer=1) all_sprites.add(LcarsButton(colours.GREY_BLUE, (320, 60), "1", self.num_1), layer=2) all_sprites.add(LcarsButton(colours.GREY_BLUE, (370, 60), "2", self.num_2), layer=2) all_sprites.add(LcarsButton(colours.GREY_BLUE, (320, 200), "3", self.num_3), layer=2) all_sprites.add(LcarsButton(colours.GREY_BLUE, (370, 200), "4", self.num_4), layer=2) all_sprites.add(LcarsButton(colours.GREY_BLUE, (320, 340), "5", self.num_5), layer=2) all_sprites.add(LcarsButton(colours.GREY_BLUE, (370, 340), "6", self.num_6), layer=2) all_sprites.add(LcarsButton(colours.GREY_BLUE, (320, 480), "7", self.num_7), layer=2) all_sprites.add(LcarsButton(colours.GREY_BLUE, (370, 480), "8", self.num_8), layer=2) all_sprites.add(LcarsButton(colours.GREY_BLUE, (320, 610), "9", self.num_9), layer=2) all_sprites.add(LcarsButton(colours.GREY_BLUE, (370, 610), "0", self.num_0), layer=2) if config.DEV_MODE: all_sprites.add(LcarsButton(colours.GREY_BLUE, (0, 770), "X", self.exitHandler, (30, 30)), layer=2) self.layer1 = all_sprites.get_sprites_from_layer(1) self.layer2 = all_sprites.get_sprites_from_layer(2) # sounds Sound("assets/audio/panel/215.wav").play() self.sound_granted = Sound("assets/audio/accessing.wav") self.sound_beep1 = Sound("assets/audio/panel/201.wav") self.sound_denied = Sound("assets/audio/access_denied.wav") self.sound_deny1 = Sound("assets/audio/deny_1.wav") self.sound_deny2 = Sound("assets/audio/deny_2.wav") self.reset()
def __init__(self, colour, pos, message, textSize=1.0, rectSize=(100, 100), background=(0, 0, 0, 0), handler=None, fontFace="assets/OpenSansCondensed-Light.ttf"): self.colour = colour self.currcolour = colour self.background = background self.togglevalue = False self.textList = [] self.place = 0 # self.marker = 0 # self.line_spacing = 0 self.rectSize = rectSize self.font = Font(fontFace, int(50.0 * textSize)) self.item_selected = None if not isinstance(message, list): self.message = message.splitlines() else: self.message = message self.image = pygame.Surface(self.rectSize).convert_alpha() self.image.fill(background) self.renderText(self.message) if (pos[1] < 0): pos = (pos[0], (config.RESOLUTION[0] / 2) - self.image.get_rect().width / 2) self.pos = pos LcarsWidget.__init__(self, colour, pos, rectSize, handler) self.beep = Sound("assets/audio/panel/202.wav")
def handleEvents(self, event, fpsClock): if event.type == pygame.MOUSEBUTTONDOWN: # Play sound self.sound_beep1.play() if event.type == pygame.MOUSEBUTTONUP: if (not self.layer2[0].visible): for sprite in self.layer1: sprite.visible = False for sprite in self.layer2: sprite.visible = True Sound("assets/audio/enter_authorization_code.wav").play() elif (self.pin_i == len(str(self.pin))): # Ran out of button presses if (self.correct == 4): self.sound_granted.play() from screens.base import ScreenBase self.loadScreen(ScreenBase()) else: self.sound_deny2.play() self.sound_denied.play() self.reset() return False
def setup(self, all_sprites): if config.DEV_MODE: all_sprites.add(LcarsButton(colours.GREY_BLUE, (0, 770), "X", self.exitHandler, (30, 30)), layer=2) self.layer1 = all_sprites.get_sprites_from_layer(1) self.layer2 = all_sprites.get_sprites_from_layer(2) self.all_sprites = all_sprites # Uncomment for fullscreen #DISPLAYSURF = pygame.display.set_mode((0, 0), pygame.FULLSCREEN) # For some reason, coordinates are passed in as y,x pad = 5 hpad = 10 leftStackWidth = 0.1345 screenWidth = pygame.display.get_surface().get_width() screenHeight = pygame.display.get_surface().get_height() # Elbow topLeftElbow = LcarsElbow(colours.PEACH, 0, (-40, hpad - 1), self.convertFloatToPoints(x=0.3, y=0.15)) #0.225 all_sprites.add(topLeftElbow, layer=1) # Second elbow secondElbow = LcarsElbow(colours.PEACH, 1, (topLeftElbow.nextObjCoordY(pad), hpad - 1), self.convertFloatToPoints(x=0.3, y=0.15)) #0.225 all_sprites.add(secondElbow, layer=1) # First Horizontal Bar h1 = LcarsHStrip( colours.PEACH, (self.yPercToPoints(0.0595), topLeftElbow.nextObjCoordX(pad)), 60, self.yPercToPoints(0.035), "") all_sprites.add(h1, layer=1) h2 = LcarsHStrip(colours.ORANGE, (self.yPercToPoints(0.0595), h1.nextObjCoordX(pad)), 120, self.yPercToPoints(0.035), "") all_sprites.add(h2, layer=1) h3 = LcarsHStrip(colours.PEACH, (self.yPercToPoints(0.0595), h2.nextObjCoordX(pad)), 20, self.yPercToPoints(0.035), "") all_sprites.add(h3, layer=1) h4 = LcarsHStrip(colours.ORANGE, (self.yPercToPoints(0.0595), h3.nextObjCoordX(pad)), 50, self.yPercToPoints(0.035), "") all_sprites.add(h4, layer=1) h5 = LcarsHStrip(colours.PEACH, (self.yPercToPoints(0.0595), h4.nextObjCoordX(pad)), 140, self.yPercToPoints(0.035), "") all_sprites.add(h5, layer=1) h6 = LcarsHStrip(colours.ORANGE, (self.yPercToPoints(0.0595), h5.nextObjCoordX(pad)), 20, self.yPercToPoints(0.035), "") all_sprites.add(h6, layer=1) remainingWidth = screenWidth - h6.rect.left - h6.rect.width - (hpad * 2) hlast = LcarsHStrip( colours.PEACH, (self.yPercToPoints(0.0595), h6.nextObjCoordX(pad)), remainingWidth - pad, self.yPercToPoints(0.035), "") all_sprites.add(hlast, layer=1) # Second Horizontal Bar h7 = LcarsHStrip( colours.PEACH, (secondElbow.rect.top + 1, secondElbow.nextObjCoordX(0)), 40, self.yPercToPoints(0.035), "") all_sprites.add(h7, layer=1) h8 = LcarsHStrip(colours.ORANGE, (h7.rect.top, h7.nextObjCoordX(pad)), 240, self.yPercToPoints(0.035), "") all_sprites.add(h8, layer=1) h9 = LcarsHStrip(colours.PEACH, (h7.rect.top, h8.nextObjCoordX(pad)), 30, self.yPercToPoints(0.035), "") all_sprites.add(h9, layer=1) h10 = LcarsHStrip(colours.ORANGE, (h7.rect.top, h9.nextObjCoordX(pad)), 90, self.yPercToPoints(0.035), "") all_sprites.add(h10, layer=1) h11 = LcarsHStrip(colours.PEACH, (h7.rect.top, h10.nextObjCoordX(pad)), 100, self.yPercToPoints(0.035), "") all_sprites.add(h11, layer=1) h12 = LcarsHStrip(colours.ORANGE, (h7.rect.top, h11.nextObjCoordX(pad)), 75, self.yPercToPoints(0.035), "") all_sprites.add(h12, layer=1) secondRemainingWidth = screenWidth - h12.rect.left - h12.rect.width - ( hpad * 2) secondHLast = LcarsHStrip(colours.PEACH, (h7.rect.top, h12.nextObjCoordX(pad)), secondRemainingWidth - pad, self.yPercToPoints(0.035), "") all_sprites.add(secondHLast, layer=1) # Left Menu Stack l1 = LcarsBlockSmall( colours.ORANGE, (secondElbow.nextObjCoordY(pad), hpad), "MEDIA", self.convertFloatToPoints(x=leftStackWidth, y=0.10)) l1.handler = self.musicHandler all_sprites.add(l1, layer=1) l2 = LcarsBlockSmall( colours.RED_BROWN, (l1.nextObjCoordY(pad), hpad), "COMMUNICATION", self.convertFloatToPoints(x=leftStackWidth, y=0.10)) all_sprites.add(l2, layer=1) l3 = LcarsBlockSmall( colours.DARK_BLUE, (l2.nextObjCoordY(pad), hpad), "NAVIGATION", self.convertFloatToPoints(x=leftStackWidth, y=0.10)) all_sprites.add(l3, layer=1) l4 = LcarsBlockSmall( colours.RED, (l3.nextObjCoordY(pad), hpad), "PERFORMANCE", self.convertFloatToPoints(x=leftStackWidth, y=0.075)) all_sprites.add(l4, layer=1) l5 = LcarsBlockSmall( colours.BLUE, (l4.nextObjCoordY(pad), hpad), "ENGINEERING", self.convertFloatToPoints(x=leftStackWidth, y=0.075)) all_sprites.add(l5, layer=1) # Variable height spacer bottomElbowHeight = 0.15 remainingHeight = screenHeight - l5.rect.top - l5.rect.height - self.yPercToPoints( bottomElbowHeight) - (hpad * 2) bottomLeftSpacer = LcarsBlockSmall( colours.WHITE, (l5.nextObjCoordY(pad), hpad), "", self.convertFloatToPoints( x=leftStackWidth, y=self.convertScreenHeightPointsToFloat(remainingHeight))) all_sprites.add(bottomLeftSpacer, layer=1) # Bottom Left Elbow bottomLeftElbow = LcarsElbow( colours.PEACH, 0, (bottomLeftSpacer.nextObjCoordY(pad), l5.rect.left), self.convertFloatToPoints(x=0.3, y=bottomElbowHeight)) #0.225 all_sprites.add(bottomLeftElbow, layer=1) # Bottom Horizontal Bar h13 = LcarsHStrip( colours.PEACH, (self.yPercToPoints(0.95), bottomLeftElbow.nextObjCoordX(pad)), self.yPercToPoints(0.1), self.yPercToPoints(0.035), "") all_sprites.add(h13, layer=1) # Variable width spacer bottomRightElbowWidth = 0.3 bottomRemainingWidth = screenWidth - h13.rect.left - h13.rect.width - self.xPercToPoints( bottomRightElbowWidth) - (hpad * 2) bottomRightSpacer = LcarsBlockSmall( colours.WHITE, (h13.rect.top, h13.nextObjCoordX(pad)), "", self.convertFloatToPoints( x=self.convertScreenWidthPointsToFloat(bottomRemainingWidth), y=0.035)) all_sprites.add(bottomRightSpacer, layer=1) # Bottom Right Elbow bottomRightElbow = LcarsElbow( colours.PEACH, 3, (bottomRightSpacer.rect.top, bottomRightSpacer.nextObjCoordX(pad)), self.convertFloatToPoints(x=bottomRightElbowWidth, y=bottomElbowHeight)) #0.225 all_sprites.add(bottomRightElbow, layer=1) # weather = LcarsImage("assets/weather.jpg", (l1.rect.y , l1.nextObjCoordX(10))) # all_sprites.add(weather, layer=2) # b1 = LcarsHStrip(colours.PEACH, (400, hpad), 200, "") # all_sprites.add(b1, layer=1) # bottomRightElbow = LcarsElbow(colours.PEACH, 2, (250, 250)) # all_sprites.add(bottomRightElbow, layer=1) # l2 = LcarsBlockMedium(colours.GREY_BLUE, (10, 10), "MEDIUM") # all_sprites.add(l2, layer=1) # l3 = LcarsBlockLarge(colours.PURPLE, (120, 10), "LARGE") # all_sprites.add(l3, layer=1) # sounds Sound("assets/audio/panel/215.wav").play() self.sound_granted = Sound("assets/audio/accessing.wav") self.sound_beep1 = Sound("assets/audio/panel/201.wav") self.sound_denied = Sound("assets/audio/access_denied.wav") self.sound_deny1 = Sound("assets/audio/deny_1.wav") self.sound_deny2 = Sound("assets/audio/deny_2.wav") self.reset()
def setup(self, all_sprites): all_sprites.add(LcarsBackgroundImage("assets/lcars_screen_3.png"), layer=0) all_sprites.add(LcarsGifImage("assets/gadgets/stlogorotating2.gif", (232, 895), 50), layer=0) all_sprites.add(LcarsText(colours.ORANGE, (608, -1), "AUTHORIZATION REQUIRED", 2), layer=0) all_sprites.add(LcarsText( colours.BLUE, (743, -1), "ONLY AUTHORIZED PERSONNEL MAY ACCESS THIS TERMINAL", 1.5), layer=1) all_sprites.add(LcarsText(colours.BLUE, (810, -1), "TOUCH TERMINAL TO PROCEED", 1.5), layer=1) #all_sprites.add(LcarsText(colours.BLUE, (878, -1), "FAILED ATTEMPTS WILL BE REPORTED", 1.5), layer=1) all_sprites.add(LcarsButton(colours.GREY_BLUE, (740, 312), "1", self.num_1), layer=2) all_sprites.add(LcarsButton(colours.GREY_BLUE, (843, 312), "2", self.num_2), layer=2) all_sprites.add(LcarsButton(colours.GREY_BLUE, (740, 648), "3", self.num_3), layer=2) all_sprites.add(LcarsButton(colours.GREY_BLUE, (843, 648), "4", self.num_4), layer=2) all_sprites.add(LcarsButton(colours.GREY_BLUE, (740, 984), "5", self.num_5), layer=2) all_sprites.add(LcarsButton(colours.GREY_BLUE, (843, 984), "6", self.num_6), layer=2) all_sprites.add(LcarsButton(colours.GREY_BLUE, (740, 1320), "7", self.num_7), layer=2) all_sprites.add(LcarsButton(colours.GREY_BLUE, (843, 1320), "8", self.num_8), layer=2) if config.DEV_MODE: all_sprites.add(LcarsButton(colours.GREY_BLUE, (0, 1848), "X", self.exitHandler, (68, 72)), layer=2) self.layer1 = all_sprites.get_sprites_from_layer(1) self.layer2 = all_sprites.get_sprites_from_layer(2) # sounds Sound("assets/audio/panel/215.wav").play() self.sound_granted = Sound("assets/audio/accessing.wav") self.sound_beep1 = Sound("assets/audio/panel/201.wav") self.sound_denied = Sound("assets/audio/access_denied.wav") self.sound_deny1 = Sound("assets/audio/deny_1.wav") self.sound_deny2 = Sound("assets/audio/deny_2.wav") ############ # SET PIN CODE WITH THIS VARIABLE ############ self.pin = 1234 ############ self.reset()
def setup(self, all_sprites): #self.mainscreen=mainscr all_sprites.add( LcarsBackgroundImage("assets/lcars_screen_2_modern.png"), layer=0) all_sprites.add(LcarsGifImage("assets/gadgets/stlogorotating.gif", (103, 369), 50), layer=0) all_sprites.add(LcarsText(colours.BLUEMID, (270, -1), "AUTHORIZATION REQUIRED", 2), layer=1) all_sprites.add(LcarsText( colours.BLUEMID, (330, -1), "ONLY AUTHORIZED PERSONNEL MAY ACCESS THIS TERMINAL", 1.5), layer=1) all_sprites.add(LcarsText(colours.BLUEMID, (360, -1), "TOUCH TERMINAL TO PROCEED", 1.5), layer=1) #all_sprites.add(LcarsText(colours.BLUE, (390, -1), "FAILED ATTEMPTS WILL BE REPORTED", 1.5),layer=1) button_row_1 = 230 button_row_2 = 270 button_row_3 = 310 button_row_4 = 350 button_col_1 = 210 button_col_2 = 340 button_col_3 = 470 button_image = pygame.image.load("assets/buttonpad.png") button_image_down = pygame.image.load("assets/buttonpaddown.png") all_sprites.add(UltimateButton( (button_row_1, button_col_1), text="1", handler=self.num_1, image_set=[button_image, button_image, button_image_down]), layer=2) all_sprites.add(UltimateButton( (button_row_1, button_col_2), text="2", handler=self.num_2, image_set=[button_image, button_image, button_image_down]), layer=2) all_sprites.add(UltimateButton( (button_row_1, button_col_3), text="3", handler=self.num_3, image_set=[button_image, button_image, button_image_down]), layer=2) all_sprites.add(UltimateButton( (button_row_2, button_col_1), text="4", handler=self.num_4, image_set=[button_image, button_image, button_image_down]), layer=2) all_sprites.add(UltimateButton( (button_row_2, button_col_2), text="5", handler=self.num_5, image_set=[button_image, button_image, button_image_down]), layer=2) all_sprites.add(UltimateButton( (button_row_2, button_col_3), text="6", handler=self.num_6, image_set=[button_image, button_image, button_image_down]), layer=2) all_sprites.add(UltimateButton( (button_row_3, button_col_1), text="7", handler=self.num_7, image_set=[button_image, button_image, button_image_down]), layer=2) all_sprites.add(UltimateButton( (button_row_3, button_col_2), text="8", handler=self.num_8, image_set=[button_image, button_image, button_image_down]), layer=2) all_sprites.add(UltimateButton( (button_row_3, button_col_3), text="9", handler=self.num_3, image_set=[button_image, button_image, button_image_down]), layer=2) all_sprites.add(UltimateButton( (button_row_4, button_col_2), text="0", handler=self.num_7, image_set=[button_image, button_image, button_image_down]), layer=2) if config.DEV_MODE: all_sprites.add(LcarsButton(colours.GREY_BLUE, (0, 770), "X", self.exitHandler, (30, 30)), layer=2) self.layer1 = all_sprites.get_sprites_from_layer(1) self.layer2 = all_sprites.get_sprites_from_layer(2) # sounds Sound("assets/audio/panel/215.wav").play() self.sound_granted = Sound("assets/audio/accessing.wav") self.sound_beep1 = Sound("assets/audio/panel/201.wav") self.sound_denied = Sound("assets/audio/access_denied.wav") self.sound_deny1 = Sound("assets/audio/deny_1.wav") self.sound_deny2 = Sound("assets/audio/deny_2.wav") ############ # SET PIN CODE WITH THIS VARIABLE ############ self.pin = 1337 ############ self.reset()