

# Event processing here, stuff the users does. White_flash_time = 1000 # Milliseconds between the screen being filled whiteīlack_flash_time = 500 # Milliseconds between the screen being filled black # "Game Title", make sure to set the caption :) # unless you want to try telling everyone your game is called # Sets title of window, not needed for the game to run but Screen = _mode((window_width, window_height)) # Creates the window and puts a Surface into "screen". # Set the size of the window, variables can be used for positioning # Needed to use any and all python resources. Be content with understanding none of it, be pleased if you see anything you recognize, but get excited because we’re going to learn all of it. You should see a window similar to the picture above, but it should be switching between black and white. Go ahead, look at it, run it if you’d like. Take a look at this file, it is about the most default Pygame file that will do something. Now with logistics out of the way, lets get to the fun stuff. Regardless of experience, Pygame is an excellent addition to your tool belt. I originally learned to make games by using Pygame, but despite moving onto newer frameworks with more appropriate languages, I still use Pygame often, especially for small programs like prototypes that I want to quickly complete. It prepares you thoroughly to begin using much bigger and better libraries that are used commercially like libGDX with Java, and even the LÖVE framework in Lua. The flow of the Pygame workflow is an amazing way for beginners to learn game programming at a deeper level because it is straightforward while also having a fair amount of depth. It isn’t set up to be easily compatible with mobile devices, and due to the nature of Python it isn’t great for commercial products in general however, its strengths include its ease of use and accessibility. The course covers the basic setup of a Pygame file, drawing images and getting input, all the way to the use of built-in Sprites and Rects for game functionality. Familiarity in Python will be required, but not game development.
