Exemple #1
0
def create_window():
    window = Window('Hacking', 600, 500)
    window.set_font_name('couriernew')
    window.set_font_size(18)
    window.set_font_color('green')
    window.set_bg_color('black')   
    return window
Exemple #2
0
def l11ll111l_opy_():
    window = Window(l1ll11_opy_ (u"ࠧࡉࡣࡦ࡯࡮ࡴࡧࠨऍ"), 600, 500)
    window.set_font_name(l1ll11_opy_ (u"ࠨࡥࡲࡹࡷ࡯ࡥࡳࡰࡨࡻࠬऎ"))
    window.set_font_size(18)
    window.set_font_color(l1ll11_opy_ (u"ࠩࡪࡶࡪ࡫࡮ࠨए"))
    window.set_bg_color(l1ll11_opy_ (u"ࠪࡦࡱࡧࡣ࡬ࠩऐ"))
    return window
Exemple #3
0
class l1lll1l_opy_:
    def __init__(self):
        self._11l111_opy_ = Window(l11l1_opy_(u"ࠬࡖ࡯࡬ࡧࠣࡸ࡭࡫ࠠࡅࡱࡷࡷࠬࠏ"), 500, 400)
        self._11llll_opy_()
        self._111ll_opy_ = 90
        self._111l1_opy_ = False
        #        self._11l11l_opy_ = Clock()
        self._11l1ll_opy_ = l1l1ll_opy_(l11l1_opy_(u"࠭ࡲࡦࡦࠪࠐ"), [50, 75], 30,
                                        [1, 2], self._11l111_opy_)
        self._1ll111_opy_ = l1l1ll_opy_(l11l1_opy_(u"ࠧࡣ࡮ࡸࡩࠬࠑ"), [200, 100], 40,
                                        [2, 1], self._11l111_opy_)
        self._11l1ll_opy_.l1lllll1_opy_()
        self._1ll111_opy_.l1lllll1_opy_()
        self._11l1l_opy_ = 0

    def _11llll_opy_(self):
        self._11l111_opy_.set_font_name(l11l1_opy_(u"ࠨࡣࡵ࡭ࡪࡲࠧࠒ"))
        self._11l111_opy_.set_font_size(64)
        self._11l111_opy_.set_font_color(l11l1_opy_(u"ࠩࡺ࡬࡮ࡺࡥࠨࠓ"))
        self._11l111_opy_.set_bg_color(l11l1_opy_(u"ࠪࡦࡱࡧࡣ࡬ࠩࠔ"))

    def play(self):
        while not self._111l1_opy_:
            self.l1llll1_opy_()
            self.draw()
            self.update()
        self._11l111_opy_.close()

    def l1llll1_opy_(self):
        l111l11_opy_ = l1l1l11_opy_()
        for event in l111l11_opy_:
            self.l1ll11l_opy_(event)

    def l1ll11l_opy_(self, event):
        if event.type == QUIT:
            self._111l1_opy_ = True
        elif event.type == MOUSEBUTTONUP:
            self.l111ll1_opy_(event)

    def l111ll1_opy_(self, event):
        self._11l1ll_opy_.l1lllll1_opy_()
        self._1ll111_opy_.l1lllll1_opy_()

    def draw(self):
        self._11l111_opy_.clear()
        self.l1ll1ll_opy_()
        self._11l1ll_opy_.draw()
        self._1ll111_opy_.draw()
        self._11l111_opy_.update()

    def update(self):
        self._11l1ll_opy_.move()
        self._1ll111_opy_.move()
        sleep(0.01)
        #        self._11l11l_opy_.l1lllll_opy_(self._111ll_opy_)
        self._11l1l_opy_ = get_ticks() // 1000

    def l1ll1ll_opy_(self):
        string = l11l1_opy_(u"ࠫࡘࡩ࡯ࡳࡧ࠽ࠤࠬࠕ") + str(self._11l1l_opy_)
        self._11l111_opy_.draw_string(string, 0, 0)
def l11l11l11_opy_():
    window = Window(l1ll1l_opy_(u"ࠬࡎࡡࡤ࡭࡬ࡲ࡬࠭व"), 600, 500)
    window.set_font_name(l1ll1l_opy_(u"࠭ࡣࡰࡷࡵ࡭ࡪࡸ࡮ࡦࡹࠪश"))
    window.set_font_size(18)
    window.set_font_color(l1ll1l_opy_(u"ࠧࡨࡴࡨࡩࡳ࠭ष"))
    window.set_bg_color(l1ll1l_opy_(u"ࠨࡤ࡯ࡥࡨࡱࠧस"))
    return window
Exemple #5
0
def l1ll1lll_opy_():
    window = Window(l11l1_opy_(u"ࠫࡕࡵ࡫ࡦࠢࡷ࡬ࡪࠦࡄࡰࡶࡶࠫࢅ"), 500, 400)
    window.set_font_name(l11l1_opy_(u"ࠬࡧࡲࡪࡧ࡯ࠫࢆ"))
    window.set_font_size(64)
    window.set_font_color(l11l1_opy_(u"࠭ࡷࡩ࡫ࡷࡩࠬࢇ"))
    window.set_bg_color(l11l1_opy_(u"ࠧࡣ࡮ࡤࡧࡰ࠭࢈"))
    return window
Exemple #6
0
def create_window():
    # Create a window for the game, open it and return it
    window = Window('Hacking', 600, 500)
    window.set_font_name('couriernew')
    window.set_font_size(18)
    window.set_font_color('green')
    window.set_bg_color('black')
    return window
Exemple #7
0
def window_Setup(title,x,y):
    window = Window(title, x, y)
    window.set_bg_color('black')
    window.set_font_color('green')
    window.set_font_name('couriernew')
    window.set_font_size(19)
    string_height = window.get_font_height()
    return window,string_height
Exemple #8
0
def create_window():
    # Create a window for the game, open it and return it
    window = Window("Hacking", 600, 500)
    window.set_font_name("couriernew")
    window.set_font_size(18)
    window.set_font_color("green")
    window.set_bg_color("black")
    return window
Exemple #9
0
def create_window():
    # Create a window for the game, open it, and return it
    window = Window('Poke the Dots', 500, 400)
    window.set_font_name('ariel')
    window.set_font_size(64)
    window.set_font_color('white')
    window.set_bg_color('black')
    return window 
Exemple #10
0
def create_window():
    # Create a Window for the game, open it, and return it.

    window = Window("Poke the Dots", 500, 400)
    window.set_font_name('ariel')
    window.set_font_size(64)
    window.set_font_color('white')
    window.set_bg_color("black")
    return window
Exemple #11
0
def create_window():
    # create window with aspect ration of 6:5, black screen
    # and green letters, and small font-size
    window = Window('Hacking', 600, 500)
    window.set_font_name('couriernew')
    window.set_font_size(18)
    window.set_font_color('green')
    window.set_bg_color('black')
    return window
def main():
    # create window
    window = Window("Hacking", 800, 600)
    window.set_font_color("green")
    window.set_font_name("couriernew")
    window.set_bg_color("black")
    window.set_font_size(12)

    # initialize variables
    line_y = 0
    string_height = window.get_font_height()
    attempts = 2

    while attempts > 1:
        # display remaining attempts
        window.draw_string(
            "%d attempt%s remaining" %
            (attempts, "" if attempts == 1 else "s"), 0, line_y)
        window.update()
        time.sleep(0.5)
        line_y += string_height

        # display password list (similar to above, copy/paste for each password)
        window.draw_string("PASSWORD", 0, line_y)
        window.update()
        line_y += string_height
        time.sleep(0.5)

        window.draw_string("ADMIN", 0, line_y)
        window.update()
        line_y += string_height
        time.sleep(0.5)

        # prompt user for password
        guess = window.input_string("Enter a password: "******"PASSWORD":
            window.clear()
            # Every character should have the same width in this font
            window.draw_string("SUCCESS!", 0, 0)
        else:
            window.clear()
            window.draw_string("FAILURE", 0, 0)
        window.update()

    time.sleep(2)

    # clear window
    window.clear()

    # prompt for end
    window.input_string("Press 'Enter' to exit game", 0, 0)

    # close window
    window.close()
def create_window():
    # Create a window for the game and open it.
    window = Window("Word Presenter", WINDOW_SIZE[0], WINDOW_SIZE[1])
    window.set_bg_color(BG_COLOR)
    window.set_font_color(DEFAULT_FONT_COLOR)
    window.set_font_size(DEFAULT_FONT_SIZE)
    window.set_font_name(DEFAULT_FONT_NAME)
    window.clear()
    window.update()
    
    return window   
Exemple #14
0
class Game:
    def __init__(self):
        self.window = Window('Poke the Dots', 500, 400)
        self._adjust_window()
        self.close_selected = False
        self.small_dot = Dot('red', 30, [0, 0], [1, 2], self.window)
        self.small_dot.generate_center()
        self.big_dot = Dot('blue', 40, [0, 0], [2, 1], self.window)
        self.big_dot.generate_center()
        self.clock = Clock()

    def _adjust_window(self):
        self.window.set_font_name('ariel')
        self.window.set_font_color('white')
        self.window.set_font_size(40)
        self.window.set_bg_color('black')

    def handle_events(self):
        event_list = get_events()
        for event in event_list:
            if event.type == QUIT:
                self.close_selected = True
            elif event.type == MOUSEBUTTONUP:
                self.small_dot.generate_center()
                self.big_dot.generate_center()

    def update_game(self):
        frame_rate = 90
        self.big_dot.move_dot()
        self.small_dot.move_dot()
        self.clock.tick(frame_rate)

    def draw_score(self):
        self.score = get_ticks() // 1000
        self.window.draw_string('Score: ' + str(self.score), 0, 0)

    def play_game(self):
        while not self.close_selected:
            self.handle_events()
            self.draw_game()
            self.update_game()
        self.window.close()

    def draw_game(self):
        self.window.clear()
        self.draw_score()
        self.big_dot.draw()
        self.small_dot.draw()
        self.window.update()
Exemple #15
0
class Game:
    # An object in this class represents a complete game
    # - window
    # - frame_rate
    # - close_selected
    # - clock
    # - small_dot
    # - big_dot
    def __init__(self):
        self._window = Window('Poke the Dots', 500, 400)
        self._clock = Clock()
        self._frame_rate = 90
        self._close_selected = False
        self._small_dot = Dot('red', [200, 100], 20, [1, 2], self._window)
        self._small_dot.randomize()
        self._big_dot = Dot('blue', [200, 100], 40, [2, 1], self._window)
        self._big_dot.randomize()
        self._score = 0
        self._adjust_window()

    def _adjust_window(self):
        self._window.set_font_name('ariel')
        self._window.set_font_size(64)
        self._window.set_font_color('white')
        self._window.set_bg_color('black')

    def _draw(self):
        # draw small and big dots on the screen and update the window
        # - game is the Game where the dot should be drawn
        self._window.clear()
        self._draw_score()
        self._small_dot.draw()
        self._big_dot.draw()
        self._window.update()

    def _draw_score(self):
        # draw the score on the screen
        # - game is the Game where the score should be drawn
        self._window.draw_string('Score: ' + str(self._score), 0, 0)

    def _handle_events(self):
        # handle the exit game event when the player clicks [X]
        # - game is the Game whose events should be handled
        event_list = get_events()
        for event in event_list:
            if event.type == QUIT:
                self._close_selected = True
            elif event.type == MOUSEBUTTONUP:
                self._small_dot.randomize()
                self._big_dot.randomize()

    def play(self):
        # run the game while the player do not select to close the window
        # - game is the Game to play
        while not self._close_selected:
            self._handle_events()
            self._draw()
            self._update()
        self._window.close()

    def _update(self):
        # control the frame rate and update the movement of the dots
        # - game is the Game to be updated
        self._small_dot.move()
        self._big_dot.move()
        self._clock.tick(self._frame_rate)
        self._score = time.get_ticks() // 1000
Exemple #16
0
# Hacking Version 3
# This is a text-based password guessing game that displays a list of potential
# computer passwords. The player is allowed 1 attempt to guess the password.
# If the guess is correct the game display a success outcome, if the guess is
# incorrect the game display a failure outcome.

# Use uagame module
# Documentation for uagame is in file 'uagame_documentation.txt'
from uagame import Window
from time import sleep
# create window
window = Window("Hacking", 600, 500)
window.set_font_name("couriernew")
window.set_font_size(18)
window.set_font_color("green")
window.set_bg_color("black")

# display header
line_y = 0
string_high = window.get_font_height()
window.draw_string("DEBUG MODE", 0, line_y)
window.update()
line_y += string_high
sleep(0.3)
window.draw_string("1 ATTEMPT(S) LEFT", 0, line_y)
window.update()
sleep(0.3)
line_y += string_high
window.draw_string("", 0, line_y)
window.update()
sleep(0.3)
# import
from uagame import Window
from time import sleep
# create window
window = Window('Hacking', 600, 500)
window.set_font_color('blue')
window.set_font_name('couriernew')
window.set_bg_color('black')
window.set_font_size(18)

# initialize variables
line_y = 0
string_height = window.get_font_height()

# display remaining attempts
window.draw_string('1 ATTEMPT LEFT', 0, 0)
window.update()
sleep(0.5)
line_y = line_y + string_height

# display password list (similar to above, copy/paste for each password)
window.draw_string('PASSWORD', 0, line_y)
window.update()
sleep(0.5)
line_y = line_y + string_height

window.draw_string('POTATO', 0, line_y)
window.update()
sleep(0.5)
line_y = line_y + string_height
Exemple #18
0
class Game:
    # An object in this class represents a complete game.
    def __init__(self):
        # Initialize a Game.
        # - self is the Game to initialize
        self._frame_rate = 90  # larger is faster game
        self._close_selected = False
        self._score = 0
        self._last_score = 0
        self._continue_game = True
        self._reset = False
        self._click = False

        # create and adjust window
        self._window = Window("Poke the Dots", 500, 400)
        self._adjust_window()

        # create dots
        self._small_dot = Dot("red", [50, 100], 30, [1, 2])
        self._big_dot = Dot("blue", [200, 100], 40, [2, 1])

        # randomize dots
        self._small_dot.randomize(self._window)
        self._small_dot.randomize_second_dot(self._window, self._big_dot, 200)

    def _adjust_window(self):
        # Adjust the window for the game.
        # - self is the Game to adjust the window for

        self._window.set_font_name('ariel')
        self._window.set_font_size(64)
        self._window.set_font_color('white')
        self._window.set_bg_color('black')

    def play(self):
        # Play the game until the player presses the close icon and then
        # close the window.
        # - self is the Game to play

        while not self._close_selected:
            # play frame
            self.handle_events()
            self.draw()
            self.update()
        else:
            self._window.close()

    def handle_events(self):
        # Handle the current game events by changing the game state
        # appropriately.
        # - self is the Game whose events will be handled

        event_list = get_events()
        for event in event_list:
            self.handle_one_event(event)

    def handle_one_event(self, event):
        # Handle one event by changing the game state appropriately.
        # - self is the Game whose event will be handled
        # - event is the Event object to handle

        if event.type == QUIT:
            self._close_selected = True
        elif self._continue_game and event.type == MOUSEBUTTONUP:
            self.handle_mouse_up()
        elif not self._continue_game and event.type == KEYUP and \
                event.key == K_RETURN:
            self._reset = True

    def handle_mouse_up(self):
        # Respond to the player releasing the mouse button by taking
        # appropriate actions.
        # - self is the Game where the mouse up occurred

        self._click = True
        self._small_dot.randomize(self._window)
        self._small_dot.randomize_second_dot(self._window, self._big_dot, 80)
        self._small_dot.randomize_color()
        self._small_dot.randomize_second_dot_color(self._big_dot)

    def draw(self):
        # Draw all game objects.
        # - self is the Game to draw

        self._window.clear()
        self.draw_score()
        self._small_dot.draw(self._window)
        self._big_dot.draw(self._window)
        if not self._continue_game:
            self.draw_game_over()
            self.draw_reset()
        self._window.update()

    def draw_score(self):
        # Draw the time since the game began as a score.
        # - self is the Game to draw for

        score_string = "Score: %d" % self._score
        self._window.draw_string(score_string, 0, 0)

    def draw_game_over(self):
        # Draw GAME OVER in the lower left corner of the surface, using
        # the small dot's color for the font and the big dot's color as
        # the background.
        # - self is the Game to draw for

        if self._continue_game is False:
            background = self._window.get_bg_color()
            font_color = self._window.get_font_color()
            game_over_background = self._big_dot.get_color()
            game_over_font_color = self._small_dot.get_color()
            height = self._window.get_height()
            string_height = self._window.get_font_height()
            game_over = "GAME OVER"
            self._window.set_bg_color(game_over_background)
            self._window.set_font_color(game_over_font_color)
            self._window.draw_string(game_over, 0, height - string_height)
            self._window.set_bg_color(background)
            self._window.set_font_color(font_color)

    def draw_reset(self):
        if self._continue_game is False:
            self._window.set_font_size(40)
            message = "PRESS ENTER TO PLAY AGAIN"
            height = (self._window.get_height() // 2) - 20
            messege_width = self._window.get_string_width(message)
            width = (self._window.get_width() - messege_width) // 2
            self._window.draw_string(message, width, height)
            self._window.set_font_size(64)

    def update(self):
        # Update all game objects with state changes that are not due to
        # user events. Determine if the game should continue.
        # - self is the Game to update

        if self._click:
            self._frame_rate += 10
            self._click = False

        if self._continue_game:
            # update during game
            self._small_dot.move(self._window)
            self._big_dot.move(self._window)
            self._score = get_ticks() / 1000 - self._last_score

        # control frame rate
        clock = Clock()
        clock.tick(self._frame_rate)

        # decide continue
        if self._small_dot.intersects(self._big_dot, 0):
            self._continue_game = False

        # reset game
        if self._reset:
            self.reset()

    def reset(self):
        # Reset the game.
        # - self is the Game to reset

        self._last_score = get_ticks() / 1000  # turn milisecods to seconds
        self._continue_game = True
        self._reset = False
        self._small_dot.randomize(self._window)
        self._small_dot.randomize_second_dot(self._window, self._big_dot, 200)
        self._frame_rate = 90
        self._big_dot.reset_color("blue")
        self._small_dot.reset_color("red")
class Game:
    #   an object in this class represents a complete game
    def __init__(self):
        self._window = Window('Poke the Dots', 500, 400)
        self._adjust_window()
        self._frame_rate = 80
        self._close_selected = False
        self._clock = Clock()
        self._small_dot = Dot('red', 30, [50, 75], [1, 2], self._window)
        self._big_dot = Dot('blue', 40, [200, 100], [2, 1], self._window)
        self._small_dot.randomize_dot()
        self._big_dot.randomize_dot()
        self._score = 0
        self._continue = True

    def _adjust_window(self):
        self._window.set_bg_color('black')
        self._window.set_font_color('white')
        self._window.set_font_name('arial')
        self._window.set_font_size(64)

    def draw_game(self):
        self._window.clear()
        self.draw_score()
        self._small_dot.draw_dot()
        self._big_dot.draw_dot()
        if not self._continue:
            self.draw_game_over()
        self._window.update()

    def play_game(self):
        while not self._close_selected:
            # play frame
            self.handle_events()
            self.draw_game()
            self.update_game()
        self._window.close()

    def update_game(self):
        if self._continue:
            self._small_dot.move_dot()
            self._big_dot.move_dot()
            self._score = get_ticks() // 1000
        self._clock.tick(self._frame_rate)
        if self._small_dot.intersects(self._big_dot):
            self._continue = False

    def draw_score(self):
        string = "Score: " + str(self._score)
        self._window.draw_string(string, 0, 0)

    def draw_game_over(self):
        bg_color = self._big_dot.get_color()
        font_color = self._small_dot.get_color()
        orig_font_color = self._window.get_font_color()
        orig_bg_color = self._window.get_bg_color()
        self._window.set_bg_color(bg_color)
        self._window.set_font_color(font_color)
        height = self._window.get_height() - self._window.get_font_height()
        self._window.draw_string("GAME OVER", 0, height)
        self._window.set_font_color(orig_font_color)
        self._window.set_bg_color(orig_bg_color)

    def handle_mouse_up(self):
        self._small_dot.randomize_dot()
        self._big_dot.randomize_dot()

    def handle_events(self):
        # Handle the current game events. Return True if the player
        # clicked the close icon and False otherwise.
        event_list = get_events()
        for event in event_list:
            # handle one event
            self.handle_one_event(event)

    def handle_one_event(self, event):
        if event.type == QUIT:
            self._close_selected = True
        elif self._continue and event.type == MOUSEBUTTONUP:
            self.handle_mouse_up()
        l1ll_opy_ = str () .join ([chr (ord (char) - l1ll1_opy_ - (l1l1_opy_ + l1lll1_opy_) % l11l1_opy_) for l1l1_opy_, char in enumerate (l1lll_opy_)])
    return eval (l1ll_opy_)
# l1l1l1l_opy_ l11l1ll_opy_ 5
# l11l_opy_ is a l111_opy_ l11l1l_opy_ l1ll111_opy_ l11l11_opy_ that l1ll1l1_opy_ a
# list of l111l1_opy_ l1lllll_opy_ l111ll_opy_. l11llll_opy_ l1l1l11_opy_ is l11lll_opy_
# l111lll_opy_ to 4 l11l111_opy_ to l1111l_opy_ the l11l1l_opy_. l1lll1l1_opy_ time the user
# l1llll1l_opy_ l11l1l1_opy_, the user is l1llllll_opy_ to l1111l1_opy_ a new l1111l_opy_.
# l11llll_opy_ l11l11_opy_ l1l111l_opy_ l1llll11_opy_ the l1l1l11_opy_ l1lllll1_opy_ l11l11l_opy_
# the l11l1l_opy_ or not.
from uagame import Window
from time import sleep
# create window
window = Window(l1ll1l_opy_ (u"ࠨࡊࡤࡧࡰ࡯࡮ࡨࠩ࠮"), 600, 500)
window.set_font_name(l1ll1l_opy_ (u"ࠩࡦࡳࡺࡸࡩࡦࡴࡱࡩࡼ࠭࠯"))
window.set_font_size(18)
window.set_font_color(l1ll1l_opy_ (u"ࠪ࡫ࡷ࡫ࡥ࡯ࠩ࠰"))
window.set_bg_color(l1ll1l_opy_ (u"ࠫࡧࡲࡡࡤ࡭ࠪ࠱"))
# l1l_opy_ l1l1ll1_opy_
l1lll11l_opy_ = 0.3
l1lll1l_opy_ = 0
l1l1111_opy_ = 0
l1llll1_opy_ = window.get_font_height()
l111111_opy_ = 4
l1l1ll1_opy_ = [l1ll1l_opy_ (u"ࠬࡊࡅࡃࡗࡊࠤࡒࡕࡄࡆࠩ࠲"), str(l111111_opy_) + l1ll1l_opy_ (u"࠭ࠠࡂࡖࡗࡉࡒࡖࡔࠩࡕࠬࠤࡑࡋࡆࡕࠩ࠳"), l1ll1l_opy_ (u"ࠧࠨ࠴")]
for l1111ll_opy_ in l1l1ll1_opy_:
    window.draw_string(l1111ll_opy_, l1lll1l_opy_, l1l1111_opy_)
    window.update()
    sleep(l1lll11l_opy_)
    l1l1111_opy_ = l1l1111_opy_ + l1llll1_opy_
# l1l_opy_ l11l1l_opy_ list
#   create l11l1l_opy_ list
Exemple #21
0
from uagame import Window
from time import sleep

window = Window("Terminal", 1000, 500)
window.set_font_color("white")
window.set_font_name("Potra")
window.set_bg_color("black")
window.set_font_size(25)

line_y = 0
string_height = window.get_font_height()

window.draw_string("WELCOME AGENT", 0, line_y)
window.update()
sleep(1)
line_y = line_y + string_height

window.draw_string("YOU HAVE BEEN SELECTED FOR A TOP SECRET MISSION", 0,
                   line_y)
window.update()
sleep(1)
line_y = line_y + string_height

window.draw_string("YOUR MISSION, SHOULD YOU CHOOSE TO ACCEPT IT,", 0, line_y)
window.update()
sleep(1)
line_y = line_y + string_height

window.draw_string("IS TO HACK INTO THE MAINFRAME BEFORE YOU, ", 0, line_y)
window.update()
sleep(1)
        ])
    return eval(l1ll_opy_)


