|
| 1 | +--- |
| 2 | +layout: default |
| 3 | +title: What is Pygame |
| 4 | +next_page: [/guide/intro/chapter-2, Opening A Window] |
| 5 | +--- |
| 6 | + |
| 7 | +<body> |
| 8 | + <p>In this article, we'll go over what pygame is and how to install it.</p> |
| 9 | + |
| 10 | + <h2>Table of contents</h2> |
| 11 | + <p></p> |
| 12 | + <ol id="toc"> |
| 13 | + <!-- |
| 14 | + To be filled by javascript |
| 15 | + --> |
| 16 | + </ol> |
| 17 | + |
| 18 | + <h2><a id="introduction" class="js">Introduction</a></h2> |
| 19 | + <p> |
| 20 | + It's time to get started on your pygame journey, but what is pygame? Well |
| 21 | + pygame is "a free and open-source cross-platform library for the development |
| 22 | + of multimedia applications like video games using Python"(<a href="https://github.com/pygame-community/pygame-ce?tab=readme-ov-file">pygame-ce github repository</a>). As the |
| 23 | + description suggests, it's mostly used to make video games - which is why in |
| 24 | + this book we'll be learning techniques relevant to making games |
| 25 | + </p> |
| 26 | + |
| 27 | + <p> |
| 28 | + Pygame aims to be a user-friendly library to draw and manipulate pixels onto |
| 29 | + the screen, much like <a href="https://www.libsdl.org/">SDL2</a>, but with |
| 30 | + extended features in various forms that makes it easier to use. Given this |
| 31 | + nature, you generally have a lot of control on how you want your code to |
| 32 | + run, so it may have a bit of a learning curve. But fear not! After reading |
| 33 | + this book you should be able to use pygame just fine, as long as you get |
| 34 | + your practice in 🔫 |
| 35 | + </p> |
| 36 | + |
| 37 | + <p> |
| 38 | + In this book we'll aim to cover how to do basic things with pygame, with |
| 39 | + little exercises in between to make sure you're not falling off |
| 40 | + |
| 41 | + Good Luck! |
| 42 | + </p> |
| 43 | + |
| 44 | + <h2><a id="pygame-ce" class="js">Pygame-CE</a></h2> |
| 45 | + <p> |
| 46 | + So pygame currently has two major distributors, the original one and a fork |
| 47 | + of the project. What is a fork? Well it means it's a copy of the project, and |
| 48 | + in this case they branched off to be two completely separate packages now. |
| 49 | + </p> |
| 50 | + <p> |
| 51 | + <a href="https://github.com/pygame-community/pygame-ce">pygame-ce</a> is a |
| 52 | + fork of the original pygame, which got created due to all the active |
| 53 | + developers of the original project being banned by the "owner". The fork is not owned |
| 54 | + by any one person and follows a more democratic model to its management |
| 55 | + </p> |
| 56 | + <p> |
| 57 | + So what happened to all the active developers of the original pygame? They |
| 58 | + formed pygame-ce! That's right, so pygame-ce is being developed by the same |
| 59 | + people (and more) as the original pygame, and with a more democratic model |
| 60 | + have been able to push releases way more easily and introduce many more |
| 61 | + features. |
| 62 | + </p> |
| 63 | + <p> |
| 64 | + For all sane purposes, we will be using <code>pygame-ce</code> in this book |
| 65 | + and we advise the same. It has had more performance improvements, code |
| 66 | + features, and active development than the original pygame for a while now. |
| 67 | + </p> |
| 68 | + |
| 69 | + <h2><a id="installation" class="js">Installation</a></h2> |
| 70 | + <p> |
| 71 | + Now that you know what pygame-ce is, let's install it. |
| 72 | + |
| 73 | +<pre> |
| 74 | + pip uninstall pygame |
| 75 | + pip install pygame-ce |
| 76 | +</pre> |
| 77 | + In order for pygame-ce to work, pygame needs to be uninstalled first. |
| 78 | + This is because both upstream pygame and pygame-ce share the import name, |
| 79 | + and so upstream pygame must be removed <u>first</u>. |
| 80 | + </p> |
| 81 | + <p> |
| 82 | + I simply included it as the first step in order to install pygame-ce in a foolproof manner with no issues, |
| 83 | + but I must remind you that a pre-requisite of using this site is knowing how to manage your |
| 84 | + environment, so please do learn that if you havent already |
| 85 | + </p> |
| 86 | + |
| 87 | +</body> |
0 commit comments