Ejemplo n.º 1
0
 def __init__(self, pos, images, flaks, GOs, player, mission):
     super().__init__(pos, images, flaks, GOs, player, mission)
     self.name = "jupiter_alien"
     self.maxPhase = 15
     self.till_drop = (0, 0)
     self.health = 1.5
     self.start_health = 1.5
     self.acc = 1
     self.till_reg_drop = (0, 4)
     self.exp_names = ["jupiter_alien_boom", "jupiter_alien_boom_simple"]
     self.firesLaser = True
     self.death_sound = Sound(fixPath("audio/alienDie3.wav"))
     self.explode_sound = Sound(fixPath("audio/alienExplode3.wav"))
     self.drop_sound = Sound(fixPath("audio/alienLaser.wav"))
Ejemplo n.º 2
0
 def __init__(self, pos, images, flaks, GOs, player, mission):
     super().__init__(pos, images, flaks, GOs, player, mission)
     self.name = "greenAlien"
     self.death_amount = [125, 75, 75, 125]
     self.speed = random.uniform(200, 450)
     self.velocity = Vector2([self.speed, 0])
     self.drop_from = "center"
     self.till_drop = .5
     self.till_reg_drop = 2
     self.acc = 4
     self.drops_mines = True
     self.health = 2
     self.start_health = 2
     self.maxPhase = 15
     self.exp_names = ["green_boom", "green_boom_simple"]
     self.impact_damage = [.5, 1]
     self.death_sound = Sound(fixPath("audio/alienDie2.wav"))
     self.explode_sound = Sound(fixPath("audio/alienExplode2.wav"))
Ejemplo n.º 3
0
 def __init__(self, pos, images, flaks, GOs, player, mission):
     self.GOs = GOs
     self.flaks = flaks
     self.images = images
     self.pos = list(pos)
     self.phase = 1
     self.phase_rate = .5
     self.phase_time = 0
     self.next_fire = -1
     self.fire_time = 0
     self.time_passed = 0
     self.speed = random.uniform(475, 600)
     self.downshift = 100
     self.direction = 1      # Direction 1 is right, direction -1 is left
     self.health = 1
     self.dead = False
     self.kill = False
     self.maxPhase = 9
     self.velocity = Vector2([self.speed, 0])
     self.grounded = False
     self.player = player
     self.jackpot = False
     self.hitBy = None
     self.mission = mission
     self.firesLaser = False
     self.min_drop = -.01
     self.till_reg_drop = (self.min_drop, 2)
     self.till_drop = (.05, .4)
     self.acc = 1.2
     self.drop_from = "LR"
     self.name = "alien"
     self.exp_names = ["exp", "Exp"]
     self.attack_range = (0, 30)
     self.size, self.exp_size = (64, 64), (256, 256)
     self.death_amount = [30, 15, 50, 75]
     self.life_bar = False
     self.start_health = self.health
     self.death_sound = Sound(fixPath("audio/alienDie.wav"))
     self.explode_sound = Sound(fixPath("audio/alienExplode.wav"))
     self.drop_sound = Sound(fixPath("audio/alienDrop1.wav"))
     self.impact_damage = [.2, .4]
     self.drops_bombs = False
     self.isBoss = False
     self.drops_mines = False
def capture(profile_num, surf, ingame = False):
    surf = copy.copy(surf)
    data = time.localtime()
    if not os.path.exists(directory):
        print(colorize("Screenshot directory missing.", "warning"))
        os.mkdir(directory)
    name = f"ii{profile_num}_{data.tm_year}{data.tm_mon}{data.tm_mday}{data.tm_hour}{data.tm_min}{data.tm_sec}"
    done_this = False
    p = fixPath(directory+"/"+name+".png")
    while os.path.exists(p) or name in save_for_later:
        if not done_this:
            name += "_2"
            done_this = True
        else:
            name = name[:-1] + str(int(name[-1]) + 1)
        p = fixPath(directory+"/"+name+".png")
    sound.play()
    if ingame and options["cache_screen_shots"]:
        print(colorize(f"Caching screenshot {name}", "blue"))
        save_for_later[name] = surf
    else:
        save(surf, name)
Ejemplo n.º 5
0
def run_credits(display, images):
    pygame.mixer.music.load(get_file(fixPath("music/stores.mp3")))
    pygame.mixer.music.play()
    clock = pygame.time.Clock()
    done = False
    text = []
    time_passed = 0
    for e, x in enumerate(credits_text.split("\n")):
        text.append(
            list(
                retro_text((400, 24 * e + 10),
                           display,
                           14,
                           x,
                           font="sans",
                           anchor="midtop",
                           res=11)))
    scroll = -600
    scroll_rate = 35
    while not done:
        for event in pygame.event.get():
            if event.type == pygame.QUIT:
                pygame.quit()
                sys.exit()
            if event.type == pygame.KEYDOWN:
                if event.key in (pygame.K_RETURN, pygame.K_ESCAPE):
                    done = True
        if scroll > 1000:
            done = True
        display.blit(images["background"], (0, 0))
        for line in text:
            if line[1][1] - scroll < 100:
                if line[0].get_width() <= 3:
                    text.remove(line)
                    continue
                s1 = line[0].get_width()
                if line[1][1] - scroll > 90:
                    s1 *= 1.025
                else:
                    s1 /= 1.03
                line[0] = pygame.transform.scale(
                    line[0], (round(s1), line[0].get_height()))
                r2 = pygame.Rect((0, 0), line[0].get_size())
                r2.center = line[1].center
                line[1] = r2
            display.blit(line[0], (line[1][0], line[1][1] - scroll))
        scroll += scroll_rate * time_passed
        pygame.display.update()
        time_passed = clock.tick(60) / 1000
    pygame.mixer.music.stop()
Ejemplo n.º 6
0
 def purchase(self):
     cat = self.catagories[self.rect_sel]
     if not cat:
         Sound(fixPath("audio/donk.wav")).play()
         return
     selected = list(cat.keys())[self.sel_num[self.rect_sel]]
     selected.planet = self.profile["planet"].name
     if self.profile["money"] >= selected.cost:
         Sound(fixPath("audio/purchase.wav")).play()
         cat[selected] -= 1
         if not cat[selected]:
             self.catagories[self.rect_sel].pop(selected)
         if self.sel_num[self.rect_sel] >= len(cat):
             self.sel_num[self.rect_sel] = len(cat) - 1
         if selected in self.profile["inventory"][self.rect_sel]:
             self.profile["inventory"][self.rect_sel][selected] += 1
         else:
             self.profile["inventory"][self.rect_sel][selected] = 1
         if selected.type == "Vehicle":
             self.profile["inventory"][
                 self.rect_sel][selected] = self.profile["planet"].name
         self.profile["money"] -= selected.cost
     else:
         Sound(fixPath("audio/donk.wav")).play()
Ejemplo n.º 7
0
 def confirm_delete(self):
     stuff_rect = pygame.Rect(0, 0, 300, 400)
     stuff_rect.center = self.display.get_rect().center
     options = ["No", "Yes"]
     sel = 0
     done = False
     while not done:
         for event in pygame.event.get():
             if event.type == pygame.KEYDOWN:
                 if event.key in (pygame.K_UP, pygame.K_w):
                     sel = 0
                 if event.key in (pygame.K_DOWN, pygame.K_s, pygame.K_x):
                     sel = 1
                 if event.key == pygame.K_TAB:
                     sel = not sel
                 if event.key == pygame.K_RETURN:
                     if sel:
                         os.remove(
                             fixPath(
                                 get_file(
                                     f"data/profile{self.profile_selected}")
                             ))
                         self.profiles[
                             self.
                             profile_selected] = f"New Profile #{self.profile_selected + 1}"
                     self.pause_motion = True
                     done = True
         if not self.options_lock:
             self.draw_stars()
         self.draw_menu_box(stuff_rect)
         self.draw_items(options, sel, stuff_rect)
         retro_text(stuff_rect.move(0, 5).midtop,
                    self.display,
                    14,
                    "Are you sure you want",
                    anchor="midtop")
         retro_text(stuff_rect.move(0, 20).midtop,
                    self.display,
                    14,
                    f"to erase Profile #{self.profile_selected + 1}?",
                    anchor="midtop")
         pygame.display.update()
Ejemplo n.º 8
0
 def __init__(self, pos, images, mission, dry=False):
     super().__init__(pos, images, mission, dry)
     self.title = "Jupiter Hovercraft"
     self.name = "jupiter_hover"
     self.death_frames = 21
     self.size = (32, 32)
     self.boom_size = (256, 256)
     self.fire_from = (24, 5)
     self.health = .75
     self.max_health = .75
     self.shield = 0
     self.max_shield = 2
     self.rect = self.get_rect()
     self.hover = True
     self.rotate = True
     self.send_to_ground()
     self.mass = .75
     self.max_temp = 500
     self.frame_rate = 1 / 35
     self.death_sound = Sound(fixPath("audio/jupiter_hover_explode.wav"))
Ejemplo n.º 9
0
 def events(self):
     for event in pygame.event.get():
         if event.type == pygame.QUIT:
             self.exit()
         if event.type == pygame.MOUSEBUTTONDOWN:
             if not self.finished:
                 self.finished = True
                 print(self.text)
                 self.text = ""
         if event.type == pygame.KEYDOWN:
             if event.key == pygame.K_F2:
                 screenshot.capture("M", self.display)
             if not self.finished:
                 self.finished = True
                 print(self.text)
                 self.text = ""
             else:
                 item = self.item_selected
                 items = self.items
                 if self.options_mode:
                     item = self.option_selected
                     items = self.options
                 if self.play_mode:
                     item = self.profile_selected
                     items = self.profiles
                 if event.key == pygame.K_ESCAPE:
                     self.exit()
                 if event.key == pygame.K_UP:
                     item -= 1
                 if event.key == pygame.K_DOWN:
                     item += 1
                 if item < 0:
                     item = 0
                 if item >= len(items):
                     item = len(items) - 1
                 if self.options_mode:
                     self.option_selected = item
                 if self.play_mode:
                     self.profile_selected = item
                 elif self.play_mode:
                     pass
                 else:
                     self.item_selected = item
                 if self.options_mode:
                     op = self.options[self.option_selected]
                     if op == "Volume":
                         vol = self.options_dict["volume"]
                         if event.key == pygame.K_LEFT:
                             vol -= .1
                         if event.key == pygame.K_RIGHT:
                             vol += .1
                         if vol < 0:
                             vol = 0
                         if vol > 1:
                             vol = 1
                         self.options_dict["volume"] = vol
                     if op == "Cache Screenshots":
                         if event.key == pygame.K_RETURN:
                             self.options_dict[
                                 "cache_screen_shots"] = not self.options_dict[
                                     "cache_screen_shots"]
                     if op == "Stretch to Fullscreen":
                         if event.key == pygame.K_RETURN:
                             self.options_dict[
                                 "fullscreen"] = not self.options_dict[
                                     "fullscreen"]
                     if op == self.DEL:
                         if event.key == pygame.K_RETURN:
                             try:
                                 for e, x in enumerate(
                                         os.listdir(
                                             fixPath(
                                                 get_file(
                                                     "data/screenshots")))):
                                     os.remove(
                                         fixPath(
                                             get_file("data/screenshots/"))
                                         + x)
                                 print(
                                     colorize(f"Deleted screenshots: {e+1}",
                                              "green"))
                                 self.options[self.options.index(
                                     self.DEL)] = "Deleted screenshots"
                                 self.DEL = "Deleted screenshots"
                             except FileNotFoundError:
                                 print(
                                     colorize(
                                         "Failed to delete screenshots!",
                                         "fail"))
                                 print(
                                     colorize("File not found error.",
                                              "fail"))
                 if event.key == pygame.K_x:
                     if self.play_mode:
                         if self.profile_selected < 5 and not self.profiles[
                                 self.profile_selected].startswith("New"):
                             self.confirm_delete()
                 if event.key == pygame.K_RETURN:
                     if self.options_mode:
                         sel = self.option_selected
                         if self.options[sel] == "Cancel":
                             self.options_mode = False
                             self.options_dict = saves.load_options()
                         if self.options[sel] == "Save":
                             self.options_mode = False
                             saves.save_data("options", self.options_dict)
                         if not self.options_mode and self.options_lock:
                             self.done = True
                     elif self.play_mode:
                         if self.profiles[self.profile_selected] == "Back":
                             self.play_mode = False
                         else:
                             profile = saves.load_profile(
                                 self.profile_selected)
                             profile["new"] = False
                             saves.save_data(self.profile_selected, profile)
                             self.done = True
                     else:
                         sel = self.item_selected
                         if self.items[sel] == "Play":
                             self.play_mode = True
                         if self.items[sel] == "Options":
                             self.options_mode = True
                         if self.items[sel] == "Quit":
                             self.exit()
                         if self.items[sel] == "Credits":
                             run_credits(self.display, self.images)