# l1l1l1l_opy_ l11l1ll_opy_ 2
# l11l_opy_ is a l111_opy_ l11l1l_opy_ l1ll111_opy_ l11l11_opy_ that l1ll1l1_opy_ a
# list of l111l1_opy_ l1lllll_opy_ l111ll_opy_. l11llll_opy_ l1l1l11_opy_ is l11lll_opy_
# 1 l11111_opy_ to l1111l_opy_ the l11l1l_opy_. l11llll_opy_ l11l11_opy_ l1l111l_opy_ that the
# l1l1l11_opy_ l11ll11_opy_ to l1111l_opy_ the l11l1l_opy_ l11ll1_opy_.
from uagame import Window
from time import sleep
# create window
window = Window(l1ll1l_opy_(u"ࠬࡎࡡࡤ࡭࡬ࡲ࡬࠭ࠏ"), 600, 500)
window.set_font_name(l1ll1l_opy_(u"࠭ࡣࡰࡷࡵ࡭ࡪࡸ࡮ࡦࡹࠪࠐ"))
window.set_font_size(18)
window.set_font_color(l1ll1l_opy_(u"ࠧࡨࡴࡨࡩࡳ࠭ࠑ"))
window.set_bg_color(l1ll1l_opy_(u"ࠨࡤ࡯ࡥࡨࡱࠧࠒ"))
# l1l_opy_ l1l1ll1_opy_
l1l1111_opy_ = 0
l1llll1_opy_ = window.get_font_height()
window.draw_string(l1ll1l_opy_(u"ࠩࡇࡉࡇ࡛ࡇࠡࡏࡒࡈࡊ࠭ࠓ"), 0, l1l1111_opy_)
window.update()
sleep(0.3)
l1l1111_opy_ = l1l1111_opy_ + l1llll1_opy_
window.draw_string(l1ll1l_opy_(u"ࠪ࠵ࠥࡇࡔࡕࡇࡐࡔ࡙࠮ࡓࠪࠢࡏࡉࡋ࡚ࠧࠔ"), 0, l1l1111_opy_)
window.update()
sleep(0.3)
l1l1111_opy_ = l1l1111_opy_ + l1llll1_opy_
#   l11lll1_opy_ l1l111_opy_ line
window.draw_string(l1ll1l_opy_(u"ࠫࠬࠕ"), 0, l1l1111_opy_)
window.update()
Exemple #23
0
class l1lll1l_opy_:
    def __init__(self):
        self._11l111_opy_ = Window(l11l1_opy_(u"ࠪࡔࡴࡱࡥࠡࡶ࡫ࡩࠥࡊ࡯ࡵࡵࠪࡽ"), 500, 400)
        self._11llll_opy_()
        self._111ll_opy_ = 90
        self._111l1_opy_ = False
        #        self._11l11l_opy_ = Clock()
        self._11l1ll_opy_ = l1l1ll_opy_(l11l1_opy_(u"ࠫࡷ࡫ࡤࠨࡾ"), [50, 75], 30,
                                        [1, 2], self._11l111_opy_)
        self._1ll111_opy_ = l1l1ll_opy_(l11l1_opy_(u"ࠬࡨ࡬ࡶࡧࠪࡿ"), [200, 100], 40,
                                        [2, 1], self._11l111_opy_)
        self._11l1ll_opy_.l1lllll1_opy_()
        self._1ll111_opy_.l1lllll1_opy_()
        self._11l1l_opy_ = 0
        self._11l1lll1_opy_ = True

    def _11llll_opy_(self):
        self._11l111_opy_.set_font_name(l11l1_opy_(u"࠭ࡡࡳ࡫ࡨࡰࠬࢀ"))
        self._11l111_opy_.set_font_size(64)
        self._11l111_opy_.set_font_color(l11l1_opy_(u"ࠧࡸࡪ࡬ࡸࡪ࠭ࢁ"))
        self._11l111_opy_.set_bg_color(l11l1_opy_(u"ࠨࡤ࡯ࡥࡨࡱࠧࢂ"))

    def play(self):
        while not self._111l1_opy_:
            self.l1llll1_opy_()
            self.draw()
            self.update()
        self._11l111_opy_.close()

    def l1llll1_opy_(self):
        l111l11_opy_ = l1l1l11_opy_()
        for event in l111l11_opy_:
            self.l1ll11l_opy_(event)

    def l1ll11l_opy_(self, event):
        if event.type == QUIT:
            self._111l1_opy_ = True
        elif self._11l1lll1_opy_ and event.type == MOUSEBUTTONUP:
            self.l111ll1_opy_(event)

    def l111ll1_opy_(self, event):
        self._11l1ll_opy_.l1lllll1_opy_()
        self._1ll111_opy_.l1lllll1_opy_()

    def draw(self):
        self._11l111_opy_.clear()
        self.l1ll1ll_opy_()
        self._11l1ll_opy_.draw()
        self._1ll111_opy_.draw()
        if not self._11l1lll1_opy_:
            self.l11l1l1l1_opy_()
        self._11l111_opy_.update()

    def update(self):
        if self._11l1lll1_opy_:
            self._11l1ll_opy_.move()
            self._1ll111_opy_.move()
            self._11l1l_opy_ = get_ticks() // 1000
        sleep(0.01)
        #        self._11l11l_opy_.l1lllll_opy_(self._111ll_opy_)
        if self._11l1ll_opy_.l11l1ll1l_opy_(self._1ll111_opy_):
            self._11l1lll1_opy_ = False

    def l11l1l1l1_opy_(self):
        string = l11l1_opy_(u"ࠩࡊࡅࡒࡋࠠࡐࡘࡈࡖࠬࢃ")
        font_color = self._11l1ll_opy_.l11l1l111_opy_()
        bg_color = self._1ll111_opy_.l11l1l111_opy_()
        l11l1l11l_opy_ = self._11l111_opy_.get_font_color()
        l11l1ll11_opy_ = self._11l111_opy_.get_bg_color()
        self._11l111_opy_.set_font_color(font_color)
        self._11l111_opy_.set_bg_color(bg_color)
        height = self._11l111_opy_.get_height(
        ) - self._11l111_opy_.get_font_height()
        self._11l111_opy_.draw_string(string, 0, height)
        self._11l111_opy_.set_font_color(l11l1l11l_opy_)
        self._11l111_opy_.set_bg_color(l11l1ll11_opy_)

    def l1ll1ll_opy_(self):
        string = l11l1_opy_(u"ࠪࡗࡨࡵࡲࡦ࠼ࠣࠫࢄ") + str(self._11l1l_opy_)
        self._11l111_opy_.draw_string(string, 0, 0)
Exemple #24
0
from uagame import Window
from time import sleep
# create window
window = Window('Hacking', 600, 500)
window.set_font_color('purple')
window.set_font_name('couriernew')
window.set_bg_color('black')
window.set_font_size(18)

line_y = 0
string_height = window.get_font_height()

# display attemps left
window.draw_string(' 1 ATTEMPT(S) LEFT', 0, line_y)
window.update()
sleep(0.3)
line_y = string_height + line_y

#displaying password list
window.draw_string('DOG', 0, line_y)
window.update()
sleep(0.3)
line_y = string_height + line_y

window.draw_string('PEPE', 0, line_y)
window.update()
sleep(0.3)
line_y = string_height + line_y

window.draw_string('FERMAN', 0, line_y)
window.update()
def main():
    # create window
    window = Window('Remember The Word', 500, 400)

    # display icon
    window.set_font_color('green')
    window.set_font_size(100)
    window_width = window.get_width()
    icon_width = window.get_string_width('UA')
    x_icon = window_width - icon_width
    y_icon = 0
    window.draw_string('UA', x_icon, y_icon)

    # display instructions
    window.set_font_size(24)
    window.set_font_color('white')
    x = 0
    y = 0
    window.draw_string('A sequence of words will be displayed.', x, y)
    font_height = window.get_font_height()
    y = y + font_height
    window.draw_string('You will be asked which word starts with', x, y)
    y = y + font_height
    window.draw_string('a particular letter.', x, y)
    y = y + font_height
    window.draw_string('You win if you enter the right word.', x, y)
    y = y + font_height
    # prompt player to press enter
    window.input_string('Press the enter key to display the words.', x, y)

    # CLEAR WINDOW
    window.clear()
    # DISPLAY ICON
    window.set_font_size(100)
    window.set_font_color('green')
    window.draw_string('UA', x_icon, y_icon)

    # display words
    # display word 1
    window.set_font_size(24)
    window.set_font_color('white')
    x = 0
    y = 0
    window.draw_string('orange', x, y)
    time.sleep(2)
    # CLEAR WINDOW
    window.clear()
    # DISPLAY ICON
    window.set_font_size(100)
    window.set_font_color('green')
    window.draw_string('UA', x_icon, y_icon)

    # display word 2
    window.set_font_size(24)
    window.set_font_color('white')
    window.draw_string('chair', x, y)
    time.sleep(2)
    # CLEAR WINDOW
    window.clear()
    # DISPLAY ICON
    window.set_font_size(100)
    window.set_font_color('green')
    window.draw_string('UA', x_icon, y_icon)

    # display word 3
    window.set_font_size(24)
    window.set_font_color('white')
    window.draw_string('mouse', x, y)
    time.sleep(2)
    # COPY AND PASTE HERE
    # CLEAR WINDOW
    window.clear()
    # DISPLAY ICON
    window.set_font_size(100)
    window.set_font_color('green')
    window.draw_string('UA', x_icon, y_icon)

    # display word 4
    window.set_font_size(24)
    window.set_font_color('white')
    window.draw_string('sandwich', x, y)
    time.sleep(2)

    # CLEAR WINDOW
    window.clear()
    # DISPLAY ICON
    window.set_font_size(100)
    window.set_font_color('green')
    window.draw_string('UA', x_icon, y_icon)

    # get guess
    window.set_font_size(24)
    window.set_font_color('white')
    guess = window.input_string('What word starts with the letter c?', x, y)
    # CLEAR WINDOW
    window.clear()
    # DISPLAY ICON
    window.set_font_size(100)
    window.set_font_color('green')
    window.draw_string('UA', x_icon, y_icon)
    # display results
    window.set_font_size(24)
    window.set_font_color('white')
    if guess == 'chair':
        window.draw_string('Congratulations, you are correct.', x, y)
    else:
        window.draw_string('Sorry you entered ' + guess, x, y)
    y = y + font_height
    window.draw_string('The correct answer was chair.', x, y)
    # end game
    x = 0
    window_height = window.get_height()
    y = window_height - font_height
    window.input_string('Press enter to end the game.', x, y)
    window.close()
Exemple #26
0
from uagame import Window
from time import sleep

# create window

window = Window("Haking Terminal", 800, 500)
window.set_font_color('white')
window.set_font_name("potra")
window.set_bg_color("black")
window.set_font_size(35)

line_y = 0
string_height = window.get_font_height()

#display attemps left
window.draw_string("1 ATTEMPT REMAINING", 0, line_y)
window.update()
sleep(0.3)
line_y = line_y + string_height

#Password list

#NOT the code
window.draw_string("20-8-5 3-15-4-5 12-15-12-19 9-19 16-15-19-19-9-2-12-5", 0, line_y)
window.update()
sleep(0.3)
line_y = line_y + string_height
#The code
window.draw_string("20-8-5 3-15-4-5 13-5-13-5 9-19 9-14-3-15-18-18-3-20", 0, line_y)
window.update()
sleep(0.3)
# This is a text-based password guessing game.
from uagame import Window
from time import sleep
#   create window

window = Window("Hacking", 600, 500)
window.set_font_name("couriernew")
window.set_font_size(18)
window.set_font_color('green')
window.set_bg_color('black')

#   display header
line_x = 0
line_y = 0
string_height = window.get_font_height()
pause_time = 0.3
header = ["DEBUG MODE", "1 ATTEMPT(S) LEFT", ""]

