Pygame Example

So I have started to write some very simple examples focused on audiogames programming. This tutorial focuses on pygame animation. If the game stops responding for any reason, you may need to terminate it by pressing Ctrl-C in your Terminal window. pygsear -- Pygame Framework and Examples pygsear home at savannah. A Quick Pygame Tutorial. We use Pygame's capabilities to quickly draw polygons to the screen and listen for keyboard and mouse events. exit(), so it is helpful. Installing the Windows 64-bit Version of Pygame. It is also highly recommended to do the exercises in the end. By using the Pygame library, we will put together your first Python game, through which you'll learn the fundamentals of development in Python. freetype 47 11 pygame. Published on August 27, 2017 A while ago, I made a post on how to organize a coding dojo that was published right after the Python DF community anniversary dojo where I prepared a challenge to create the game of life from John Horton Conway. Pygame modules load, scale, and display existing graphics in traditional bitmap formats. You must do the following to get started with Pygame: import pygame import sys pygame. GitHub Gist: instantly share code, notes, and snippets. You will develop expertise in both programming and the theoretical and mathematical basis of computer science. And programming games are real fun, that is why I am here with this PyGame Tutorial for Beginners. So I have started to write some very simple examples focused on audiogames programming. How it works: The system switches between states by keeping a list called "game_state". This tutorial will tell you how to make a top-down car in Python and pygame and make it move with very few lines of code. Create necessities. c files so that the user does not need to use Cython when installing pygame from source. py2app and py2exe support were improved. Two versions of Wing are appropriate for use with this document: Wing Pro is the full-featured Python IDE for professional developers, and Wing Personal is a free alternative with reduced feature set. get_button(id). It shows how to animate with pygame and create sprites. For example, some use the pymunk. After an introduction of the basics without classes, each example is a subclass of the Game class. So let's see how we get input from the screen. I want to shoot where my ship is looking, with pygame. PyGLEW PyGLEW are Python bindings for the GLEW (OpenGL Extension Wrangler library). Give me examples please. Pygame Zero is for creating games without boilerplate. widgets module. It contains python functions and classes that will allow you to use SDL’s support for playing cdroms, audio and video output, and keyboard, mouse and joystick input. Don't be afraid to ask questions! Game creation in any programming language is very rewarding, and also makes for a great teaching tool. Also, most Linux distributions include a reasonable modern SDL. pygsear is a set of python libraries which work with pygame. Bouncing Ball Example with PyGame Here is simple code to get you started with bouncing a ball against the boundaries of the window. Image Cropping using PyGame. As of February, 2017, you can just run pip install pygame and it will install the right version of pygame for your environment. Last updated November 2014. 1 and Pygame 1. With the PiTFT installed and the 4 tactile buttons there aren't many GPIs left on the model B Raspberry Pi. So its easy to switch between both. Just a note, the use of globals is a bad habit. Pi Video Output Using pygame Created by Kevin Townsend for example), most of the pygame drawing operations take place on a screen, which is rendered on a specific. 08, 2008 in pygame , screencasts I think that it could be easier to learn game programming through a video tutorial – you’re actually able to see the code unfold before your eyes, with audio explanations – rather than through reading – although I think that reading is great and. from pygame import mixer file = 'some. This may be due to the fact Pygame is a package but I'm not sure. Pygame, which can find here. Hello! I'm new to programming and have been playing with Python for a few months now. I know I can't use print like in regular python IDLE but i dont know how import pygame, sys from pygame. The return value is a Surface object which is the object you will perform graphical. Using Pygame to capture key presses for CLI prgram?. I recommend the widely popular Pygame. As you had seen by yourself it does not. How to install PyGame for Python 3 PyGame is a set of python modules designed for writing games. This tutorial focuses on pygame animation. Initially created for the Python User Group Freiburg meeting on December 11, 2013. Your folder structure should look like this:. """ Some examples for generating and converting sounds for pygame. Ping Pong game in pygame. I recommend the widely popular Pygame. Beginning Game Development with Python and Pygame: From Novice to Professional Dear Reader, Creating computer games is a fascinating combination of an art and a science, and can make a rewarding career or hobby. Introduction to Pygame¶. What is a Mask? A mask is a representation of an image that tracks which pixel is transparent and which is not. init() Above, we've imported PyGame, which is obviously necessary to make use of the module! Then, we run pygame. replacing your pygame. PyGame is highly portable and runs on nearly every platform and operating system. Learn how to code the classic game Tetris using Python and Pygame. ―Making Games with Python & Pygame‖) is licensed under a Creative you can still try to follow along with the source code examples and figure out how programming. Pygame tends to put both into the same game loop. Don't worry! We will learn a lot more about how to make an object move, how to add animation effects, buttons, music and much more in the next few articles but for now let's understand this basic code which contains all the necessary pygame elements. The collection includes: An A* pathfinding algorithm with a visual display of the algo. py code is a great example of something that could use Cython to speed up collision detection and dirty rect handling). exit(), so it is helpful. """ A classic Single Player Snake Game By DK3250, March 2017 This game is made as a tutorial for DreamInCode's Python Forum It demonstrates a vararity of Pygame functions as well as basic Python programming. These examples should help get you started with pyGame. Pygame download page; SDL download page. In the following video, I use object-oriented programming to create a player object, which appears as a simplistic blue space ship on the screen, and I write event handles to allow the player to move the ship with the arrow keys. If Python 2. Program Arcade Games With Python And Pygame < Previous. This tutorial focuses on pygame animation. c files so that the user does not need to use Cython when installing pygame from source. This tutorial is the first tutorial in a series of five Pygame tutorials: Tutorial 1 - Getting Started with Pygame Tutorial 2 - Creating Sprites using Pygame Tutorial 3 - How to control your sprites Tutorial 4 - Adding More Sprites Tutorial 5 - Pygame - How-To's Learning Objectives These instructions will guide you through the first few steps. Pygame_SDL2 Documentation¶. Pygame is a fabulous addition to the programming language Python used to write professional looking computer games. The reason I'm still using Pygame for my lessons is that my son is still getting used to object oriented programming. Assuming that we have an audio file called myFile. if the example has no procedures then right click on the turtle and see if there is any code programmed directly into the turtle. Some advanced language features such as objects have been deliberately left out, in an effort to make things easier to understand for beginners. So that your finished product will look like is the following picture : Here’s the full Python code:. Pygame is not shipped together with Python, it is a 3rd-party-package. Initially I shall only use raw tkinter and pygame without any added modules and then I shall demonstrate some of the features of the tkfront module and it's children to simplify the setup. Creating a Game in Python Using PyGame - Part One Prerequisites In order to follow along with this tutorial you will need Python 2. All you need to know is that this call is required in order for any updates that you make to the game screen to become visible. Pygame Examples. PyGame is a Python wrapper for the SDL library. Simple Sprites, Music, Sound Example in Pygame. And programming games are real fun, that is why I am here with this PyGame Tutorial for Beginners. Do you know you can write cutting-edge games that run on Windows, Linux, and Mac OS X with open source technologies. The following resources describe how to port programs from SimpleGUI to Pygame. org for games and other programs. Now I'll be wrapping the text. org) and Pygame (pygame. It is intended for use in education, so that teachers can teach basic programming without needing to explain the Pygame. This is a high-level introductory tutorial path. It initializes all the modules required for PyGame. edu is a platform for academics to share research papers. So that your finished product will look like is the following picture : Here's the full Python code:. Wing is a Python IDE that can be used to develop, test, and debug Python code written for pygame, an open source framework for game development with Python. For example, open_window instead of set_mode. It is highly portable and runs on nearly every platform and operating system. Pygame is a set of Python modules designed for writing games. Hi everyone, from this post we will start learning PyGame. Next > Example code and programs. You will need to make a picture of the pong for it to run properly. It also provides the programmer access to key and mouse events. locals import * BLACK = ( 0, 0, 0) WHITE =. Hi everyone, from this post we will start learning PyGame. In this PyGame tutorial, we cover how to display custom-created game images to the screen. Anaconda Cloud. This is a tutorial about gfxdraw how to use. Kivy has a lot of potential and I want to go back to it. Making Games with Python & Pygame is a programming book that covers the Pygame game library for the Python programming language. get_hat(id), joystick. Pygame Lesson 1-2: Working with Sprites by Chris Bradfield Mon, Aug 15, 2016 Tags: python tutorial gamedev pygame. You could adapt this to work without Pygame if you want. flip() - PyGame is double-buffered. Pygame is a Free and Open Source python programming language framework for making game applications. Main Concepts (Cont. Colours can also have code associated with them. load(file) mixer. Line 43 is another type of event, pygame. Pygame adds functionality on top of the excellent SDL library. PyGame is a Python wrapper for the SDL library. Pygame operates on the Python programming language and therefore is a solid framework to learn! Furthermore, the Jetbrains Python Developers Survey 2018 showed that Python 3 was adopted by 84% of developers over just 16% still using Python 2. Prerequisites To be able to use this tutorial, make sure you have Python 3 and a programming environment already installed on your local computer or server. It uses the SDL library to allow you to create games and multimedia programs in Python. Gallery About Documentation Support About Anaconda, Inc. Next > Example code and programs. Clock() Creates a Clock object (assign this to a name), which you can then call the tick() method on to find out how much time has passed since the last time you called tick() pygame. In this article, I'll follow up with the Pygame event, input, and sound modules, which you can use to create games, puzzles, or other interactive programs. This is a simple game of pong with made using pygame. So check out collision detection please. circle() function that takes the color, center, radius and the options width parameter that defaults to zero. According to this post , this script launch a PyGame windows with the image you've passed in input_loc and let's you crop this. Part III: 20. Post navigation ← PyGame Tutorial Part 1 – Base Classes Cocoa Tutorial: Creating a Status Bar Application in Xcode 4. Just make inactive the statements intro. init() Strictly speaking, import sys is not needed for PyGame, but as we'll see later, to be able to use the "close window" button on Windows or Mac, we'll need to use sys. A Python/Pygame script a dozen lines long will show an image from disk; or, with the draw module, you can create your own charts and graphs, annotate photos you've loaded, or overlay a camera image with calculated information. Anti-aliased lines, Detect collision between two rectangles. You can vote up the examples you like or vote down the ones you don't like. py which runs the game, as well as a game module which contains most of the functionality. Python; GUI Tk / Alarm 1: Animation 3: Back Fore ground 1: Beeper 1: Border 7: Button 32: Canvas 8: CheckBox. Line 43 is another type of event, pygame. If the game stops responding for any reason, you may need to terminate it by pressing Ctrl-C in your Terminal window. When using curses you can extend its capabilities and program for example games with limited graphics. Where to find more information about PyGame. Pygame is actually a wrapper for SDL (simple direct media), the cross-platform multi media library. Python; GUI Tk / Alarm 1: Animation 3: Back Fore ground 1: Beeper 1: Border 7: Button 32: Canvas 8: CheckBox. Surface ((w,h),0,24) r,g,b,a =S. The content section adds only a line to specify the collision box for the spider. This full tutorial is meant for intermediate programmers with some experience, but everyone is welcome to follow along. Hi, Here, I'm going to do a tutorial on using Python and PyGame to add joystick control to any of your new projects. What is Pygame? Pygame is a third party module designed for creating 2D games with python. 2 MB: 2016-12-12. Welcome to Pygame AI's Documentation!¶ Pygame AI is a package that aims at implementing a bunch of common algorithms and techniques often used in Videogame AI. Thumbnail generation with scaling is an example of what you can do with pygame. Player can also move the box diagonally. Why Python and Pygame are a great pair for beginning programmers We look at three reasons Pygame is a good choice for learning to program. set_mode((800,600)) screen_rect = screen. A very basic pygame sprite example. Mar 18, 2015. There is a regular competition, called PyWeek, to write games using Python (and usually but not necessarily, Pygame). delay(milliseconds) Pauses game for time specified pygame. Video Tutorial 1 – Making a Barebones Pygame Program May. 04, and i seem to have a lot of differnet versions of python installed, but none of them contains a pygame-examples folder. Just a note, the use of globals is a bad habit. Learn and use Python and PyGame to design and build cool arcade games. It was started by Pete Shinners in 2000. 0+ installed. There are lot of similarity between kineticjs and Pygame. Gallery About Documentation Support About Anaconda, Inc. This is a new series on my channel where I am going to be going through the pygame module in python. *FREE* shipping on qualifying offers. With a little extra effort you can assign them to function arguments and return statements. Welcome to the first tutorial of the series: Building games with Pygame. KEYDOWN is an event for pressing a key. Firstly, we need to create a font renderer that renders text with…. Unofficial Windows Binaries for Python Extension Packages. joystick Since my 7th grade son loves to play Call of Duty 2 on the XBox 360, I've been thinking of incorporating the gamepad input device into his lessons. Breakout example code using Python and Pygame Python is a great language that puts the 'fun' back in programming. 2; To install this package with conda run: conda install -c tlatorre pygame. So its easy to switch between both. com Page 1 1. You will have the opportunity to program in several languages and on a variety of platforms -- for example, traditional PCs, database, web, mobile apps, etc. Build a game framework with Python using the Pygame module The first part of this series explored Python by creating a simple dice game. Pygame Examples. Anti-aliased lines, Detect collision between two rectangles. init() mixer. get_ticks() Returns the number of milliseconds passed since pygame. Sound, text and changing the mouse cursor. set_caption('Tutorial 1') We can change the background colour by filling the screen object. Source, including codesamples, available at http…. The SDL library, or Simple DirectMedia Layer is a development. Pygame Zero is for creating games without boilerplate. In this article, I'll follow up with the Pygame event, input, and sound modules, which you can use to create games, puzzles, or other interactive programs. Image Cropping using PyGame. Pygame operates on the Python programming language and therefore is a solid framework to learn! Furthermore, the Jetbrains Python Developers Survey 2018 showed that Python 3 was adopted by 84% of developers over just 16% still using Python 2. Welcome! This is the default page for moria's new apache install. Also, most Linux distributions include a reasonable modern SDL. exit(), so it is helpful. These three commands give you the value from any input, and with these,. We are going to program pong using Python and Pygame. Welcome to Pygame Zero¶. I wanted to go even further and built a python script that — using pygame’s camera module and curses — captures an image from an attached webcam (USB or built-in), transforms it and displays it on the shell. Here's an example that uses the Pygame library to create a game Breakout in 159 lines of code. Two versions of Wing are appropriate for use with this document: Wing Pro is the full-featured Python IDE for professional developers, and Wing Personal is a free alternative with reduced feature set. Pygame is daunting to look at understand initially. Download Anaconda. Beginning Game Development with Python and Pygame: From Novice to Professional Dear Reader, Creating computer games is a fascinating combination of an art and a science, and can make a rewarding career or hobby. cdrom 5 3 pygame. Nothing has changed here except that rather than import pygame it uses from pygame import mixer. Your folder structure should look like this:. SDL is a cross-platform library for accessing computer multimedia hardware components (sound, video, input, etc. The setup, background, and broom setup sections do not change from example two. import pygame pygame. The add_tile function creates another instance of a tile of a given color and size and adds it to the tail’s array of tiles. # Pygame Assets PygameAssets is a lightweight asset manager for Pygame applications and games, designed to be pluggable, extensible and configurable. Beginning Game Development with Python and Pygame-- A new book discussing game development using Pygame Yet Another PyGame tutorial - OOP approach!! There is a GUI toolkit based on Pygame called OcempGUI. Introduction to PyGame By Thuan Ta Very briefly, Python is a very nice programming language for making things quickly with minimal overhead. 28 Nov 2017 Craig Oda Feed. Contents 1 pygame. The new Pygame trinket lets you make and share fully featured graphical programs in your browser Did you know? We run a special virtual machine to display the images and produce the sounds you here, then stream them to your browser. We use Pygame's capabilities to quickly draw polygons to the screen and listen for keyboard and mouse events. It shows how to animate with pygame and create sprites. The thickness of the line is 10 pixels. These tricks took me a while to work out and I'll do my best to explain how how they work. Now, when you look at this program, you can see the three main commands you use to get input: joystick. Pygame Sprite Tutorial Pdf >>>CLICK HERE<<< Pygame (Python Game Development) Tutorial - 30 - Using Logic To. Python Success Stories pygame (www. And programming games are real fun, that is why I am here with this PyGame Tutorial for Beginners. Published on August 27, 2017 A while ago, I made a post on how to organize a coding dojo that was published right after the Python DF community anniversary dojo where I prepared a challenge to create the game of life from John Horton Conway. Pygame have already created a (hidden) display, so all we need to do is to set the mode of the display (in this example we only set the resolution). Sound samples. I have tried HTML5 Canvas, kineticjs for few days and switched to Pygame for no reason!!!!. You can vote up the examples you like or vote down the ones you don't like. Program Arcade Games With Python And Pygame < Previous. It is divided in several submodules, of which each one contains various related functions such as creating rectangle surfaces, drawing strings or loading images. This tutorial expects you to have a moderate understanding of programming concepts and data structures, in particular arrays, ints, binary comparison, and loops. Recently I had an idea to create a story-based game using python and pygame library. Watch Queue Queue. So check out collision detection please. With an interest in game development, I thought I'd begin to learn some PyGame basics. draw module contains several wrapper functions around various pygame drawing functions, which are used by the ocempgui. Rect() and pygame. Pygame without anything else can be kind of overwhelming to those who are just starting out with python, so this option is for more advanced people. After asking my class to first master playing the game and predict the effects of small changes to the script, I then ask them to make more significant changes to the squirrel game. GitHub Gist: instantly share code, notes, and snippets. What is Pygame? Pygame is a third party module designed for creating 2D games with python. So I decided it’d be worth giving it a shot. Pygame Lesson 1-2: Working with Sprites by Chris Bradfield Mon, Aug 15, 2016 Tags: python tutorial gamedev pygame. Let's get started. The above python code is a simple pygame script to draw four cyan color squares. Image Cropping using PyGame. To in Making a game with Python and PyGame, part 5. By the end of this tutorial from Tech With Tim, you will have created a fully functional Tetris game. I was running Python 2. Create necessities. I may be wrong, but I believe that it is pre-installed on the Pi. The collection consists of various game development ideas written in Python using the Pygame library. This tutorial is the first tutorial in a series of five Pygame tutorials: Tutorial 1 - Getting Started with Pygame Tutorial 2 - Creating Sprites using Pygame Tutorial 3 - How to control your sprites Tutorial 4 - Adding More Sprites Tutorial 5 - Pygame - How-To's Learning Objectives These instructions will guide you through the first few steps. 6 Shows: - a simple 'square wave' generated - resampling sample rates (eg, 8363 to 44100) - using built in python array for making pygame. 6 on Vista with pyGame 1. draw 25 7 pygame. Just ensure you click on the IDLE icon and not the IDLE3 icon. Surface((100, 100)) code with the code above will result in: Do not use pygame. The free books "Program Arcade Games with Python and Pygame", "Making Games with Python & Pygame" cover the basics of the Pygame library and offers the source code for several popular video game clones. This tutorial explicitly encourages you to tinker with the code. It then goes into creating a sample game and explaining the features. For pixel perfect collision detection we will use pygame. For example, a primarily one-directional repair may have some functional in the other direction, known as a simple channel or backchannel, as in the lexer crap, or a pipeline may be anywhere bi-directional. There are lot of similarity between kineticjs and Pygame. In fact, what you see as movement is an illusion only happening in your brain. """ A classic Single Player Snake Game By DK3250, March 2017 This game is made as a tutorial for DreamInCode's Python Forum It demonstrates a vararity of Pygame functions as well as basic Python programming. It would also be advantageous if you had a grounding in basic mathematics, specifically trigonometry. import pygame - this is of course needed to access the PyGame framework. Notice: Undefined index: HTTP_REFERER in /home/forge/theedmon. set_mode((width, height)) - This will launch a window of the desired size. conda install -c cogsci pygame Description. UPDATE: Apparently, this is no longer necessary. What does this representation look like? For every pixel in the image there is bit representation in the mask. init() Strictly speaking, import sys is not needed for PyGame, but as we'll see later, to be able to use the "close window" button on Windows or Mac, we'll need to use sys. Initialize images once. Download all these examples along with supporting files in a zip file: python_examples. Exploring pygame 4 - Game of Life. Participate in the Community. As of February, 2017, you can just run pip install pygame and it will install the right version of pygame for your environment. We are going to program pong using Python and Pygame. I'm listing them according to features that I found awesome : - Awesome lighting effects and physics use : SubTerrex(paulpaterson): SubTerrex - pygame - python game development - Real-Time strategy with network support: Void Infinity(jerber99) :. This is part 2 of our tutorial series, "Game Development with Pygame". (These objects are described later. For example if you try this S = pygame. 04, and i seem to have a lot of differnet versions of python installed, but none of them contains a pygame-examples folder. Especially to those uninitiated to programming or just initiated to block based languages like Scratch. Post navigation ← PyGame Tutorial Part 1 – Base Classes Cocoa Tutorial: Creating a Status Bar Application in Xcode 4. Pygame Examples. Note: this version is a test version that allow quick and dirty test of your android applications. This tutorial expects you to have a moderate understanding of programming concepts and data structures, in particular arrays, ints, binary comparison, and loops. We will not have time to deal with installation and compatibility issues so participants must check their laptops can run pygame applications. # Pygame/PyopenGL example by Bastiaan Zapf, Apr 2009 # "Render to Texture" demonstration: Render a helix to a # texture and project it onto the faces of a cube pattern. Your folder structure should look like this:. This article will teach you the steps to building a simple game that has the player dodging bouncing balls. This tutorial explicitly encourages you to tinker with the code. Or you can play the game just install it. The program I am writing has no graphical interface and I am connecting using SSH (Putty from a Windows. With Pygame, you can easily load and draw an image onto the screen. That would be embarrassing for you as a programmer and me as a tutorial writer. (These objects are described later. What is Pygame? Pygame is a third party module designed for creating 2D games with python. In the next tutorial, we’ll begin adding some simple functionality (add an image to a surface). What does this representation look like? For every pixel in the image there is bit representation in the mask. UPDATE: Apparently, this is no longer necessary. I already run sudo apt-get install python-pygame, but this only works on python, not in anaconda. The game is an arcade game and it has very simple logic, which is why it is an ideal example to demonstrate how to build games with Pygame. Learn and use Python and PyGame to design and build cool arcade games. Since I wrote this example in stages, I'm putting the folder with the images, called 'resources,' outside the example folders. It is also highly recommended to do the exercises in the end. This is part 2 of our tutorial series, "Game Development with Pygame". In this tutorial we will create a Simple Main Menu Selection. org); both are free. Now it is time for me to expand the game a little further than a menu screen. A full tutorial can be found in the free book "Making Games with Python & Pygame". 7 is not installed on your system you may have to install it from the Python website, just follow the link below. Pygame newsgroup [永久失效連結] (web access)— the "official" Pygame newsgroup,requires registration; Line by line tutorial—Tutorial for beginners by Pete Shinners. This is a high-level introductory tutorial path. You can also draw objects to the screen using coordinates, which we will cover later. For example, <-is named K_BACKSPACE, a is named K_a and F4 is namned K_F4. We’ll delve into the code more soon. Here is a brief rundown of what you get. Some advanced language features such as objects have been deliberately left out, in an effort to make things easier to understand for beginners. Palette: Trivia: Mouse Demo: Keyboard Demo: Bomb Catcher: Circle Demo: Clock: OrbitDemo: Escape the dragon: Zombie Mob: BlockBreaker: Oil Spill: Snake:. Last updated November 2014. Then read the code, in an editor or Python environment that shows line numbers. Accelerators of python code can be done in Cython (the sprite. Make sure to choose the correct guide particularly for resistive vs capacitive displays and carefully follow the section on PiTFT Pygame Tips - in particular you really need SDL 1. For example, pygame. Download Anaconda. Some pygame examples for audiogame programming While there are tutorials for pygame, they often contain graphic examples. We'll use this to light some LEDs on the breadboard. The fact-checkers, whose work is more and more important for those who prefer facts over lies, police the line between fact and falsehood on a day-to-day basis, and do a great job. Today, my small contribution is to pass along a very good overview that reflects on one of Trump’s favorite overarching falsehoods. Namely: Trump describes an America in which everything was going down the tubes under  Obama, which is why we needed Trump to make America great again. And he claims that this project has come to fruition, with America setting records for prosperity under his leadership and guidance. “Obama bad; Trump good” is pretty much his analysis in all areas and measurement of U.S. activity, especially economically. Even if this were true, it would reflect poorly on Trump’s character, but it has the added problem of being false, a big lie made up of many small ones. Personally, I don’t assume that all economic measurements directly reflect the leadership of whoever occupies the Oval Office, nor am I smart enough to figure out what causes what in the economy. But the idea that presidents get the credit or the blame for the economy during their tenure is a political fact of life. Trump, in his adorable, immodest mendacity, not only claims credit for everything good that happens in the economy, but tells people, literally and specifically, that they have to vote for him even if they hate him, because without his guidance, their 401(k) accounts “will go down the tubes.” That would be offensive even if it were true, but it is utterly false. The stock market has been on a 10-year run of steady gains that began in 2009, the year Barack Obama was inaugurated. But why would anyone care about that? It’s only an unarguable, stubborn fact. Still, speaking of facts, there are so many measurements and indicators of how the economy is doing, that those not committed to an honest investigation can find evidence for whatever they want to believe. Trump and his most committed followers want to believe that everything was terrible under Barack Obama and great under Trump. That’s baloney. Anyone who believes that believes something false. And a series of charts and graphs published Monday in the Washington Post and explained by Economics Correspondent Heather Long provides the data that tells the tale. The details are complicated. Click through to the link above and you’ll learn much. But the overview is pretty simply this: The U.S. economy had a major meltdown in the last year of the George W. Bush presidency. Again, I’m not smart enough to know how much of this was Bush’s “fault.” But he had been in office for six years when the trouble started. So, if it’s ever reasonable to hold a president accountable for the performance of the economy, the timeline is bad for Bush. GDP growth went negative. Job growth fell sharply and then went negative. Median household income shrank. The Dow Jones Industrial Average dropped by more than 5,000 points! U.S. manufacturing output plunged, as did average home values, as did average hourly wages, as did measures of consumer confidence and most other indicators of economic health. (Backup for that is contained in the Post piece I linked to above.) Barack Obama inherited that mess of falling numbers, which continued during his first year in office, 2009, as he put in place policies designed to turn it around. By 2010, Obama’s second year, pretty much all of the negative numbers had turned positive. By the time Obama was up for reelection in 2012, all of them were headed in the right direction, which is certainly among the reasons voters gave him a second term by a solid (not landslide) margin. Basically, all of those good numbers continued throughout the second Obama term. The U.S. GDP, probably the single best measure of how the economy is doing, grew by 2.9 percent in 2015, which was Obama’s seventh year in office and was the best GDP growth number since before the crash of the late Bush years. GDP growth slowed to 1.6 percent in 2016, which may have been among the indicators that supported Trump’s campaign-year argument that everything was going to hell and only he could fix it. During the first year of Trump, GDP growth grew to 2.4 percent, which is decent but not great and anyway, a reasonable person would acknowledge that — to the degree that economic performance is to the credit or blame of the president — the performance in the first year of a new president is a mixture of the old and new policies. In Trump’s second year, 2018, the GDP grew 2.9 percent, equaling Obama’s best year, and so far in 2019, the growth rate has fallen to 2.1 percent, a mediocre number and a decline for which Trump presumably accepts no responsibility and blames either Nancy Pelosi, Ilhan Omar or, if he can swing it, Barack Obama. I suppose it’s natural for a president to want to take credit for everything good that happens on his (or someday her) watch, but not the blame for anything bad. Trump is more blatant about this than most. If we judge by his bad but remarkably steady approval ratings (today, according to the average maintained by 538.com, it’s 41.9 approval/ 53.7 disapproval) the pretty-good economy is not winning him new supporters, nor is his constant exaggeration of his accomplishments costing him many old ones). I already offered it above, but the full Washington Post workup of these numbers, and commentary/explanation by economics correspondent Heather Long, are here. On a related matter, if you care about what used to be called fiscal conservatism, which is the belief that federal debt and deficit matter, here’s a New York Times analysis, based on Congressional Budget Office data, suggesting that the annual budget deficit (that’s the amount the government borrows every year reflecting that amount by which federal spending exceeds revenues) which fell steadily during the Obama years, from a peak of $1.4 trillion at the beginning of the Obama administration, to $585 billion in 2016 (Obama’s last year in office), will be back up to $960 billion this fiscal year, and back over $1 trillion in 2020. (Here’s the New York Times piece detailing those numbers.) Trump is currently floating various tax cuts for the rich and the poor that will presumably worsen those projections, if passed. As the Times piece reported: