diff --git a/assets/fonts/Monoton/Monoton-Regular.ttf b/assets/fonts/Monoton/Monoton-Regular.ttf new file mode 100755 index 0000000..0c32913 Binary files /dev/null and b/assets/fonts/Monoton/Monoton-Regular.ttf differ diff --git a/assets/fonts/Monoton/OFL.txt b/assets/fonts/Monoton/OFL.txt new file mode 100755 index 0000000..126b370 --- /dev/null +++ b/assets/fonts/Monoton/OFL.txt @@ -0,0 +1,94 @@ +Copyright (c) 2011 by vernon adams (vern@newtypography.co.uk), +with Reserved Font Names "Monoton" + +This Font Software is licensed under the SIL Open Font License, Version 1.1. +This license is copied below, and is also available with a FAQ at: +http://scripts.sil.org/OFL + + +----------------------------------------------------------- +SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 +----------------------------------------------------------- + +PREAMBLE +The goals of the Open Font License (OFL) are to stimulate worldwide +development of collaborative font projects, to support the font creation +efforts of academic and linguistic communities, and to provide a free and +open framework in which fonts may be shared and improved in partnership +with others. + +The OFL allows the licensed fonts to be used, studied, modified and +redistributed freely as long as they are not sold by themselves. The +fonts, including any derivative works, can be bundled, embedded, +redistributed and/or sold with any software provided that any reserved +names are not used by derivative works. The fonts and derivatives, +however, cannot be released under any other type of license. The +requirement for fonts to remain under this license does not apply +to any document created using the fonts or their derivatives. + +DEFINITIONS +"Font Software" refers to the set of files released by the Copyright +Holder(s) under this license and clearly marked as such. This may +include source files, build scripts and documentation. + +"Reserved Font Name" refers to any names specified as such after the +copyright statement(s). + +"Original Version" refers to the collection of Font Software components as +distributed by the Copyright Holder(s). + +"Modified Version" refers to any derivative made by adding to, deleting, +or substituting -- in part or in whole -- any of the components of the +Original Version, by changing formats or by porting the Font Software to a +new environment. + +"Author" refers to any designer, engineer, programmer, technical +writer or other person who contributed to the Font Software. + +PERMISSION & CONDITIONS +Permission is hereby granted, free of charge, to any person obtaining +a copy of the Font Software, to use, study, copy, merge, embed, modify, +redistribute, and sell modified and unmodified copies of the Font +Software, subject to the following conditions: + +1) Neither the Font Software nor any of its individual components, +in Original or Modified Versions, may be sold by itself. + +2) Original or Modified Versions of the Font Software may be bundled, +redistributed and/or sold with any software, provided that each copy +contains the above copyright notice and this license. These can be +included either as stand-alone text files, human-readable headers or +in the appropriate machine-readable metadata fields within text or +binary files as long as those fields can be easily viewed by the user. + +3) No Modified Version of the Font Software may use the Reserved Font +Name(s) unless explicit written permission is granted by the corresponding +Copyright Holder. This restriction only applies to the primary font name as +presented to the users. + +4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font +Software shall not be used to promote, endorse or advertise any +Modified Version, except to acknowledge the contribution(s) of the +Copyright Holder(s) and the Author(s) or with their explicit written +permission. + +5) The Font Software, modified or unmodified, in part or in whole, +must be distributed entirely under this license, and must not be +distributed under any other license. The requirement for fonts to +remain under this license does not apply to any document created +using the Font Software. + +TERMINATION +This license becomes null and void if any of the above conditions are +not met. + +DISCLAIMER +THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT +OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE +COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL +DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM +OTHER DEALINGS IN THE FONT SOFTWARE. diff --git a/assets/fonts/Pixelify_Sans/OFL.txt b/assets/fonts/Pixelify_Sans/OFL.txt new file mode 100644 index 0000000..d63d346 --- /dev/null +++ b/assets/fonts/Pixelify_Sans/OFL.txt @@ -0,0 +1,93 @@ +Copyright 2021 The Pixelify Sans Project Authors (https://github.com/eifetx/Pixelify-Sans) + +This Font Software is licensed under the SIL Open Font License, Version 1.1. +This license is copied below, and is also available with a FAQ at: +http://scripts.sil.org/OFL + + +----------------------------------------------------------- +SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 +----------------------------------------------------------- + +PREAMBLE +The goals of the Open Font License (OFL) are to stimulate worldwide +development of collaborative font projects, to support the font creation +efforts of academic and linguistic communities, and to provide a free and +open framework in which fonts may be shared and improved in partnership +with others. + +The OFL allows the licensed fonts to be used, studied, modified and +redistributed freely as long as they are not sold by themselves. The +fonts, including any derivative works, can be bundled, embedded, +redistributed and/or sold with any software provided that any reserved +names are not used by derivative works. The fonts and derivatives, +however, cannot be released under any other type of license. The +requirement for fonts to remain under this license does not apply +to any document created using the fonts or their derivatives. + +DEFINITIONS +"Font Software" refers to the set of files released by the Copyright +Holder(s) under this license and clearly marked as such. This may +include source files, build scripts and documentation. + +"Reserved Font Name" refers to any names specified as such after the +copyright statement(s). + +"Original Version" refers to the collection of Font Software components as +distributed by the Copyright Holder(s). + +"Modified Version" refers to any derivative made by adding to, deleting, +or substituting -- in part or in whole -- any of the components of the +Original Version, by changing formats or by porting the Font Software to a +new environment. + +"Author" refers to any designer, engineer, programmer, technical +writer or other person who contributed to the Font Software. + +PERMISSION & CONDITIONS +Permission is hereby granted, free of charge, to any person obtaining +a copy of the Font Software, to use, study, copy, merge, embed, modify, +redistribute, and sell modified and unmodified copies of the Font +Software, subject to the following conditions: + +1) Neither the Font Software nor any of its individual components, +in Original or Modified Versions, may be sold by itself. + +2) Original or Modified Versions of the Font Software may be bundled, +redistributed and/or sold with any software, provided that each copy +contains the above copyright notice and this license. These can be +included either as stand-alone text files, human-readable headers or +in the appropriate machine-readable metadata fields within text or +binary files as long as those fields can be easily viewed by the user. + +3) No Modified Version of the Font Software may use the Reserved Font +Name(s) unless explicit written permission is granted by the corresponding +Copyright Holder. This restriction only applies to the primary font name as +presented to the users. + +4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font +Software shall not be used to promote, endorse or advertise any +Modified Version, except to acknowledge the contribution(s) of the +Copyright Holder(s) and the Author(s) or with their explicit written +permission. + +5) The Font Software, modified or unmodified, in part or in whole, +must be distributed entirely under this license, and must not be +distributed under any other license. The requirement for fonts to +remain under this license does not apply to any document created +using the Font Software. + +TERMINATION +This license becomes null and void if any of the above conditions are +not met. + +DISCLAIMER +THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT +OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE +COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL +DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM +OTHER DEALINGS IN THE FONT SOFTWARE. diff --git a/assets/fonts/Pixelify_Sans/PixelifySans-VariableFont_wght.ttf b/assets/fonts/Pixelify_Sans/PixelifySans-VariableFont_wght.ttf new file mode 100644 index 0000000..e1f5860 Binary files /dev/null and b/assets/fonts/Pixelify_Sans/PixelifySans-VariableFont_wght.ttf differ diff --git a/assets/fonts/Pixelify_Sans/README.txt b/assets/fonts/Pixelify_Sans/README.txt new file mode 100644 index 0000000..f844f0d --- /dev/null +++ b/assets/fonts/Pixelify_Sans/README.txt @@ -0,0 +1,66 @@ +Pixelify Sans Variable Font +=========================== + +This download contains Pixelify Sans as both a variable font and static fonts. + +Pixelify Sans is a variable font with this axis: + wght + +This means all the styles are contained in a single file: + PixelifySans-VariableFont_wght.ttf + +If your app fully supports variable fonts, you can now pick intermediate styles +that aren’t available as static fonts. Not all apps support variable fonts, and +in those cases you can use the static font files for Pixelify Sans: + static/PixelifySans-Regular.ttf + static/PixelifySans-Medium.ttf + static/PixelifySans-SemiBold.ttf + static/PixelifySans-Bold.ttf + +Get started +----------- + +1. Install the font files you want to use + +2. Use your app's font picker to view the font family and all the +available styles + +Learn more about variable fonts +------------------------------- + + https://developers.google.com/web/fundamentals/design-and-ux/typography/variable-fonts + https://variablefonts.typenetwork.com + https://medium.com/variable-fonts + +In desktop apps + + https://theblog.adobe.com/can-variable-fonts-illustrator-cc + https://helpx.adobe.com/nz/photoshop/using/fonts.html#variable_fonts + +Online + + https://developers.google.com/fonts/docs/getting_started + https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Fonts/Variable_Fonts_Guide + https://developer.microsoft.com/en-us/microsoft-edge/testdrive/demos/variable-fonts + +Installing fonts + + MacOS: https://support.apple.com/en-us/HT201749 + Linux: https://www.google.com/search?q=how+to+install+a+font+on+gnu%2Blinux + Windows: https://support.microsoft.com/en-us/help/314960/how-to-install-or-remove-a-font-in-windows + +Android Apps + + https://developers.google.com/fonts/docs/android + https://developer.android.com/guide/topics/ui/look-and-feel/downloadable-fonts + +License +------- +Please read the full license text (OFL.txt) to understand the permissions, +restrictions and requirements for usage, redistribution, and modification. + +You can use them in your products & projects – print or digital, +commercial or otherwise. + +This isn't legal advice, please consider consulting a lawyer and see the full +license for all details. diff --git a/assets/fonts/Pixelify_Sans/static/PixelifySans-Bold.ttf b/assets/fonts/Pixelify_Sans/static/PixelifySans-Bold.ttf new file mode 100644 index 0000000..4d8aeb6 Binary files /dev/null and b/assets/fonts/Pixelify_Sans/static/PixelifySans-Bold.ttf differ diff --git a/assets/fonts/Pixelify_Sans/static/PixelifySans-Medium.ttf b/assets/fonts/Pixelify_Sans/static/PixelifySans-Medium.ttf new file mode 100644 index 0000000..2717e13 Binary files /dev/null and b/assets/fonts/Pixelify_Sans/static/PixelifySans-Medium.ttf differ diff --git a/assets/fonts/Pixelify_Sans/static/PixelifySans-Regular.ttf b/assets/fonts/Pixelify_Sans/static/PixelifySans-Regular.ttf new file mode 100644 index 0000000..37deb9a Binary files /dev/null and b/assets/fonts/Pixelify_Sans/static/PixelifySans-Regular.ttf differ diff --git a/assets/fonts/Pixelify_Sans/static/PixelifySans-SemiBold.ttf b/assets/fonts/Pixelify_Sans/static/PixelifySans-SemiBold.ttf new file mode 100644 index 0000000..f851241 Binary files /dev/null and b/assets/fonts/Pixelify_Sans/static/PixelifySans-SemiBold.ttf differ diff --git a/globals.py b/globals.py index e764e85..7aba960 100644 --- a/globals.py +++ b/globals.py @@ -10,6 +10,11 @@ STAFFPOS = (175, 275, 375, 475, 575) FPS = 60 +probability = 10 + +SPEED_LEVEL = 15 +PROB_LEVEL = 30 + # Staff change sounds pygame.mixer.init() STAFFSOUNDS = ( diff --git a/main.py b/main.py index d428e2b..29db9cb 100644 --- a/main.py +++ b/main.py @@ -8,6 +8,7 @@ import logging from pygame.locals import * +from textcontent import * # Basic pygame boilerplate code with event loop pygame.init() @@ -16,20 +17,40 @@ FramePerSec = pygame.time.Clock() +# Setup player and obstacles game_obstacles = obstacles.ObstacleList() -player1 = notes.Player() +player = notes.Player() + +# Setup logging +logging.basicConfig( + filename="./gamelog.log", + format="%(asctime)s,%(msecs)d %(name)s %(levelname)s %(message)s", + datefmt="%H:%M:%S", + level=logging.DEBUG, +) + +logger = logging.getLogger("main") + + +BLINK_EVENT = pygame.USEREVENT + 1 +show_prompt = True +pygame.time.set_timer(BLINK_EVENT, 500) def check_collision(): + """ + Check for collisions between the player and obstacles. If there is a collision, convert the player sprite to that of the obstacle. After 3 collisions, the game ends. + """ hits = pygame.sprite.spritecollide( - player1, globals.obstacles_group, False, collided=pygame.sprite.collide_mask + player, globals.obstacles_group, False, collided=pygame.sprite.collide_mask ) if hits: - print("Collision detected:") - if player1.hit_count < 3: + logger.info("Collision detected:") + pygame.draw.rect(DISPLAYSURF, (0, 0, 0), (0, 50, globals.WIDTH, 50)) + if player.hit_count < 3: # Increase hit count and display it - player1.hit_count += 1 - print("Hit count: " + str(player1.hit_count)) + player.hit_count += 1 + logger.debug("Hit count: " + str(player.hit_count)) # Remove the obstacles from the list for obj in hits: @@ -37,9 +58,9 @@ def check_collision(): obj.hide_obstacle(DISPLAYSURF) # Convert the player sprite to that of the obstacle - player1.convert_to_obstacle(DISPLAYSURF, hits[0]) + player.convert_to_obstacle(DISPLAYSURF, hits[0]) else: - print("Game over") + logger.debug("Game over") pygame.quit() sys.exit() @@ -50,35 +71,93 @@ def check_collision(): pygame.quit() sys.exit() elif event.type == pygame.KEYDOWN: - dir = ( - globals.Direction.UP - if event.key == pygame.K_UP - else globals.Direction.DOWN + if display_splash: + display_splash = False + + # Hide the splash screen + pygame.draw.rect( + DISPLAYSURF, (0, 0, 0), (0, 0, globals.WIDTH, globals.HEIGHT) + ) + continue + + if event.key == pygame.K_UP: + dir = globals.Direction.UP + elif event.key == pygame.K_DOWN: + dir = globals.Direction.DOWN + else: + dir = None + + player.staff_movement(DISPLAYSURF, dir) + elif event.type == BLINK_EVENT: + show_prompt = not show_prompt + + if display_splash: + # Display splash screen + ( + (splash_text, splash_text_rect), + info_lines, + (prompt_text, prompt_text_rect), + ) = setup_splash_screen() + DISPLAYSURF.blit(splash_text, splash_text_rect) + if show_prompt: + DISPLAYSURF.blit(prompt_text, prompt_text_rect) + else: + pygame.draw.rect( + DISPLAYSURF, (0, 0, 0), (0, 600, globals.WIDTH, globals.HEIGHT - 100) ) - player1.staff_movement(DISPLAYSURF, dir) - - # Display the player - player1.draw(DISPLAYSURF) - - # Check for collisions - # player1.check_collision() - check_collision() - - # Display and move the obstacles - if random.randint(0, 1000) < 10: - game_obstacles.add_obstacle() - game_obstacles.move_obstacles(DISPLAYSURF) - - # Display the 5 staff lines at equal intervals in the y direction - staff_lines = [ - platforms.Staff(globals.STAFFPOS[0]), - platforms.Staff(globals.STAFFPOS[1]), - platforms.Staff(globals.STAFFPOS[2]), - platforms.Staff(globals.STAFFPOS[3]), - platforms.Staff(globals.STAFFPOS[4]), - ] - for staff_line in staff_lines: - staff_line.draw(DISPLAYSURF) + + for info_line in info_lines: + DISPLAYSURF.blit(info_line[0], info_line[1]) + + else: + # Display the player + player.draw(DISPLAYSURF) + + # Check for collisions + # player.check_collision() + check_collision() + + # Display the hit count + hit_count_text, hit_count_text_rect = hits_text(player.hit_count) + DISPLAYSURF.blit(hit_count_text, hit_count_text_rect) + + score_text, score_text_rect = scores_text(player.score) + DISPLAYSURF.blit(score_text, score_text_rect) + prev_score = player.score + player.score += 0.01 + + # Remove the score from the screen if it changes + if int(prev_score) != int(player.score): + pygame.draw.rect(DISPLAYSURF, (0, 0, 0), (globals.WIDTH - 200, 50, 200, 50)) + + # Increase the speed of the obstacles every 15 points + if int(prev_score / globals.SPEED_LEVEL) != int( + player.score / globals.SPEED_LEVEL + ): + game_obstacles.speed += 1 + + # Increase the probability of adding an obstacle every 30 points + if int(prev_score / globals.PROB_LEVEL) != int( + player.score / globals.PROB_LEVEL + ): + globals.probability += 1 + + # Display and move the obstacles + # Starting probability of adding an obstacle is 10 / 1000 + if random.randint(0, 1000) < globals.probability: + game_obstacles.add_obstacle() + game_obstacles.move_obstacles(DISPLAYSURF) + + # Display the 5 staff lines at equal intervals in the y direction + staff_lines = [ + platforms.Staff(globals.STAFFPOS[0]), + platforms.Staff(globals.STAFFPOS[1]), + platforms.Staff(globals.STAFFPOS[2]), + platforms.Staff(globals.STAFFPOS[3]), + platforms.Staff(globals.STAFFPOS[4]), + ] + for staff_line in staff_lines: + staff_line.draw(DISPLAYSURF) pygame.display.update() FramePerSec.tick(globals.FPS) diff --git a/notes.py b/notes.py index 459e104..ab796d6 100644 --- a/notes.py +++ b/notes.py @@ -70,10 +70,11 @@ def __init__( super().__init__(image, x, globals.STAFFPOS[staff_loc], offset_x, offset_y) self.color_player() self.hit_count = 0 + self.score = 0 def color_player(self): colorImage = pygame.Surface(self.orig_image.get_size()).convert_alpha() - colorImage.fill((134, 217, 119, 255)) + colorImage.fill((100, 255, 100, 255)) final_image = self.orig_image.copy() final_image.blit(colorImage, (0, 0), special_flags=pygame.BLEND_RGBA_MULT) self.image = final_image @@ -102,6 +103,8 @@ def staff_movement(self, surface, dir: globals.Direction): return elif self.staff_loc == 4 and dir == globals.Direction.DOWN: return + elif dir == None: + return pygame.draw.rect(surface, (0, 0, 0), self.rect) prev_y = globals.STAFFPOS[self.staff_loc] self.staff_loc += dir.value diff --git a/obstacles.py b/obstacles.py index d01c0e0..d7ea547 100644 --- a/obstacles.py +++ b/obstacles.py @@ -49,18 +49,18 @@ def __init__( image = pygame.image.load(image) super().__init__(image, x, globals.STAFFPOS[staff_loc], offset_x, offset_y) colorImage = pygame.Surface(self.orig_image.get_size()).convert_alpha() - colorImage.fill((245, 123, 86, 255)) + colorImage.fill((255, 100, 100, 255)) self.image.blit(colorImage, (0, 0), special_flags=pygame.BLEND_RGBA_MULT) - def move_left(self, surface): + def move_left(self, surface, speed=1): """ Move the obstacle across the screen """ # draw a black rect over the obstacle's previous position pygame.draw.rect(surface, (0, 0, 0), self.rect) # move the obstacle left by 1 pixel - self.x -= 1 - self.rect.move_ip(-1, 0) + self.x -= speed + self.rect.move_ip(-speed, 0) # draw the obstacle at its new position self.draw(surface) @@ -93,6 +93,7 @@ def __init__(self): """ self.obstacles = [] self.rightmost_occupied_px = [0, 0, 0, 0, 0] + self.speed = 1 def add_obstacle(self): """ @@ -130,7 +131,7 @@ def move_obstacles(self, surface): Move all obstacles in the list, while updating the occupied staff lines """ for obstacle in self.obstacles: - obstacle.move_left(surface) + obstacle.move_left(surface, self.speed) w = obstacle.rect.width if obstacle.x + obstacle.offset_x + w / 2 < 0: self.remove_obstacle(obstacle) diff --git a/textcontent.py b/textcontent.py new file mode 100644 index 0000000..45abd0c --- /dev/null +++ b/textcontent.py @@ -0,0 +1,94 @@ +import pygame +import sys +import globals + +from pygame.locals import * + +# Setup font for splash screen +pygame.font.init() +title_font_path = "./assets/fonts/Monoton/Monoton-Regular.ttf" +title_font_size = 54 +title_font_obj = pygame.font.Font(title_font_path, title_font_size) + +# Setup font for in game text +game_font_path = "./assets/fonts/Pixelify_Sans/PixelifySans-VariableFont_wght.ttf" +game_font_size = 28 +game_font_obj = pygame.font.Font(game_font_path, game_font_size) + +# Splash screen display boolean +display_splash = True + + +def hits_text(hit_count: int): + hit_count_text = game_font_obj.render( + "Hits left: " + "x " * (3 - hit_count), True, (255, 255, 255) + ).convert_alpha() + hit_count_text_rect = hit_count_text.get_rect() + hit_count_text_rect.center = (hit_count_text_rect.width / 2 + 10, 75) + return (hit_count_text, hit_count_text_rect) + + +def scores_text(score: int): + score_text = game_font_obj.render( + "Score: " + str(int(score)), True, (255, 255, 255) + ).convert_alpha() + score_text_rect = score_text.get_rect() + score_text_rect.center = (globals.WIDTH - score_text_rect.width / 2 - 10, 75) + return (score_text, score_text_rect) + + +def setup_splash_screen(): + # Setup splash screen text + splash_text = title_font_obj.render( + "The Eighth Run", True, (255, 255, 255) + ).convert_alpha() + splash_text_rect = splash_text.get_rect(center=(globals.WIDTH / 2, 100)) + info_text_line1 = game_font_obj.render( + "Welcome to The Eighth Run!", True, (255, 255, 255) + ).convert_alpha() + info_text_line1_rect = info_text_line1.get_rect(center=(globals.WIDTH / 2, 200)) + info_text_line2 = game_font_obj.render( + "Use the up and down arrow keys to move the player (green)", + True, + (255, 255, 255), + ).convert_alpha() + info_text_line2_rect = info_text_line2.get_rect(center=(globals.WIDTH / 2, 250)) + info_text_line3 = game_font_obj.render( + "Avoid the obstacles (red notes)", + True, + (255, 100, 100), + ).convert_alpha() + info_text_line3_rect = info_text_line3.get_rect(center=(globals.WIDTH / 2, 300)) + info_text_line6 = game_font_obj.render( + "Collect the powerups (blue rests)", True, (100, 100, 255) + ).convert_alpha() + info_text_line6_rect = info_text_line6.get_rect(center=(globals.WIDTH / 2, 350)) + info_text_line4 = game_font_obj.render( + "If hit an obstacle, you will convert into it", + True, + (255, 255, 255), + ).convert_alpha() + info_text_line4_rect = info_text_line4.get_rect(center=(globals.WIDTH / 2, 400)) + info_text_line5 = game_font_obj.render( + "You can take maximum 3 hits", True, (255, 255, 255) + ).convert_alpha() + info_text_line5_rect = info_text_line5.get_rect(center=(globals.WIDTH / 2, 450)) + prompt_text = game_font_obj.render( + "Press any key to start", True, (255, 255, 255) + ).convert_alpha() + prompt_text_rect = prompt_text.get_rect( + center=(globals.WIDTH / 2, globals.HEIGHT - 100) + ) + info_lines = ( + (info_text_line1, info_text_line1_rect), + (info_text_line2, info_text_line2_rect), + (info_text_line3, info_text_line3_rect), + (info_text_line4, info_text_line4_rect), + (info_text_line5, info_text_line5_rect), + (info_text_line6, info_text_line6_rect), + ) + return ( + (splash_text, splash_text_rect), + info_lines, + (prompt_text, prompt_text_rect), + )