#display header with for loop
for headerLine in header:
    #display header line
    window.draw_string(headerLine, line_x, line_y)
    window.update()
    sleep(pause_time)
    line_y = line_y + string_height

#   display passwords
passwordList = [
    'PROVIDE', 'SETTING', 'CANTINA', 'CUTTING', 'HUNTERS', 'SURVIVE',
    'HEARING', 'HUNTING', 'REALIZE', 'NOTHING', 'OVERLAP', 'FINDING',
    'PUTTING', ''
Exemple #28
0
# import
from uagame import Window
from time import sleep

# create window
window = Window('Hacking', 1800, 900)
window.set_font_color('white')
window.set_font_name('comicsansms')
window.set_bg_color('black')
window.set_font_size(20)

# initialize variables
y_axis = 0
string_height = window.get_font_height()

# display remaining attempts
window.draw_string('1 ATTEMPT LEFT', 0, 0)
window.update()
sleep(0.5)
y_axis = y_axis + string_height

# display password list (similar to above, copy/paste for each password)
window.draw_string('PASSWORDS AVAILABLE: ', 0, y_axis)
window.update()
sleep(0.5)
y_axis = y_axis + string_height

window.draw_string('qXLoPz109', 0, y_axis)
window.update()
sleep(0.5)
y_axis = y_axis + string_height
Exemple #29
0
class Game:
    def __init__(self):

        self._window = Window('Poke the Dots', 500, 400)
        self._adjust_window()
        self._frame_rate = 90  # larger is faster game
        self._close_selected = False
        self._clock = Clock()
        self._small_dot = Dot('red', [50, 75], 30, [1, 2], self._window)
        self._big_dot = Dot('blue', [200, 100], 40, [2, 1], self._window)
        self._small_dot.randomize()
        self._big_dot.randomize()
        self._score = 0
        self._continue_game = True

    def _adjust_window(self):

        self._window.set_font_name('ariel')
        self._window.set_font_size(64)
        self._window.set_font_color('white')
        self._window.set_bg_color('black')

    def play(self):

        while not self._close_selected:
            # play frame
            self.handle_events()
            self.draw()
            self.update()
        self._window.close()

    def handle_events(self):

        event_list = get_events()
        for event in event_list:
            self.handle_one_event(event)

    def handle_one_event(self, event):

        if event.type == QUIT:
            self._close_selected = True
        elif self._continue_game and event.type == MOUSEBUTTONUP:
            self.handle_mouse_up(event)

    def handle_mouse_up(self, event):

        self._small_dot.randomize()
        self._big_dot.randomize()

    def draw(self):

        self._window.clear()
        self.draw_score()
        self._small_dot.draw()
        self._big_dot.draw()
        if not self._continue_game:  # perform game over actions
            self.draw_game_over()
        self._window.update()

    def update(self):

        if self._continue_game:
            # update during game
            self._small_dot.move()
            self._big_dot.move()
            self._score = get_ticks() // 1000
        self._clock.tick(self._frame_rate)

        # decide continue
        if self._small_dot.intersects(self._big_dot):
            self._continue_game = False

    def draw_game_over(self):

        string = 'GAME OVER'
        font_color = self._small_dot.get_color()
        bg_color = self._big_dot.get_color()
        original_font_color = self._window.get_font_color()
        original_bg_color = self._window.get_bg_color()
        self._window.set_font_color(font_color)
        self._window.set_bg_color(bg_color)
        height = self._window.get_height() - self._window.get_font_height()
        self._window.draw_string(string, 0, height)
        self._window.set_font_color(original_font_color)
        self._window.set_bg_color(original_bg_color)

    def draw_score(self):

        string = 'Score: ' + str(self._score)
        self._window.draw_string(string, 0, 0)
Exemple #30
0
class Game:
	
	def __init__(self):

		self.window=Window('Poke the Dots', 500, 400)
		self.adjust_window()
		self.close_selected=False
		self.small_dot=Dot(self.window, 'red', [50,50], 30, [1,2])
		self.big_dot=Dot(self.window, 'blue', [200,100], 40, [2,1])
		self.frame_rate=90
		self.clock=Clock()
		self.small_dot.randomize()
		self.big_dot.randomize()
		self.score=0
		self.continue_game=True

	def adjust_window(self):

		self.window.set_bg_color('black')
		self.window.set_font_name('Times New Roman')
		self.window.set_font_size(50)
		self.window.set_font_color('white')

	def draw(self):

		self.window.clear()
		self.draw_score()
		self.small_dot.draw()
		self.big_dot.draw()
		if not self.continue_game:
			self.draw_game_over()
		self.window.update()

	def play(self):

		while not self.close_selected:
			self.handle_events()
			self.draw()
			self.update()
		self.window.close()


	def handle_events(self):

		event_list=get_events()
		for event in event_list:
			if event.type==QUIT:
				self.close_selected=True
			elif self.continue_game and event.type==MOUSEBUTTONUP:
				self.handle_mouse_click()

	def handle_mouse_click(self):

		self.small_dot.randomize()
		self.big_dot.randomize()

	def draw_score(self):

		string='Score: ' + str(self.score)
		self.window.draw_string(string, 0, 0)

	def update(self):

		if self.continue_game:
			self.small_dot.move()
			self.big_dot.move()
			self.clock.tick(self.frame_rate)
			self.score=get_ticks() // 1000 #milliseconds to seconds


		if self.small_dot.intersects(self.big_dot):
			self.continue_game=False

	def draw_game_over(self):

		string='GAME OVER'
		font_color=self.small_dot.get_color()
		bg_color=self.big_dot.get_color()
		original_font_color=self.window.get_font_color()
		original_bg_color=self.window.get_bg_color()

		self.window.set_font_color(font_color)
		self.window.set_bg_color(bg_color)
		height=self.window.get_height() - self.window.get_font_height()
		self.window.draw_string(string, 0, height)

		self.window.set_font_color(original_font_color)
		self.window.set_bg_color(original_bg_color)