super simple pygame programs.
install python
- download Python x86-64 https://www.python.org/downloads/windows/
- run instal exe as admin
- check the
Add python 3.6 to PATH
box, and selectCustomize installation
Customize install location
set it toC:\python36
- disable PATH length limit
- check in CLI that python starts
- check in CLI that
path
includesC:\Python36
install pygame
- in command line,
pip install -U pygame
- don't instal with
--user
, it places the library in~\AppData\Roaming\Python\Python36
, which is a hidden directory. - if you get
TypeError: can only concatenate str
, it's because Pygame has not kept up with Python. Install an older Python. - fyi pip installs into
C:\python36\Lib\site-packages
- check in CLI
python -m pygame.examples.aliens
- missing numpy? https://www.anaconda.com/download/ - don't set their python as default python
vscode setup
- access settings via
ctrl+,
and check path to interpreter inpython.pythonPath
isc:/python36/python.exe
. See link
eclipse setup
- install for java
- add pydev and egit (both from Liclipse) via
Help
>Install new software
: http://update.liclipse.com/latest - right click > new project > pydev > configure interpreter
- check: window > preferences > pydev > interpreters > python - check pygame is in packages below
- shortcuts:
Window > Preferences > General > Keys
, switch ctrl-tab fromnext editor
tonext tab
, same withprevious tab
- general > editor > text editor > show print margin, and insert spaces for tabs
more links
- installing python on windows
- installing pygame
- Adding a package on Windows:
python -m pip install numpy
- In Eclipse, fix PyDev "Undefined variable from import" errors? if needed.
- Eclipse Neon/Oxygen dark theme
- installing numpy in python3.6: download package, then
pip install package.whl
. Compiling is harder.
- bomberman, with map editor
- cabbage and kings
- tuxemon
- pyroller: casino mini games. Controller switches scenes, with unit testing
- bunch of pyweek entries
- tower defense game with py2exe
- http://www.nerdparadise.com/programming/pygametips bunch of stuff!
- surfarray and mixer tips
- newbie guide to pygame
import pygame; filter(lambda x:'K_' in x, dir(pygame))
lists all keyboard keys
- tutorials, surfarray, camera, sprite, tips
- gfx surfarray hacks, and some font, gui, and utility scripts.
- mekire's samples
- blit PNG with transparent pixels with opacity
- playing multiple sounds simultaneously
- joystick fallback to keyboard, may require muting joystick console output (this is fixed in python 3.6 and pygame 1.9.3)
- Tileset guide
- simple map editor
- unit testing
- singleton allowing for unit testing
- dirty sprite monkey punch
- greyscale image conversion with surfarray
- masked blit with BLEND_RGBA_MULT