removed redunant variables

small-fixes-for-0.3.3
Max Lange 8 years ago
parent 84650dfc15
commit e58a5de65a

@ -200,6 +200,7 @@ def main():
settings.quit()
pygame.display.flip()
sounds.music.play("next", 0)
pygame.mouse.set_visible(False)
def pause():
@ -237,6 +238,8 @@ def pause():
sounds.music.play("unpause")
settings.upd("get_saves")
run = False
else:
pygame.mouse.set_visible(True)
if event == "Settings":
options()
pause_menu.update()
@ -244,6 +247,7 @@ def pause():
main()
run = False
pygame.display.flip()
pygame.mouse.set_visible(False)
def choose_world():
@ -313,8 +317,9 @@ def inputpopup(x, y, header):
# savegame if header is saying so
screen = settings.screen
fade = settings.fade
fade_pos = settings.fade_pos
fade = pygame.Surface((settings.screenx_current, settings.screeny_current))
fade.fill((0, 0, 0, 255))
fade_pos = fade.get_rect()
infield1 = menu.disp_elem.input_field(x, y, header,
settings.typeface, settings.color, settings.field)
@ -399,6 +404,7 @@ def savegames():
pygame.time.delay(50)
pygame.display.flip()
pygame.mouse.set_visible(False)
def options():
@ -451,3 +457,4 @@ def options():
10 + (5 * button_size))
menu.IO.write("./assets/templates/default.vars", "ratio", 1100)
settings.upd("adjust_screen")
pygame.mouse.set_visible(False)

@ -37,8 +37,10 @@ def handle(usage):
settings.save(settings.current_game)
fade = settings.fade
fade_pos = settings.fade_pos
fade = pygame.Surface((settings.screenx_current, settings.screeny_current))
fade.fill((0, 0, 0))
fade.set_alpha(0)
fade_pos = fade.get_rect()
font = pygame.font.SysFont(settings.typeface, 50)

@ -15,8 +15,10 @@ def run():
lines = []
lines_pos = []
itera = -1
fade = settings.fade
fade_pos = settings.fade_pos
fade = pygame.Surface((settings.screenx_current, settings.screeny_current))
fade.fill((0, 0, 0))
fade.set_alpha(0)
fade_pos = fade.get_rect()
pygame.mouse.set_visible(False)
fade.set_alpha(255)

@ -28,21 +28,13 @@ def init():
global aspect_ratio # aspect ratio
global screenx_current # current x pixels
global screeny_current # current y pixels
global fade # a black surface
global fade_pos # position of the black surface
global fake_size # the ratio of screenx_current and size of the background
global bullets # list of all bullets
global dstars # amount of stars
global debugscreen # determines wether to show debug info
global debugmode # Enables debugmode
global isnear # easteregg
global button # image for the button
global buttonover # = when hovered over
global buttonclick # = when clicked
global field # image for the inputfield
global field1 # other image for inputfield
global knob # knob image
global box # button image
global bullet_img # image for the bullet
global targeton_img # surf for target whenlight turned on
global targetoff_img # surf for target when turned off
@ -60,18 +52,16 @@ def init():
global explosions_disp # list of showing explosions
global run # boolean for main loop
global dtargets # amount of targets
global include_music
global morevents
global infinitevents
global musicend
global border1
global morevents # custom event logger
global infinitevents # A event logger which retriggers as long as condition
global musicend # custom event number to show that music ended
global border1 # A box to hold the status information about energy level
global world # a placeholder for the world class
global objects_on_screen # entitys currently blitted to screen
global player # abstract player class
global localmap # A dict of the local worlds
global loading_time # time until first blit
global seed # the environments seed
global button_ratio # The ratio from height to length of buttons
# for this operation os.urandom is used
seed_size = 16
@ -97,11 +87,7 @@ def init():
# load images and convert them to the fatest blittable format
background = pygame.image.load("./assets/sprites/Background2.tif").convert()
fade = pygame.Surface((screenx, screeny))
#TODO remove use of button
button = pygame.image.load("./assets/sprites/Button1.tif").convert_alpha()
field = pygame.image.load("./assets/sprites/inputbox1.tif").convert_alpha()
field1 = pygame.image.load("./assets/sprites/inputbox2.tif").convert_alpha()
bullet_img = pygame.image.load("./assets/sprites/Bullet.tif").convert_alpha()
targeton_img = pygame.image.load("./assets/sprites/mine_on.tif"
).convert_alpha()
@ -109,20 +95,17 @@ def init():
).convert_alpha()
border1 = pygame.image.load("./assets/sprites/bar1.tif").convert_alpha()
fade_pos = fade.get_rect() # lint:ok
# define some konstants or default values
clock = pygame.time.Clock()
typeface = "monospace"
stdfont = pygame.font.SysFont(typeface, 15)
version = "0.3.2.8 dev"
version = "0.3.2.9 dev"
up = False
down = False
left = False
right = False
konstspeed = 0.0025
button_ratio = 7.0
fullscreen = False
debugscreen = False
debugmode = True
@ -139,7 +122,6 @@ def init():
current_game = "default"
run = True
dtargets = 5
include_music = False
morevents = []
bullets = []
infinitevents = {"fire1": False, "roundfire": False}
@ -216,7 +198,6 @@ def reset():
pygame.mouse.set_visible(False)
player.reset()
fade_pos = fade.get_rect() # lint:ok
konstspeed = 0.0025
color = (255, 255, 10)

Loading…
Cancel
Save