Ejemplo n.º 10
0
 def __init__(self,
              center,
              images,
              mission,
              type="moneyBag",
              velocity=Vector2([0, 0]),
              amount=None,
              value=None):
     self.images = images
     self.type = type
     self.size = (24, 24)
     self.physics = True
     self.gotShot = False
     if self.type == "moneyBag":
         self.size = (12, 16)
     if self.type == "rock":
         self.size = (20, 20)
     if self.type == "aircraft":
         self.physics = False
         self.size = (48, 48)
     if self.type == "mine":
         self.size = (32, 32)
     self.rect_size = self.size
     if self.type == "laser":
         self.size = (32, 32)
         self.rect_size = (16, 32)
     rect = pygame.Rect((0, 0), self.size)
     rect.center = center
     self.pos = list(rect.topleft)
     self.rect = rect
     self.time_passed = 0
     self.frame = 1
     self.frame_rate = 1 / 25
     self.frame_time = 0
     self.max_frame = 185
     self.velocity = copy.copy(velocity)
     self.dead = False
     self.kill = False
     self.amount = amount
     self.jackpot = False
     self.mission = mission
     self.health = .1
     self.kaboom = False
     if self.type == "block":
         self.max_frame = 30
     if self.type == "moneyBag":
         self.health = 1
         self.ser_num = shared["money_ser_num"]
         shared["money_ser_num"] += 1
     if self.type == "aircraft":
         self.depart = random.randint(0, 1)
         self.direction = random.randint(0, 1)
         if self.direction == 0:
             self.direction = -1
         if self.depart == 0:
             self.depart = -1
         self.frame_rate = 1
         self.max_frame = 3
         x = 0
         y = 0
         if self.direction == -1:
             x = SIZE[0]
         if self.depart == -1:
             y = self.mission.ground
         rect = self.get_rect()
         rect.center = (x, y)
         self.pos = list(rect.topleft)
         self.velocity = Vector2([1 * self.direction, .5 * self.depart
                                  ]) * 300 * random.uniform(.9, 1.1)
         self.jet_sound = Sound(fixPath("audio/jet.wav"))
         self.jet_sound.play(-1)
     if self.type == "mine":
         self.frame_rate = .5
         self.max_frame = 3
         self.health = 1
     if self.type == "laser":
         self.max_frame = 5
         self.frame_rate = 0.01
         self.physics = False
         self.velocity = Vector2([0, 1200])
     self.value = value
     self.start_health = self.health
     self.life_bar = True
     self.hitBy = []
     self.lifetime = 0
Ejemplo n.º 11
0
def save(surf, name):
    print(colorize("Saving screenshot...", "blue"))
    t1 = time.time()
    pygame.image.save(surf, fixPath(f"{directory}/{name}.png"))
    t2 = time.time()
    print(colorize(f"Saved screenshot \"{name}\" in {round(t2-t1, 2)} seconds", "green"))
Ejemplo n.º 12
0
import os
import pygame
import time
import copy
from ii_game.scripts.retro_text import retro_text
from ii_game.scripts.sound import Sound
from ii_game.scripts.utils import fixPath, colorize
from ii_game.scripts.get_file import get_file

from ii_game.scripts import saves
directory = get_file(fixPath("data/screenshots"))

pygame.init()

sound = Sound(fixPath("audio/click.wav"))
options = saves.load_options()
save_for_later = {}

def capture(profile_num, surf, ingame = False):
    surf = copy.copy(surf)
    data = time.localtime()
    if not os.path.exists(directory):
        print(colorize("Screenshot directory missing.", "warning"))
        os.mkdir(directory)
    name = f"ii{profile_num}_{data.tm_year}{data.tm_mon}{data.tm_mday}{data.tm_hour}{data.tm_min}{data.tm_sec}"
    done_this = False
    p = fixPath(directory+"/"+name+".png")
    while os.path.exists(p) or name in save_for_later:
        if not done_this:
            name += "_2"
            done_this = True
Ejemplo n.º 13
0
 def __init__(self, display, images, profile, profile_selected, map_point):
     self.display = display
     self.images = images
     self.profile = profile
     self.profile_selected = profile_selected
     center = display.get_rect().center
     self.main_rect = pygame.Rect(0, 0, 750, 550)
     self.main_rect.center = center
     self.list_rect = pygame.Rect(0, 0, 730, 300)
     self.list_rect.midbottom = self.main_rect.move(0, -10).midbottom
     self.buy_rect = pygame.Rect(0, 0, 355, 290)
     self.buy_rect.topleft = self.list_rect.move(5, 5).topleft
     self.inv_rect = self.buy_rect.copy()
     self.inv_rect.topleft = self.buy_rect.move(5, 0).topright
     self.item_rects = [self.buy_rect, self.inv_rect]
     self.items_rect = pygame.Rect(0, 0, 200, 40)
     self.items_rect.topright = self.main_rect.move(-5, 5).topright
     self.missiles_rect = self.items_rect.copy()
     self.missiles_rect.topleft = self.items_rect.move(0, 4).bottomleft
     self.licenses_rect = self.items_rect.copy()
     self.licenses_rect.topleft = self.missiles_rect.move(0, 4).bottomleft
     self.vehicles_rect = self.items_rect.copy()
     self.vehicles_rect.topleft = self.licenses_rect.move(0, 4).bottomleft
     self.drones_rect = self.items_rect.copy()
     self.drones_rect.topleft = self.vehicles_rect.move(0, 4).bottomleft
     self.money_rect = self.items_rect.copy()
     self.money_rect.w *= 1.35
     self.money_rect.midbottom = self.inv_rect.move(0, -10).midbottom
     self.data_rect = pygame.Rect(0, 0, 450, 225)
     self.data_rect.topleft = self.main_rect.move(5, 5).topleft
     self.rects = [
         self.items_rect, self.missiles_rect, self.licenses_rect,
         self.vehicles_rect, self.drones_rect
     ]
     self.rect_names = [
         "Items", "Missiles", "Licenses", "Vehicles", "Drones"
     ]
     self.rect_sel = 0
     self.done = False
     self.clock = pygame.time.Clock()
     self.items = store_data.getStuff("items", profile)
     self.missiles = {}
     self.licenses = store_data.getStuff("licenses", profile)
     self.vehicles = store_data.getStuff("vehicles", profile)
     self.drones = {}
     self.mapPoint = map_point
     if not hasattr(self.mapPoint, "store_data"):
         self.catagories = [
             self.items, self.missiles, self.licenses, self.vehicles,
             self.drones
         ]
         self.mapPoint.store_data = self.catagories
     else:
         self.catagories = self.mapPoint.store_data
     self.sel_num = [0, 0, 0, 0, 0]
     self.purchase_rect = pygame.Rect(0, 0, 175, 50)
     self.purchase_rect.midbottom = self.buy_rect.move(0, -5).midbottom
     self.exit_rect = pygame.Rect(0, 0, 275, 50)
     self.exit_rect.midbottom = self.purchase_rect.move(0, -5).midtop
     pygame.mixer.music.load(get_file(fixPath("music/stores.mp3")))
     pygame.mixer.music.play(-1)
Ejemplo n.º 14
0
def fmt(txt):
    return fixPath(txt.replace("ii_game/", "") + "/*")
Ejemplo n.º 15
0
from setuptools import setup
from ii_game.scripts.utils import fixPath
from ii_game import __version__
import os, shutil, sys

with open("README.md", "r") as fh:
    long_description = fh.read()


def fmt(txt):
    return fixPath(txt.replace("ii_game/", "") + "/*")


img_data = []
for r, d, f in os.walk(fixPath("ii_game/images/bitmap")):
    if not fmt(r) in img_data:
        img_data.append(fmt(r))

if sys.platform == "linux" and not "sdist" in sys.argv:
    if os.path.exists("/usr/share/icons"):
        shutil.copyfile("ii_game/icon.png",
                        "/usr/share/icons/ii_game-icon.png")
    if os.path.exists("/usr/share/applications"):
        shutil.copyfile("ii_game/ii_game.desktop",
                        "/usr/share/applications/ii_game.desktop")

setup(
    name="Interplanetary Invaders",
    version=__version__,
    author="NachoMonkey",
Ejemplo n.º 16
0
 def __init__(self, display, images, options=False, simple=False):
     self.images = images
     self.display = display
     self.options_lock = options
     if options:
         self.background = display.copy()
     try:
         screenshot_count = len(
             os.listdir(fixPath(get_file("data/screenshots"))))
     except FileNotFoundError:
         screenshot_count = 0
     s = "s"
     if screenshot_count == 1:
         s = ""
     self.options = [
         "Volume", "Cache Screenshots",
         f"Delete {screenshot_count} Screenshot{s}",
         "Stretch to Fullscreen", "Save", "Cancel"
     ]
     self.DEL = f"Delete {screenshot_count} Screenshot{s}"
     self.options_dict = saves.load_options()
     self.profiles = [
         "Profile #1", "Profile #2", "Profile #3", "Profile #4",
         "Profile #5", "Back"
     ]
     self.profile_selected = 0
     self.pause_motion = False
     for e, p in enumerate(self.profiles[:-1]):
         if saves.load_profile(e)["new"]:
             self.profiles[e] = f"New Profile #{e + 1}"
     if simple:
         return
     if not options:
         if not os.path.exists(fixPath(get_file("data/menuStarsCache"))):
             for x in range(300):
                 stars.main()
             with shelve.open(fixPath(
                     get_file("data/menuStarsCache"))) as data:
                 data["stars"] = stars.stars
         else:
             with shelve.open(fixPath(
                     get_file("data/menuStarsCache"))) as data:
                 stars.stars = data["stars"]
     self.frame = 1
     self.frame_rate = 1 / 120
     self.frame_time = 0
     self.finished = False
     self.time_passed = 0
     self.star_rotation = 0
     self.rotation_speed = 20
     self.done = False
     self.item_selected = 0
     self.items = ["Play", "Options", "Credits", "Quit"]
     self.play_mode = False
     self.options_mode = options
     self.option_selected = 0
     self.text_time = 0
     self.text_rate = 0.1
     self.text = "Interplanetary Invaders"
     self.bool_images = [self.images["x"], self.images["check"]]
     pygame.mixer.music.stop()
     pygame.mixer.music.load(fixPath(get_file("audio/music/MainMenu.mp3")))
     pygame.mixer.music.play(-1)
Ejemplo n.º 17
0
"""Autoloader gets images from IMAGE_PATH and puts in in a dictionary"""

import sys
import os
import pygame

from ii_game.scripts.get_file import get_file
from ii_game.scripts.utils import colorize, fixPath

IMAGE_PATH = get_file(fixPath("images/bitmap/"))


def remove_extension(filename):
    """Remove the extension from a filename string"""
    return filename[:filename.index(".")]


def fetch_images():
    """Collect images from the IMAGE_PATH and return dictionary
with pygame.Surface objects as values and their names as keys"""
    names = []
    images = []
    num = 0
    print("Loading... \n")
    mx = 0
    for data in os.walk(IMAGE_PATH):
        for collect_file in data[2]:
            if not collect_file.startswith("."):
                mx += 1
    for data in os.walk(IMAGE_PATH):
        root = data[0]
Ejemplo n.º 18
0
 def events(self):
     for event in pygame.event.get():
         click = False
         if event.type == pygame.MOUSEBUTTONDOWN:
             if self.button_rect.collidepoint(pygame.mouse.get_pos()):
                 click = True
         if event.type == pygame.KEYUP:
             if event.key == pygame.K_i:
                 cat = self.catagories[self.selected]
                 sel = self.sel_num[self.selected]
                 if self.selected != 2:
                     item = list(cat.keys())[sel]
                 else:
                     item = cat[sel][1]
                 if item:
                     display_info(self.display, self.images, item)
         if event.type == pygame.KEYDOWN:
             if event.key in (pygame.K_UP, pygame.K_w):
                 if not self.button_selected:
                     self.selected -= 1
                 else:
                     self.button_selected = False
             if event.key in (pygame.K_DOWN, pygame.K_s):
                 self.selected += 1
             if self.selected < 0:
                 self.selected = 0
             if self.selected == len(self.rects):
                 self.selected = len(self.rects) - 1
                 self.button_selected = True
             if event.key in (pygame.K_LEFT, pygame.K_a) and not self.button_selected:
                 self.sel_num[self.selected] -= 1
             if event.key in (pygame.K_RIGHT, pygame.K_d) and not self.button_selected:
                 self.sel_num[self.selected] += 1
             if self.sel_num[self.selected] < 0:
                 self.sel_num[self.selected] = 0
             if self.sel_num[self.selected] == len(self.catagories[self.selected]):
                 self.sel_num[self.selected] = len(self.catagories[self.selected]) - 1
             if event.key == pygame.K_RETURN and not self.button_selected:
                 cat = self.catagories[self.selected]
                 lcat = list(cat)
                 sel = self.sel_num[self.selected]
                 didSomething = False
                 if self.selected == 1:
                     for x in self.catagories[2]:
                         if x[1] == None:
                             if not lcat:
                                 return
                             didSomething = True
                             x[1] = lcat[sel]
                             if cat[lcat[sel]] == 1:
                                 cat.pop(lcat[sel])
                             else:
                                 cat[lcat[sel]] -= 1
                             break
                 if not didSomething:
                     Sound(fixPath("audio/donk.wav")).play()
                 if self.selected == 2 and cat[sel][1] != None:
                     done = False
                     for x in self.catagories[1]:
                         if x == cat[sel][1]:
                             self.catagories[1][x] += 1
                             done = True
                     if not done:
                         self.catagories[1][cat[sel][1]] = 1
                     cat[sel][1] = None
             if event.key == pygame.K_RETURN and self.button_selected:
                 click = True
         if click and not self.cannotContinue():
             self.done = True