{"id":9071,"date":"2021-03-28T13:04:47","date_gmt":"2021-03-28T11:04:47","guid":{"rendered":"https:\/\/pythonprogramming.altervista.org\/?p=9071"},"modified":"2021-03-28T18:34:28","modified_gmt":"2021-03-28T16:34:28","slug":"splash-text-page-with-pygame","status":"publish","type":"post","link":"https:\/\/pythonprogramming.altervista.org\/splash-text-page-with-pygame\/","title":{"rendered":"How to make a Splash text page with Pygame"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Some little changes to make the code more usable to get this result. Now you can omit the vertical position. To put an empty line, use two commas ,,<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/pythonprogramming.altervista.org\/wp-content\/uploads\/2021\/03\/image-64.png\"><img loading=\"lazy\" decoding=\"async\" width=\"500\" height=\"652\" src=\"https:\/\/pythonprogramming.altervista.org\/wp-content\/uploads\/2021\/03\/image-64.png\" alt=\"\" class=\"wp-image-9072\" srcset=\"https:\/\/pythonprogramming.altervista.org\/wp-content\/uploads\/2021\/03\/image-64.png 500w, https:\/\/pythonprogramming.altervista.org\/wp-content\/uploads\/2021\/03\/image-64-320x417.png 320w\" sizes=\"auto, (max-width: 500px) 100vw, 500px\" \/><\/a><\/figure>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">import pygame\n \n \ndef render_multiline(data):\n        \"Shows a multiline string with text, y pos and color for each line separated by comma\"\n        tc = []\n        for line in data.split(\"\\n\"):\n \n            if line != \"\":\n                text, height, color = line.split(\",\")\n                if height == \" \" or height == \"\":\n                    height = 0\n                    if color == \" \" or color == \"\":\n                        color = \"red\"\n                else:\n                    height = int(height)\n                tc.append([text, height, color])\n        # 2. Each list of the list above is send to write to render text\n        cnt = 0\n        for t, height, c in tc:\n            cnt += 30\n            # calls write passing the text, the vertical position and the color\n            for i in t.split(\"\\n\"):\n                if height == 0:\n                    height = cnt\n                write(i, 200, height, color=c)\n                height += 30\n \n\"\"\"\nINSERT:\ntext, vertical position, color\n\n1. you can omit the vertical position\n2. To put a blank line use ,,\n\"\"\"\nTEXT1 = \"\"\"*** ARKAGAME ***, , gold\nA Game by Giovanni Gatto, , red\n,,\npythonprogramming.altevista.org, , coral\nGame vaguely inspired by classic games, , cyan\nlike breakout or Arkanoid, , cyan\n,,\nCHOOSE YOUR GAME, , green\n1 - Monochromatic, , cyan\n2 - Full color, , cyan\n3 - Tiny breaks, , cyan\n4 - Tiny version 2, , cyan\n5 - Randomized Versions, , cyan\n,,\nUse the mouse to move the bar, , coral\n,,\n************ August 2020 - Genuary 2021 *************, , gray\"\"\"\n \npygame.init()\n \n \ndef write(text, x, y, color=\"Coral\",):\n    \"Returns a surface with a text in the center of the screen, at y coord.\"\n    \n    surface_text = font1.render(text, 1, pygame.Color(color))\n    text_rect = surface_text.get_rect(center=(500 \/\/ 2, y))\n    screen.blit(surface_text, text_rect)\n    return surface_text\n \n\n\ndef mainloop():\n    \"\"\"Here's where all happens\"\"\"\n    global screen, clock, font1, font2\n\n    screen = pygame.display.set_mode((500, 600))\n    clock = pygame.time.Clock()\n\n    Font = pygame.font.SysFont\n    font1 = Font(\"Arial\", 24)\n    font2 = Font(\"Arial\", 20)\n    while True:\n        for event in pygame.event.get():\n            if event.type == pygame.QUIT:\n                pygame.quit()\n                exit()\n            render_multiline(TEXT1)\n            clock.tick(30)\n            pygame.display.update()\n\nmainloop()<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Splash page with particles<\/h2>\n\n\n\n<figure class=\"wp-block-video\"><video height=\"768\" style=\"aspect-ratio: 640 \/ 768;\" width=\"640\" controls src=\"https:\/\/pythonprogramming.altervista.org\/wp-content\/uploads\/2021\/03\/pygame-window-2021-03-28-13-24-17.mp4\"><\/video><\/figure>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">import pygame\nimport random \n\nclass Particles(pygame.sprite.Sprite):\n    \"Creates particles starting from pos with a color\"\n\n    def __init__(self, pos, direction, color, sparse=0, turn=\"on\"):\n        super(Particles, self).__init__()\n        self.list_of_particles = []\n        self.pos = pos\n        self.color = color\n        self.direction = direction\n        self.sparse = sparse # generate particles not from the same starting point\n        # self.generate_particles()\n        group.append(self)\n        self.turn = turn # this makes the effect visible\n\n    def choose_directions(self):\n        \"Makes particles go in every direction you want\"\n        # Make the flow go down\n        if self.direction == \"down\":\n            self.direction = 1\n        elif self.direction == \"up\":\n            self.direction = -1\n        # Make the particles spread all directions\n        elif self.direction == \"all\":\n            self.direction = random.randint(-1, 1)\n\n    def generate_particles(self):\n        \"List with position etc of particles\"\n\n        if self.sparse == 1:\n            self.pos[0] = random.randint(0, 600)\n        self.choose_directions()\n        if random.randint(1, 30) == 1:\n            self.list_of_particles.append([\n                [self.pos[0], self.pos[1]],\n                [random.randint(0, 20) \/ 10 - 1, self.direction],\n                random.randint(4,6)])\n        \n        # Moving the coordinates and size of self.list_of_particles\n        for particle in self.list_of_particles[:]:\n            particle[0][0] += particle[1][0]\n            particle[0][1] += particle[1][1]\n            particle[2] -= 0.005 # how fast circles shrinks\n            particle[1][1] += 0.01 # circles speed\n            # if particle[2] &lt;= 0:\n            c1 = particle[2] &lt; 0 or particle[0][1] > 900 \n            c2 = particle[0][1] &lt; 0 or particle[0][0] &lt; 0 or particle[0][0] > 800\n            if c1 or c2:\n                self.list_of_particles.remove(particle)\n                \n            # do not call draw from here: it slows down the frame rate\n            # self.draw()\n        return self.list_of_particles\n    \n    # def draw(self):\n    #     \"Draws particles based on data in the self.list_of_particles\"\n    #     if self.turn == \"on\":\n    #         for particle in self.list_of_particles:\n    #              pygame.draw.circle(\n    #                 window2, (self.color),\n    #             (round(particle[0][0]), round(particle[0][1])),\n    #              round(particle[2]))\ngroup = []\np1 = 1\n# Some random colors\nRED = (255, 0, 0) \nGREEN = (0, 255, 0)\nYELLOW = (255, 255, 0)\nCYAN = (0, 255, 255)\nBLUE = (0, 0, 255)\nWHITE = (255, 255, 255)\nGRAY = (255, 255, 244, 100)\nGRAY1 = (240, 240, 220, 200)\nGRAY2 = (200, 200, 244, 0)\nGRAY3 = (220, 200, 220, 200)\n# Creating the list with particles ready to be drawn\nParticles([0, 0], direction=\"down\", color=GRAY, sparse=1)\nParticles([0, 0], direction=\"down\", color=GRAY1, sparse=1)\nParticles([0, 0], direction=\"down\", color=GRAY2, sparse=1)\nParticles([0, 0], direction=\"down\", color=GRAY3, sparse=1)\n\n\n\ndef generate():\n    \"Start drawing all circles on the screen\"\n    for par in group:\n        particles = par.generate_particles()\n        draw(par, particles)\n\ndef draw(par, particles):\n    for particle in particles:\n         pygame.draw.circle(\n            window2, (par.color),\n        (round(particle[0][0]), round(particle[0][1])),\n         round(particle[2]))\n\ndef render_multiline(data):\n        \"Shows a multiline string with text, y pos and color for each line separated by comma\"\n        tc = []\n        for line in data.split(\"\\n\"):\n \n            if line != \"\":\n                text, height, color = line.split(\",\")\n                if height == \" \" or height == \"\":\n                    height = 0\n                    if color == \" \" or color == \"\":\n                        color = \"red\"\n                else:\n                    height = int(height)\n                tc.append([text, height, color])\n        # 2. Each list of the list above is send to write to render text\n        cnt = 0\n        for t, height, c in tc:\n            cnt += 30\n            # calls write passing the text, the vertical position and the color\n            for i in t.split(\"\\n\"):\n                if height == 0:\n                    height = cnt\n                write(i, 200, height, color=c)\n                height += 30\n \n\"\"\"\nINSERT:\ntext, vertical position, color\n\n1. you can omit the vertical position\n2. To put a blank line use ,,\n\"\"\"\nTEXT1 = \"\"\"*** ARKAGAME ***, , gold\nA Game by Giovanni Gatto, , red\n,,\npythonprogramming.altevista.org, , coral\nGame vaguely inspired by classic games, , cyan\nlike breakout or Arkanoid, , cyan\n,,\nCHOOSE YOUR GAME, , green\n1 - Monochromatic, , cyan\n2 - Full color, , cyan\n3 - Tiny breaks, , cyan\n4 - Tiny version 2, , cyan\n5 - Randomized Versions, , cyan\n,,\nUse the mouse to move the bar, , coral\n,,\n************ August 2020 - Genuary 2021 *************, , gray\"\"\"\n \npygame.init()\n \n \ndef write(text, x, y, color=\"Coral\",):\n    \"Returns a surface with a text in the center of the screen, at y coord.\"\n    \n    surface_text = font1.render(text, 1, pygame.Color(color))\n    text_rect = surface_text.get_rect(center=(500 \/\/ 2, y))\n    screen.blit(surface_text, text_rect)\n    return surface_text\n \n\nwindow2 = pygame.Surface((500, 600))\ndef mainloop():\n    \"\"\"Here's where all happens\"\"\"\n    global screen, clock, font1, font2\n\n    screen = pygame.display.set_mode((500, 600))\n    clock = pygame.time.Clock()\n\n    Font = pygame.font.SysFont\n    font1 = Font(\"Arial\", 24)\n    font2 = Font(\"Arial\", 20)\n    while True:\n        for event in pygame.event.get():\n            if event.type == pygame.QUIT:\n                pygame.quit()\n                exit()\n        window2.fill(0)\n        generate()\n        screen.blit(window2, (0, 0))\n        render_multiline(TEXT1)\n        clock.tick(60)\n        pygame.display.update()\n\nmainloop()<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">This post is the fusion of 2 older posts<\/h2>\n\n\n\n<figure class=\"wp-block-gallery columns-3 is-cropped wp-block-gallery-1 is-layout-flex wp-block-gallery-is-layout-flex\"><ul class=\"blocks-gallery-grid\"><li class=\"blocks-gallery-item\"><figure><a href=\"https:\/\/pythonprogramming.altervista.org\/wp-content\/uploads\/2021\/03\/image-36.png\"><img loading=\"lazy\" decoding=\"async\" width=\"601\" height=\"431\" src=\"https:\/\/pythonprogramming.altervista.org\/wp-content\/uploads\/2021\/03\/image-36.png\" alt=\"\" data-id=\"8880\" data-full-url=\"https:\/\/pythonprogramming.altervista.org\/wp-content\/uploads\/2021\/03\/image-36.png\" data-link=\"https:\/\/pythonprogramming.altervista.org\/particles-effects-in-videogames-with-pygame-and-python\/image-36-3\/\" class=\"wp-image-8880\" srcset=\"https:\/\/pythonprogramming.altervista.org\/wp-content\/uploads\/2021\/03\/image-36.png 601w, https:\/\/pythonprogramming.altervista.org\/wp-content\/uploads\/2021\/03\/image-36-320x229.png 320w, https:\/\/pythonprogramming.altervista.org\/wp-content\/uploads\/2021\/03\/image-36-321x229.png 321w\" sizes=\"auto, (max-width: 601px) 100vw, 601px\" \/><\/a><\/figure><\/li><li class=\"blocks-gallery-item\"><figure><a href=\"https:\/\/pythonprogramming.altervista.org\/wp-content\/uploads\/2021\/03\/image-2.png\"><img loading=\"lazy\" decoding=\"async\" width=\"802\" height=\"632\" src=\"https:\/\/pythonprogramming.altervista.org\/wp-content\/uploads\/2021\/03\/image-2.png\" alt=\"\" data-id=\"8766\" data-full-url=\"https:\/\/pythonprogramming.altervista.org\/wp-content\/uploads\/2021\/03\/image-2.png\" data-link=\"https:\/\/pythonprogramming.altervista.org\/making-snow-and-rain-effects-with-pygame-and-particle\/image-2-4\/\" class=\"wp-image-8766\" srcset=\"https:\/\/pythonprogramming.altervista.org\/wp-content\/uploads\/2021\/03\/image-2.png 802w, https:\/\/pythonprogramming.altervista.org\/wp-content\/uploads\/2021\/03\/image-2-320x252.png 320w, https:\/\/pythonprogramming.altervista.org\/wp-content\/uploads\/2021\/03\/image-2-768x605.png 768w, https:\/\/pythonprogramming.altervista.org\/wp-content\/uploads\/2021\/03\/image-2-280x220.png 280w\" sizes=\"auto, (max-width: 802px) 100vw, 802px\" \/><\/a><\/figure><\/li><li class=\"blocks-gallery-item\"><figure><a href=\"https:\/\/pythonprogramming.altervista.org\/wp-content\/uploads\/2021\/03\/image.png\"><img loading=\"lazy\" decoding=\"async\" width=\"302\" height=\"332\" src=\"https:\/\/pythonprogramming.altervista.org\/wp-content\/uploads\/2021\/03\/image.png\" alt=\"\" data-id=\"8762\" data-full-url=\"https:\/\/pythonprogramming.altervista.org\/wp-content\/uploads\/2021\/03\/image.png\" data-link=\"https:\/\/pythonprogramming.altervista.org\/making-snow-and-rain-effects-with-pygame-and-particle\/image-94\/\" class=\"wp-image-8762\"\/><\/a><\/figure><\/li><li class=\"blocks-gallery-item\"><figure><a href=\"https:\/\/pythonprogramming.altervista.org\/wp-content\/uploads\/2021\/02\/image-34.png\"><img loading=\"lazy\" decoding=\"async\" width=\"797\" height=\"550\" src=\"https:\/\/pythonprogramming.altervista.org\/wp-content\/uploads\/2021\/02\/image-34.png\" alt=\"\" data-id=\"8590\" data-full-url=\"https:\/\/pythonprogramming.altervista.org\/wp-content\/uploads\/2021\/02\/image-34.png\" data-link=\"https:\/\/pythonprogramming.altervista.org\/particles-snow-with-pygame\/image-34-2\/\" class=\"wp-image-8590\" srcset=\"https:\/\/pythonprogramming.altervista.org\/wp-content\/uploads\/2021\/02\/image-34.png 797w, https:\/\/pythonprogramming.altervista.org\/wp-content\/uploads\/2021\/02\/image-34-320x221.png 320w, https:\/\/pythonprogramming.altervista.org\/wp-content\/uploads\/2021\/02\/image-34-768x530.png 768w\" sizes=\"auto, (max-width: 797px) 100vw, 797px\" \/><\/a><\/figure><\/li><li class=\"blocks-gallery-item\"><figure><a href=\"https:\/\/pythonprogramming.altervista.org\/wp-content\/uploads\/2021\/03\/image-1.png\"><img loading=\"lazy\" decoding=\"async\" width=\"302\" height=\"332\" src=\"https:\/\/pythonprogramming.altervista.org\/wp-content\/uploads\/2021\/03\/image-1.png\" alt=\"\" data-id=\"8764\" data-full-url=\"https:\/\/pythonprogramming.altervista.org\/wp-content\/uploads\/2021\/03\/image-1.png\" data-link=\"https:\/\/pythonprogramming.altervista.org\/making-snow-and-rain-effects-with-pygame-and-particle\/image-1-4\/\" class=\"wp-image-8764\"\/><\/a><\/figure><\/li><li class=\"blocks-gallery-item\"><figure><a href=\"https:\/\/pythonprogramming.altervista.org\/wp-content\/uploads\/2021\/03\/particles_cover.png\"><img loading=\"lazy\" decoding=\"async\" width=\"960\" height=\"674\" src=\"https:\/\/pythonprogramming.altervista.org\/wp-content\/uploads\/2021\/03\/particles_cover-960x674.png\" alt=\"\" data-id=\"8882\" data-full-url=\"https:\/\/pythonprogramming.altervista.org\/wp-content\/uploads\/2021\/03\/particles_cover.png\" data-link=\"https:\/\/pythonprogramming.altervista.org\/particles-effects-in-videogames-with-pygame-and-python\/particles_cover\/\" class=\"wp-image-8882\" srcset=\"https:\/\/pythonprogramming.altervista.org\/wp-content\/uploads\/2021\/03\/particles_cover-960x674.png 960w, https:\/\/pythonprogramming.altervista.org\/wp-content\/uploads\/2021\/03\/particles_cover-320x225.png 320w, https:\/\/pythonprogramming.altervista.org\/wp-content\/uploads\/2021\/03\/particles_cover-768x539.png 768w, https:\/\/pythonprogramming.altervista.org\/wp-content\/uploads\/2021\/03\/particles_cover.png 1424w\" sizes=\"auto, (max-width: 960px) 100vw, 960px\" \/><\/a><\/figure><\/li><\/ul><\/figure>\n\n\n\n<ul class=\"wp-block-list\"><li>post about font and splash screen in pygame<ul><li><a href=\"https:\/\/pythonprogramming.altervista.org\/pygame-4-fonts\/\">first<\/a> (how to center text)<\/li><li><a href=\"https:\/\/pythonprogramming.altervista.org\/how-to-render-text-on-pygame-easily\/\">second<\/a> (how to render text in pygame)<\/li><li><a href=\"https:\/\/pythonprogramming.altervista.org\/make-a-presentation-app-qith-pygame-pygame-shows-1-0\/\">third<\/a> (make a presentation)<\/li><\/ul><\/li><li>post about particles in pygame<ul><li><a href=\"https:\/\/pythonprogramming.altervista.org\/particles-effects-in-videogames-with-pygame-and-python\/\">first<\/a><\/li><li><a href=\"https:\/\/pythonprogramming.altervista.org\/making-snow-and-rain-effects-with-pygame-and-particle\/\">second<\/a> (snow and rain)<\/li><\/ul><\/li><\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">Github source code<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For particles: <a href=\"https:\/\/github.com\/formazione\/pygame_particles\">https:\/\/github.com\/formazione\/pygame_particles<\/a><\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/camo.githubusercontent.com\/2d558830d34e190fcfd15c29e9f21d8b1bd72e248cb5cc0a38eccef80a2b65c2\/68747470733a2f2f69322e77702e636f6d2f707974686f6e70726f6772616d6d696e672e616c74657276697374612e6f72672f77702d636f6e74656e742f75706c6f6164732f323032302f30382f61726b61707967616d655f32302e706e673f726573697a653d3637362532433438332673736c3d31\" alt=\"\"\/><figcaption>Arkapygame &#8211; A tutorial about making a game like arkanoid<\/figcaption><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">For game Arkanoid like for the splash page: <a href=\"https:\/\/github.com\/formazione\/arkapygame\">https:\/\/github.com\/formazione\/arkapygame<\/a><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">You can <a href=\"https:\/\/formazione.itch.io\/arkapygame\">download it also on itch.io<\/a>. There are different versions of the game.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><!-- se vuoi mettere un testo scorrevole\r\n[hoops name=\"typeWriterGen\"]\r\n\r\npoi metti un id diverso per ogni testo nella stessa pagina\r\n\r\n<div id=\"div01\">\r\n<script>\r\n\r\ntypeWriterGen(\"div01\",\"Esempio di testo scorrevole\");\r\n<\/script>\r\n\r\n-->\r\n<style>\r\n.avatar {\r\n  vertical-align: middle;\r\n  width: 100px;\r\n  height: 100px;\r\n  border-radius: 50%;\r\n}\r\n<\/style>\r\n\r\n<hr>\r\n\r\n<!-- NEWSLETTER LINK -->\r\n<a href=\"https:\/\/docs.google.com\/forms\/d\/e\/1FAIpQLSf7TniIPCWHDzCSGh2dYZaCwDvi9yLKS5ovFdKuK1sdfOvwEg\/viewform\">\r\n<img decoding=\"async\" src=\"https:\/\/pythonprogramming.altervista.org\/wp-content\/uploads\/2023\/08\/image-13.png\" class=\"avatar\">\r\nSubscribe to the <b>newsletter<\/b> for updates<\/a><br>\r\n\r\n<!-- TKINTER TEMPLATE LINK -->\r\n<a href=\"https:\/\/pythonprogramming.altervista.org\/tkinter-templates\/\">\r\n<img decoding=\"async\" src=\"https:\/\/i0.wp.com\/pythonprogramming.altervista.org\/wp-content\/uploads\/2023\/07\/image-26.png\" class=\"avatar\">\r\nTkinter templates<\/a><br>\r\n\r\n<!-- MY AVATAR PUT A LINK TO YOUTUBE CHANNEL-->\r\n<iframe loading=\"lazy\" frameborder=\"0\" src=\"https:\/\/itch.io\/embed\/711828\" width=\"552\" height=\"167\"><a href=\"https:\/\/pythonprogrammi.itch.io\/pysnake\">PySnake by PythonProgrammi<\/a><\/iframe>\r\n<br>\r\n<style>\r\n.avatar {\r\n  vertical-align: middle;\r\n  width: 100px;\r\n  height: 100px;\r\n  border-radius: 50%;\r\n}\r\n<\/style>\r\n\r\n\r\n<a href=\"https:\/\/www.youtube.com\/channel\/UCzbxq5e9gLiY-je2-br1rvg\">\r\n\t<img decoding=\"async\" src=\"https:\/\/pythonprogramming.altervista.org\/wp-content\/uploads\/2020\/10\/avatar64x64.png\" alt=\"Avatar\" class=\"avatar\">\r\n\t My youtube channel<\/a><br>\r\n\r\n<br>\r\n\r\nTwitter: <a href=\"https:\/\/twitter.com\/pythonprogrammi\">@pythonprogrammi - python_pygame<\/a>\r\n<h3>Claude's Games<\/h3>\r\n<p><a href=\"https:\/\/pythonprogramming.altervista.org\/random-daily-game-1-arkanoid\/\">Arkanoid<\/a><br>\r\n<a href=\"https:\/\/pythonprogramming.altervista.org\/platform-2d-with-pygame-made-with-claude\/\">Platform 2d<\/a><\/p> <!-- videogames made with claude -->\r\n<a href=\"https:\/\/pythonprogramming.altervista.org\/artifacts-games-day-1-memory-game\/\">1. Memory game<\/a>\r\n<h4>Videos<\/h4>\r\n<a href=\"https:\/\/youtu.be\/ciLjWWw5pLY\">Speech recognition game<\/a>\r\n<h3>Pygame's Platform Game<\/h3>\r\n\r\n<a href=\"https:\/\/pythonprogramming.altervista.org\/pygame-platform-game-5-sounds-and-mixer\/\"><img decoding=\"async\" src=\"https:\/\/i1.wp.com\/pythonprogramming.altervista.org\/wp-content\/uploads\/2020\/01\/climbercover.png?w=557&ssl=1\"\/ width=\"50%\"><\/a>\r\n<script>\r\nvar title = \"Platform Pygame\";\r\n\t\tvar links = [\r\n[\"https:\/\/pythonprogramming.altervista.org\/pygame-animation-of-a-sprite-v-1-3\/\",\"Animation 1.3\"],\r\n[\"https:\/\/pythonprogramming.altervista.org\/pygame-sprite-animation-v-2-better-coding-test-it-checking-fps-on-the-screen\/\",\"Animation 1.2\"],\r\n[\"https:\/\/pythonprogramming.altervista.org\/pygame-how-to-display-the-frame-rate-fps-on-the-screen\/\",\"Display Frame rate\"],\r\n[\"https:\/\/pythonprogramming.altervista.org\/pygame-sprite-animation-update\/\",\"Animation 1.1\"],\r\n[\"https:\/\/pythonprogramming.altervista.org\/pygame-platformer-1\/\",\"Pygame Platform Game 1\"],\r\n[\"https:\/\/pythonprogramming.altervista.org\/python-platform-game-2\/\",\"Pygame Platform 2\"],\r\n[\"https:\/\/pythonprogramming.altervista.org\/pygame-platform-game-3-recap-cheatsheet\/\",\"Pygame PLatform 3 - recap and some Cheat Sheet\"],\r\n[\"https:\/\/pythonprogramming.altervista.org\/pygame-platform-game-4-background-and-stuffs\/\",\"Pygame Platform 4 - Background & organizing code\"],\r\n[\"https:\/\/pythonprogramming.altervista.org\/pygame-platform-game-5-sounds-and-mixer\/\",\"Pygame Platform 5 - Sounds\"],\r\n[\"https:\/\/pythonprogramming.altervista.org\/platform-game-in-detail-part-1\/\",\"Game in detail part 1\"],\r\n[\"https:\/\/pythonprogramming.altervista.org\/map-maker-1-2\/\", \"Map maker 1.2\"]\r\n\t\t];\r\n\t\t<\/script>\r\n<script>\r\n\t\r\nif (typeof next2 != \"undefined\"){let next2 = 0;}\r\n\t\r\nnext2 = 0;\r\n\thtml = \"\";\/\/<b style='color:coral;font-size:1.2em'>Other posts about \" + title + \"<\/b><br>\";\r\nfor (address of links) \r\n{\r\n\r\n\tif (next2 == 1){\r\n\t\thtml += \"<div style='background:coral'>\";\r\n\t\thtml += \"Next link => <a href='\" + address[0] + \"'>\" + address[1] + \"<\/a>\";\r\n\t\thtml += \"<\/div><br>\";\r\n\t\tnext2 = 0;\r\n\t}\r\n\tif (address[0] == document.URL) {\r\n\t\tnext2 = 1;\r\n\t}\r\n}\r\n\r\nif (typeof next != \"undefined\") {let next = 0;}\r\nif (typeof addressStart != \"undefined\") {let addressStart = \"\";}\r\nnext = 0;\r\naddressStart = \"<a href='\";\r\nfor (address of links) {\r\n\tif (next == 1){\r\n\t\thtml += \">>>\" + addressStart + address[0] + \"'>\" + address[1] + \"<\/a><br>\";\r\n\t\tnext = 0;\r\n\t}\r\n\telse if (addressStart + address[0] != document.URL)\r\n\t{\r\n\t\thtml += addressStart + address[0] + \"'>\" + address[1] + \"<\/a><br>\";\r\n\t}\r\n\telse\r\n\t{\r\n\t\tnext = 1;\r\n\t\tnext_address = address[0]\r\n\t\tnext_title = address[1]\r\n\t\thtml += \"<span style='color:gray'>\" + address[1] + \"<\/span><br>\";\r\n\t}\r\n\r\n}\r\n\r\n\thtml += `<span style=\"font-size:8px\">Powered by <a href=\"https:\/\/pythonprogramming.altervista.org\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-2673\" src=\"https:\/\/pythonprogramming.altervista.org\/wp-content\/uploads\/2019\/06\/altervista2.png\" alt=\"\" width=\"70\" height=\"25\" srcset=\"https:\/\/pythonprogramming.altervista.org\/wp-content\/uploads\/2019\/06\/altervista2.png 156w, https:\/\/pythonprogramming.altervista.org\/wp-content\/uploads\/2019\/06\/altervista2-150x56.png 150w\" sizes=\"auto, (max-width: 70px) 100vw, 70px\" \/>pythonprogramming.altervista.org<\/a><\/span>`\r\n\thtml = \"<div style='background:yellow'>\" + html + \"<\/div>\";\r\n\tdocument.write(html)\r\n<\/script>\r\n\r\n<h3>Other Pygame's posts<\/h3>\r\n\r\n<script>\r\nvar title = \"Pygame's Posts\"\r\nvar links = [\r\n[\"https:\/\/pythonprogramming.altervista.org\/pygame-platformer-1\/\",\"Platform game 1\"],\r\n[\"https:\/\/pythonprogramming.altervista.org\/make-a-platform-game-with-pygame-dafluffypotato\/\",\"DaFluffyPotato Platform Tutorials\"],\r\n[\"https:\/\/pythonprogramming.altervista.org\/python-and-classic-arcade-games-pong\/\",\"Pong Game Full\"],\r\n[\"https:\/\/pythonprogramming.altervista.org\/python-draws-in-colors-app-to-draw-with-pygame\/\",\"PyGameGIF 2\"],\r\n[\"https:\/\/pythonprogramming.altervista.org\/pygame-draw-app-with-animation\/\",\"PyGameGIF 1\"],\r\n[\"https:\/\/pythonprogramming.altervista.org\/pydraw-2-0-app-to-draw-gif\/\",\"PyDraw 2.0\"],\r\n[\"https:\/\/pythonprogramming.altervista.org\/pygame-drawing-2\/\",\"Draw with Pygame\"],\r\n[\"https:\/\/pythonprogramming.altervista.org\/animation-with-pygame\",\"Sprite animation 1\"],\r\n[\"https:\/\/pythonprogramming.altervista.org\/animation-on-pygame-2-free-characters-and-more-actions\/\",\"Sprite animation 2\"],\r\n[\"https:\/\/pythonprogramming.altervista.org\/starting-with-pygame\/\",\"Starting movements with Pygame\"],\r\n[\"https:\/\/pythonprogramming.altervista.org\/pygame-3-move-sprite\/\", \"Move a Sprite\"],\r\n[\"https:\/\/pythonprogramming.altervista.org\/pygame-4-fonts\/\",\"Text and Fonts\"],\r\n[\"https:\/\/pythonprogramming.altervista.org\/pygame-animate-a-sprite\/\", \"Animate a sprite\"],\r\n[\"https:\/\/pythonprogramming.altervista.org\/pygame-and-mouse-events\/\",\"Mouse events\"],\r\n[\"https:\/\/pythonprogramming.altervista.org\/pgp-aka-pygamepresentation-project\/\",\"Pygame presentation\"],\r\n\t[\"https:\/\/pythonprogramming.altervista.org\/moving-the-player-in-pygame-with-key-get_pressed\/\",\"How to use key.get_pressed()\"]\r\n]\r\n<\/script>\r\n\r\n\r\n<script>\r\n\t\r\nif (typeof next2 != \"undefined\"){let next2 = 0;}\r\n\t\r\nnext2 = 0;\r\n\thtml = \"\";\/\/<b style='color:coral;font-size:1.2em'>Other posts about \" + title + \"<\/b><br>\";\r\nfor (address of links) \r\n{\r\n\r\n\tif (next2 == 1){\r\n\t\thtml += \"<div style='background:coral'>\";\r\n\t\thtml += \"Next link => <a href='\" + address[0] + \"'>\" + address[1] + \"<\/a>\";\r\n\t\thtml += \"<\/div><br>\";\r\n\t\tnext2 = 0;\r\n\t}\r\n\tif (address[0] == document.URL) {\r\n\t\tnext2 = 1;\r\n\t}\r\n}\r\n\r\nif (typeof next != \"undefined\") {let next = 0;}\r\nif (typeof addressStart != \"undefined\") {let addressStart = \"\";}\r\nnext = 0;\r\naddressStart = \"<a href='\";\r\nfor (address of links) {\r\n\tif (next == 1){\r\n\t\thtml += \">>>\" + addressStart + address[0] + \"'>\" + address[1] + \"<\/a><br>\";\r\n\t\tnext = 0;\r\n\t}\r\n\telse if (addressStart + address[0] != document.URL)\r\n\t{\r\n\t\thtml += addressStart + address[0] + \"'>\" + address[1] + \"<\/a><br>\";\r\n\t}\r\n\telse\r\n\t{\r\n\t\tnext = 1;\r\n\t\tnext_address = address[0]\r\n\t\tnext_title = address[1]\r\n\t\thtml += \"<span style='color:gray'>\" + address[1] + \"<\/span><br>\";\r\n\t}\r\n\r\n}\r\n\r\n\thtml += `<span style=\"font-size:8px\">Powered by <a href=\"https:\/\/pythonprogramming.altervista.org\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-2673\" src=\"https:\/\/pythonprogramming.altervista.org\/wp-content\/uploads\/2019\/06\/altervista2.png\" alt=\"\" width=\"70\" height=\"25\" srcset=\"https:\/\/pythonprogramming.altervista.org\/wp-content\/uploads\/2019\/06\/altervista2.png 156w, https:\/\/pythonprogramming.altervista.org\/wp-content\/uploads\/2019\/06\/altervista2-150x56.png 150w\" sizes=\"auto, (max-width: 70px) 100vw, 70px\" \/>pythonprogramming.altervista.org<\/a><\/span>`\r\n\thtml = \"<div style='background:yellow'>\" + html + \"<\/div>\";\r\n\tdocument.write(html)\r\n<\/script><\/p>\n\n\n\n<figure class=\"wp-block-embed is-type-video is-provider-youtube wp-block-embed-youtube wp-embed-aspect-4-3 wp-has-aspect-ratio\"><div class=\"wp-block-embed__wrapper\">\n<iframe loading=\"lazy\" title=\"Hide and Show frames in tkinter\" width=\"747\" height=\"560\" src=\"https:\/\/www.youtube.com\/embed\/hKJLrs6vFbM?feature=oembed&amp;enablejsapi=1\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen><\/iframe>\n\n<\/div><figcaption>hide and show frames<\/figcaption><\/figure>\n\n\n\n<figure class=\"wp-block-embed is-type-video is-provider-youtube wp-block-embed-youtube wp-embed-aspect-4-3 wp-has-aspect-ratio\"><div class=\"wp-block-embed__wrapper\">\n<iframe loading=\"lazy\" title=\"TypeSpeak 1.2 with Tkinter, Pygame and Gtts\" width=\"747\" height=\"560\" src=\"https:\/\/www.youtube.com\/embed\/zbnD_FV7584?feature=oembed&amp;enablejsapi=1\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen><\/iframe>\n\n<\/div><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n","protected":false},"excerpt":{"rendered":"pygame font\n<a class=\"moretag\" href=\"https:\/\/pythonprogramming.altervista.org\/splash-text-page-with-pygame\/\"> [...]<\/a>","protected":false},"author":1,"featured_media":9073,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_crdt_document":"","footnotes":""},"categories":[1],"tags":[],"class_list":["post-9071","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-examples"],"avopt_banners_inside_post":true,"avopt_banners_on_page":true,"av_copy_from":"","av_sharing_message":"","av_sharing_allowed":true,"av_sharing_on":{"fb":[],"tw":[]},"av_allow_affiliate_banner":false,"av_allow_affiliate_multi_banner":false,"av_show_affiliation_buy_button":false,"av_post_rating":true,"av_have_post_rating_value":false,"av_is_artificial_intelligence_content":false,"_links":{"self":[{"href":"https:\/\/pythonprogramming.altervista.org\/wp-json\/wp\/v2\/posts\/9071","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/pythonprogramming.altervista.org\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/pythonprogramming.altervista.org\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/pythonprogramming.altervista.org\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/pythonprogramming.altervista.org\/wp-json\/wp\/v2\/comments?post=9071"}],"version-history":[{"count":8,"href":"https:\/\/pythonprogramming.altervista.org\/wp-json\/wp\/v2\/posts\/9071\/revisions"}],"predecessor-version":[{"id":9088,"href":"https:\/\/pythonprogramming.altervista.org\/wp-json\/wp\/v2\/posts\/9071\/revisions\/9088"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/pythonprogramming.altervista.org\/wp-json\/wp\/v2\/media\/9073"}],"wp:attachment":[{"href":"https:\/\/pythonprogramming.altervista.org\/wp-json\/wp\/v2\/media?parent=9071"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/pythonprogramming.altervista.org\/wp-json\/wp\/v2\/categories?post=9071"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/pythonprogramming.altervista.org\/wp-json\/wp\/v2\/tags?post=9071"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}