Environment: python3.5 Win7 64-bitBecause the MSI format installation package is only 32 bits, it cannot be installed.https://pypi.python.org/pypi/Pygame/1.9.3 here can choose the corresponding version of the download, is the WHL file. What I'm downloading here is
Pygame-1.9.3-cp35-cp35m-win_amd64.whl
It is best to install the next whee
This section describes how to process fonts on the game interface. The experiment uses real-time display of the current time and ball position on the interface as an example. For details, see the code.
I. Code
[Python]#-*-Coding: UTF-8 -*-Import OSImport sysImport timeImport pygameFrom pygame. locals import *From pygame. font import *Def load_image (pic_name ):'''''Function: Image Loading FunctionInput: pic
View All events
You only need to print the event.
Import pygame, sysfrom pygame. locals import * pygame. init () pygame. display. set_mode (600,480) while true: For event in pygame. event. get (): Print (event) If event. type = quit:
An error or pygameerror occurs when pygame loads an mp3 file with a Chinese name.
I haven't written anything for a while. I 've been working on a Python pygame-based music player in the last few days. I wanted to finish it and try again to write an article, but the deeper it gets, the framework is coming out, it may be due to my personal problems and slow time. let's talk about
1. Movement Rate
In the previous section, a car was implemented on the road from bottom to top, and Pygame.time.delay (200) was used to delay the time. Read a lot of reference materials, basic each material will talk about the different configuration of the machine under the speed of the problem, some by setting the frequency to solve, some through the set speed to solve, their own level limited, see a few, think or "Beginning Game development with Python and
1. Motion Rate
In the previous section, a car was implemented on the road from bottom to top, and the Pygame.time.delay (200) was used for time delay. See a lot of reference material, basic each material will talk about the different configuration machine movement rate of the problem, some by setting the frequency to solve, some by setting speed to solve, their own level is limited, read a few, think or "beginning Game Development with Python and Pygame
The python3 module of pygame and pyqt has not been installed in the source.
For pygame, download the source code and decompress the source code (pygame-1.9.1release.tar.gz) To install some required header files and dependent libraries.
Apt-Get install Python-dev libsdl-image1.2-dev libsdl-mixer1.2-dev libsdl-
Python and Pygame game developmentDirectory1th. Installing Python and Pygame 11. 1 Preliminary Knowledge 11. 2 Downloading and installing Python 11. 3 Installation instructions under Windows 11. 4 Installation Instructions on MAC OS x 21. 5 installation on Ubuntu and LinuxDescription 21. 6 Starting Python 21. 7 Installing Pygame 31. 8 How to read this book 41. 9
2015/11/3 use Python to write a game. Getting started with pygame (3): font module, event display, and error handling, pythonpygame
In the game, text is usually displayed, and even the Russian square should show scores. So how should we display the text? Today, let's take a look at the font module of pygame.
Use font Module
Pygame can directly call the system f
In the previous section, the ball is moved freely. In this section, the arrow keys are used to control the ball movement and background images are added to the game.
I. Implementation:
[Python]#-*-Coding: UTF-8 -*-Import OSImport sysImport pygameFrom pygame. locals import *Def load_image (pic_name ):'''''Function: Image Loading FunctionInput: NONEOutput: NONEAuthor: socratesBlog: http://blog.csdn.net/dyx1024Date: 2012-04-15'''# Obtain the absolute pat
This article shares python's detailed environment for installing a third-party library pygame: python3.5 win7 64-bit
Because the installation package in msi format is only 32-bit, it cannot be installed.
Https://pypi.python.org/pypi/pygame/1.9.3here you can select the desired download path, which is the whl file. What I downloaded here is
I really do not love typing, do not love to write these Ah, good want to turn an article, can be vegetarian, not a normal solution to my problem, I want to spit groove, we write the solution is from an article that got ...My Python version is 2.7.6,2016 September download, the reason why the date is these things have been updated, so the future installation method may be a discrepancy, hmm.1. First install Easy_install,:https://pypi.python.org/pypi/ez
This article mainly introduces the pygame-based stretch ball effect in Python, involves techniques related to pygame graphics dynamic operations, and comes with a complete source code for readers to download and reference, if you need it, refer to the example in this article to describe the effect of the pygame-based s
1, single pixel (draw point)
There are three main ways to draw points using Pygame:Method One: Draw a square with a length of 1 pixels wide
The code is as follows:
Import Pygame,sysPygame.init ()Screen=pygame.display.set_caption (' Hello world! ')Screen=pygame.display.set_mode ([640,480])Screen.fill ([255,255,255])Pygame.draw.rect (screen,[0,0,0],[150,50,1,1],1) #画1 a rectangle with a line width of 1, which cannot be 0, since 1*1 has no blank area.Py
This article mainly explains how to solve the error when pygame loads mp3 files of Chinese names. it has some reference value. if you are interested, refer to # pygame to play mp3 files:
Here I will only introduce a good understanding method.
Open the official document and I found that, like discovering the new world, this guy is so powerful, but now I can only use it to play my mp3. well, let's explore i
1, single pixel (draw point)
There are three main ways to draw points using Pygame:Method One: Draw a square with a length of 1 pixels
Copy Code code as follows:
Import Pygame,sys
Pygame.init ()
Screen=pygame.display.set_caption (' Hello world! ')
Screen=pygame.display.set_mode ([640,480])
Screen.fill ([255,255,255])
Pygame.draw.rect (screen,[0,0,0],[150,50,1,1],1) #画1 the *1 rectangle, the line width is 1, this cannot be 0,
According to the plan of last week, start learning pygame today.
1. hello world Program of pygame version.
Code:
[Python]#! /Usr/bin/python#-*-Coding: UTF-8 -*-Import sys# Import the pygame module. Line 4 is used to simplify your input. For example, you do not need to add the pygame Module name before the event.Import
Environment: python3.5 Win7 64-bit
Because the MSI format installation package is only 32 bits, it cannot be installed.
https://pypi.python.org/pypi/Pygame/1.9.3 here can choose the corresponding version of the download, is the WHL file. What I'm downloading here is
Pygame-1.9.3-cp35-cp35m-win_amd64.whl
It is best to install the next wheel before installing
Python pygame Display Method for game windows instance analysis (with source code), pythonpygame
This article describes how pygame displays game windows in python. We will share this with you for your reference. The details are as follows:
In this tutorial, I will give a demo:
When we press the 'F' key on the keyboard, the displayed window will switch to the full screen display mode and the default display
First run this to install dependencies:sudo apt-get install mercurial Python3-dev python3-numpy Libsdl-image1.2-dev Libsdl-mixer1.2-dev Libsdl-ttf2.0-dev libsmpeg-dev libsdl1.2-dev libportmidi-dev libswscale-dev libavformat-dev Libavcodec-dev Libfreetype6-devThen download the source for Pygame:First install mercurial if you dont has it installed:sudo apt-get install mercurialThenHG Clone Https://bitbucket.org/
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.