changeset 34:25bf3ec84410

remove docs
author Radomir Dopieralski <sheep-devel@sheep.art.pl>
date Sat, 10 Sep 2011 08:38:28 +0200
parents 475b1e590cb6
children 9dc78f2fcca4
files docs/Makefile docs/conf.py docs/index.rst docs/main_loop.rst docs/make.bat docs/pgame-tiled-crates.png docs/pgame-tiled-map-empty.png docs/pgame-tiled-skeletons.png docs/pgame-tiled-sliced.png docs/pgame-tiled-tileset.png docs/player.rst docs/sprites.rst docs/tiles.rst
diffstat 13 files changed, 0 insertions(+), 982 deletions(-) [+]
line wrap: on
line diff
--- a/docs/Makefile	Sat Sep 10 08:37:07 2011 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,130 +0,0 @@
-# Makefile for Sphinx documentation
-#
-
-# You can set these variables from the command line.
-SPHINXOPTS    =
-SPHINXBUILD   = sphinx-build
-PAPER         =
-BUILDDIR      = _build
-
-# Internal variables.
-PAPEROPT_a4     = -D latex_paper_size=a4
-PAPEROPT_letter = -D latex_paper_size=letter
-ALLSPHINXOPTS   = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
-
-.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest
-
-help:
-	@echo "Please use \`make <target>' where <target> is one of"
-	@echo "  html       to make standalone HTML files"
-	@echo "  dirhtml    to make HTML files named index.html in directories"
-	@echo "  singlehtml to make a single large HTML file"
-	@echo "  pickle     to make pickle files"
-	@echo "  json       to make JSON files"
-	@echo "  htmlhelp   to make HTML files and a HTML help project"
-	@echo "  qthelp     to make HTML files and a qthelp project"
-	@echo "  devhelp    to make HTML files and a Devhelp project"
-	@echo "  epub       to make an epub"
-	@echo "  latex      to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
-	@echo "  latexpdf   to make LaTeX files and run them through pdflatex"
-	@echo "  text       to make text files"
-	@echo "  man        to make manual pages"
-	@echo "  changes    to make an overview of all changed/added/deprecated items"
-	@echo "  linkcheck  to check all external links for integrity"
-	@echo "  doctest    to run all doctests embedded in the documentation (if enabled)"
-
-clean:
-	-rm -rf $(BUILDDIR)/*
-
-html:
-	$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
-	@echo
-	@echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
-
-dirhtml:
-	$(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml
-	@echo
-	@echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml."
-
-singlehtml:
-	$(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml
-	@echo
-	@echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml."
-
-pickle:
-	$(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle
-	@echo
-	@echo "Build finished; now you can process the pickle files."
-
-json:
-	$(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json
-	@echo
-	@echo "Build finished; now you can process the JSON files."
-
-htmlhelp:
-	$(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp
-	@echo
-	@echo "Build finished; now you can run HTML Help Workshop with the" \
-	      ".hhp project file in $(BUILDDIR)/htmlhelp."
-
-qthelp:
-	$(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp
-	@echo
-	@echo "Build finished; now you can run "qcollectiongenerator" with the" \
-	      ".qhcp project file in $(BUILDDIR)/qthelp, like this:"
-	@echo "# qcollectiongenerator $(BUILDDIR)/qthelp/qq.qhcp"
-	@echo "To view the help file:"
-	@echo "# assistant -collectionFile $(BUILDDIR)/qthelp/qq.qhc"
-
-devhelp:
-	$(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp
-	@echo
-	@echo "Build finished."
-	@echo "To view the help file:"
-	@echo "# mkdir -p $$HOME/.local/share/devhelp/qq"
-	@echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/qq"
-	@echo "# devhelp"
-
-epub:
-	$(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub
-	@echo
-	@echo "Build finished. The epub file is in $(BUILDDIR)/epub."
-
-latex:
-	$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
-	@echo
-	@echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex."
-	@echo "Run \`make' in that directory to run these through (pdf)latex" \
-	      "(use \`make latexpdf' here to do that automatically)."
-
-latexpdf:
-	$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
-	@echo "Running LaTeX files through pdflatex..."
-	make -C $(BUILDDIR)/latex all-pdf
-	@echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
-
-text:
-	$(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text
-	@echo
-	@echo "Build finished. The text files are in $(BUILDDIR)/text."
-
-man:
-	$(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man
-	@echo
-	@echo "Build finished. The manual pages are in $(BUILDDIR)/man."
-
-changes:
-	$(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes
-	@echo
-	@echo "The overview file is in $(BUILDDIR)/changes."
-
-linkcheck:
-	$(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck
-	@echo
-	@echo "Link check complete; look for any errors in the above output " \
-	      "or in $(BUILDDIR)/linkcheck/output.txt."
-
-doctest:
-	$(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest
-	@echo "Testing of doctests in the sources finished, look at the " \
-	      "results in $(BUILDDIR)/doctest/output.txt."
--- a/docs/conf.py	Sat Sep 10 08:37:07 2011 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,216 +0,0 @@
-# -*- coding: utf-8 -*-
-#
-# qq documentation build configuration file, created by
-# sphinx-quickstart on Sun Jun  5 19:38:23 2011.
-#
-# This file is execfile()d with the current directory set to its containing dir.
-#
-# Note that not all possible configuration values are present in this
-# autogenerated file.
-#
-# All configuration values have a default; values that are commented out
-# serve to show the default.
-
-import sys, os
-
-# If extensions (or modules to document with autodoc) are in another directory,
-# add these directories to sys.path here. If the directory is relative to the
-# documentation root, use os.path.abspath to make it absolute, like shown here.
-#sys.path.insert(0, os.path.abspath('.'))
-
-# -- General configuration -----------------------------------------------------
-
-# If your documentation needs a minimal Sphinx version, state it here.
-#needs_sphinx = '1.0'
-
-# Add any Sphinx extension module names here, as strings. They can be extensions
-# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
-extensions = ['sphinx.ext.autodoc']
-
-# Add any paths that contain templates here, relative to this directory.
-templates_path = ['_templates']
-
-# The suffix of source filenames.
-source_suffix = '.rst'
-
-# The encoding of source files.
-#source_encoding = 'utf-8-sig'
-
-# The master toctree document.
-master_doc = 'index'
-
-# General information about the project.
-project = u'qq'
-copyright = u'2011, Radomir Dopieralski'
-
-# The version info for the project you're documenting, acts as replacement for
-# |version| and |release|, also used in various other places throughout the
-# built documents.
-#
-# The short X.Y version.
-version = '1.0'
-# The full version, including alpha/beta/rc tags.
-release = '1.0'
-
-# The language for content autogenerated by Sphinx. Refer to documentation
-# for a list of supported languages.
-#language = None
-
-# There are two options for replacing |today|: either, you set today to some
-# non-false value, then it is used:
-#today = ''
-# Else, today_fmt is used as the format for a strftime call.
-#today_fmt = '%B %d, %Y'
-
-# List of patterns, relative to source directory, that match files and
-# directories to ignore when looking for source files.
-exclude_patterns = ['_build']
-
-# The reST default role (used for this markup: `text`) to use for all documents.
-#default_role = None
-
-# If true, '()' will be appended to :func: etc. cross-reference text.
-#add_function_parentheses = True
-
-# If true, the current module name will be prepended to all description
-# unit titles (such as .. function::).
-#add_module_names = True
-
-# If true, sectionauthor and moduleauthor directives will be shown in the
-# output. They are ignored by default.
-#show_authors = False
-
-# The name of the Pygments (syntax highlighting) style to use.
-pygments_style = 'sphinx'
-
-# A list of ignored prefixes for module index sorting.
-#modindex_common_prefix = []
-
-
-# -- Options for HTML output ---------------------------------------------------
-
-# The theme to use for HTML and HTML Help pages.  See the documentation for
-# a list of builtin themes.
-html_theme = 'default'
-
-# Theme options are theme-specific and customize the look and feel of a theme
-# further.  For a list of options available for each theme, see the
-# documentation.
-#html_theme_options = {}
-
-# Add any paths that contain custom themes here, relative to this directory.
-#html_theme_path = []
-
-# The name for this set of Sphinx documents.  If None, it defaults to
-# "<project> v<release> documentation".
-#html_title = None
-
-# A shorter title for the navigation bar.  Default is the same as html_title.
-#html_short_title = None
-
-# The name of an image file (relative to this directory) to place at the top
-# of the sidebar.
-#html_logo = None
-
-# The name of an image file (within the static path) to use as favicon of the
-# docs.  This file should be a Windows icon file (.ico) being 16x16 or 32x32
-# pixels large.
-#html_favicon = None
-
-# Add any paths that contain custom static files (such as style sheets) here,
-# relative to this directory. They are copied after the builtin static files,
-# so a file named "default.css" will overwrite the builtin "default.css".
-html_static_path = ['_static']
-
-# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
-# using the given strftime format.
-#html_last_updated_fmt = '%b %d, %Y'
-
-# If true, SmartyPants will be used to convert quotes and dashes to
-# typographically correct entities.
-#html_use_smartypants = True
-
-# Custom sidebar templates, maps document names to template names.
-#html_sidebars = {}
-
-# Additional templates that should be rendered to pages, maps page names to
-# template names.
-#html_additional_pages = {}
-
-# If false, no module index is generated.
-#html_domain_indices = True
-
-# If false, no index is generated.
-#html_use_index = True
-
-# If true, the index is split into individual pages for each letter.
-#html_split_index = False
-
-# If true, links to the reST sources are added to the pages.
-#html_show_sourcelink = True
-
-# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
-#html_show_sphinx = True
-
-# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
-#html_show_copyright = True
-
-# If true, an OpenSearch description file will be output, and all pages will
-# contain a <link> tag referring to it.  The value of this option must be the
-# base URL from which the finished HTML is served.
-#html_use_opensearch = ''
-
-# This is the file name suffix for HTML files (e.g. ".xhtml").
-#html_file_suffix = None
-
-# Output file base name for HTML help builder.
-htmlhelp_basename = 'qqdoc'
-
-
-# -- Options for LaTeX output --------------------------------------------------
-
-# The paper size ('letter' or 'a4').
-#latex_paper_size = 'letter'
-
-# The font size ('10pt', '11pt' or '12pt').
-#latex_font_size = '10pt'
-
-# Grouping the document tree into LaTeX files. List of tuples
-# (source start file, target name, title, author, documentclass [howto/manual]).
-latex_documents = [
-  ('index', 'qq.tex', u'qq Documentation',
-   u'Radomir Dopieralski', 'manual'),
-]
-
-# The name of an image file (relative to this directory) to place at the top of
-# the title page.
-#latex_logo = None
-
-# For "manual" documents, if this is true, then toplevel headings are parts,
-# not chapters.
-#latex_use_parts = False
-
-# If true, show page references after internal links.
-#latex_show_pagerefs = False
-
-# If true, show URL addresses after external links.
-#latex_show_urls = False
-
-# Additional stuff for the LaTeX preamble.
-#latex_preamble = ''
-
-# Documents to append as an appendix to all manuals.
-#latex_appendices = []
-
-# If false, no module index is generated.
-#latex_domain_indices = True
-
-
-# -- Options for manual page output --------------------------------------------
-
-# One entry per manual page. List of tuples
-# (source start file, name, description, authors, manual section).
-man_pages = [
-    ('index', 'qq', u'qq Documentation',
-     [u'Radomir Dopieralski'], 1)
-]
--- a/docs/index.rst	Sat Sep 10 08:37:07 2011 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,32 +0,0 @@
-.. qq documentation master file, created by
-   sphinx-quickstart on Sun Jun  5 19:38:23 2011.
-   You can adapt this file completely to your liking, but it should at least
-   contain the root `toctree` directive.
-
-Welcome to QQ PyGame tutorial!
-==============================
-
-This is a sort of a tutorial about writing a tile-based animated game in Python_ using PyGame_.  I'm writing it, because it took me some time to figure out a way that works well for me -- it wasn't immediately obvious -- and I'd like to save others some effort.  Please don't treat it as one and the only, or even just best way to do it.  Of course, I'm always interested about hearing about better ways.  I'm also not going to tell you how to write the whole game: I will concentrate on the parts directly related to PyGame_.  You are on your own with the rest.
-
-You can get the final source code and all the graphics at https://bitbucket.org/thesheep/qq
-
-.. _Python: http://python.org
-.. _PyGame: http://pygame.org
-
-Contents:
-
-.. toctree::
-   :maxdepth: 2
-   
-   tiles.rst
-   main_loop.rst
-   sprites.rst
-   player.rst
-
-Indices and tables
-==================
-
-* :ref:`genindex`
-* :ref:`modindex`
-* :ref:`search`
-
--- a/docs/main_loop.rst	Sat Sep 10 08:37:07 2011 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,112 +0,0 @@
-Main loop
-=========
-
-Initialization
---------------
-
-In order to make use of that map of ours, we need to actually call the renderer code somewhere. It's time to create the heart of our game -- the main game loop.
-
-First we need to initialize some globals that our game will be using, load the
-map tiles and initialize PyGame's screen and clock. Then we draw out map on a separate surface for the background, and blit that to the screen, refreshing it afterwards with flip -- that refreshes the whole screen, we will later see how to only refresh the parts that changed::
-
-    if __name__ == "__main__":
-        screen = pygame.display.set_mode((424, 320))
-
-        MAP_TILE_WIDTH = 24
-        MAP_TILE_HEIGHT = 16
-        MAP_CACHE = {
-            'ground.png': load_tile_table('ground.png', MAP_TILE_WIDTH,
-                                          MAP_TILE_HEIGHT),
-        }
-
-        level = Level()
-        level.load_file('level.map')
-
-        clock = pygame.time.Clock()
-        
-        background, overlay_dict = level.render()
-        overlays = pygame.sprite.RenderUpdates()
-        for (x, y), image in overlay_dict.iteritems():
-            overlay = pygame.sprite.Sprite(overlays)
-            overlay.image = image
-            overlay.rect = image.get_rect().move(x * 24, y * 16 - 16)
-        screen.blit(background, (0, 0))
-        overlays.draw(screen)
-        pygame.display.flip()
-
-Main game loop
---------------
-
-For now the game loop will just redraw the overlays 15 times per second, and react to any events: record keypresses and exit when you close the window::
-
-    game_over = False
-    while not game_over:
-
-        # XXX draw all the objects here
-
-        overlays.draw(screen)
-        pygame.display.flip()
-        clock.tick(15)
-        for event in pygame.event.get():
-            if event.type == pygame.locals.QUIT:
-                game_over = True
-            elif event.type == pygame.locals.KEYDOWN:
-                pressed_key = event.key
-
-
-We are doing 15 iterations of the loop per second, using pygame's clock. In each iteration we will draw our objects on the background, and then draw the overlays over them.
-
-Later we will move the main loop into a separate "Game" object, and put some of the state we need to keep track of on it. For now it's enough.
- 
-Empty map
----------
-
-By now you should have a program that you can run and that displays roughly something like this:
-
-.. image:: pgame-tiled-map-empty.png
-
-You can edit the "map.txt" file and see how it changes the map displayed. You can also change the tileset image, but remember to add it to the loading code.
-
-Tile cache
-----------
-
-Actually, adding the loading to the initialization code every time you add a new tileset is kind of lame. We can do better than that: we will make a cache object that will act as a dict, but will automatically load any tilesets we request::
-
-    class TileCache:
-        """Load the tilesets lazily into global cache"""
-
-        def __init__(self,  width=32, height=None):
-            self.width = width
-            self.height = height or width
-            self.cache = {}
-
-        def __getitem__(self, filename):
-            """Return a table of tiles, load it from disk if needed."""
-
-            key = (filename, self.width, self.height)
-            try:
-                return self.cache[key]
-            except KeyError:
-                tile_table = self._load_tile_table(filename, self.width,
-                                                   self.height)
-                self.cache[key] = tile_table
-                return tile_table
-
-        def _load_tile_table(self, filename, width, height):
-            """Load an image and split it into tiles."""
-
-            image = pygame.image.load(filename).convert()
-            image_width, image_height = image.get_size()
-            tile_table = []
-            for tile_x in range(0, image_width/width):
-                line = []
-                tile_table.append(line)
-                for tile_y in range(0, image_height/height):
-                    rect = (tile_x*width, tile_y*height, width, height)
-                    line.append(image.subsurface(rect))
-            return tile_table
-
-Now we can just do::
-
-    MAP_CACHE = TileCache(MAP_TILE_WIDTH, MAP_TILE_HEIGHT)
-	
--- a/docs/make.bat	Sat Sep 10 08:37:07 2011 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,155 +0,0 @@
-@ECHO OFF
-
-REM Command file for Sphinx documentation
-
-if "%SPHINXBUILD%" == "" (
-	set SPHINXBUILD=sphinx-build
-)
-set BUILDDIR=_build
-set ALLSPHINXOPTS=-d %BUILDDIR%/doctrees %SPHINXOPTS% .
-if NOT "%PAPER%" == "" (
-	set ALLSPHINXOPTS=-D latex_paper_size=%PAPER% %ALLSPHINXOPTS%
-)
-
-if "%1" == "" goto help
-
-if "%1" == "help" (
-	:help
-	echo.Please use `make ^<target^>` where ^<target^> is one of
-	echo.  html       to make standalone HTML files
-	echo.  dirhtml    to make HTML files named index.html in directories
-	echo.  singlehtml to make a single large HTML file
-	echo.  pickle     to make pickle files
-	echo.  json       to make JSON files
-	echo.  htmlhelp   to make HTML files and a HTML help project
-	echo.  qthelp     to make HTML files and a qthelp project
-	echo.  devhelp    to make HTML files and a Devhelp project
-	echo.  epub       to make an epub
-	echo.  latex      to make LaTeX files, you can set PAPER=a4 or PAPER=letter
-	echo.  text       to make text files
-	echo.  man        to make manual pages
-	echo.  changes    to make an overview over all changed/added/deprecated items
-	echo.  linkcheck  to check all external links for integrity
-	echo.  doctest    to run all doctests embedded in the documentation if enabled
-	goto end
-)
-
-if "%1" == "clean" (
-	for /d %%i in (%BUILDDIR%\*) do rmdir /q /s %%i
-	del /q /s %BUILDDIR%\*
-	goto end
-)
-
-if "%1" == "html" (
-	%SPHINXBUILD% -b html %ALLSPHINXOPTS% %BUILDDIR%/html
-	echo.
-	echo.Build finished. The HTML pages are in %BUILDDIR%/html.
-	goto end
-)
-
-if "%1" == "dirhtml" (
-	%SPHINXBUILD% -b dirhtml %ALLSPHINXOPTS% %BUILDDIR%/dirhtml
-	echo.
-	echo.Build finished. The HTML pages are in %BUILDDIR%/dirhtml.
-	goto end
-)
-
-if "%1" == "singlehtml" (
-	%SPHINXBUILD% -b singlehtml %ALLSPHINXOPTS% %BUILDDIR%/singlehtml
-	echo.
-	echo.Build finished. The HTML pages are in %BUILDDIR%/singlehtml.
-	goto end
-)
-
-if "%1" == "pickle" (
-	%SPHINXBUILD% -b pickle %ALLSPHINXOPTS% %BUILDDIR%/pickle
-	echo.
-	echo.Build finished; now you can process the pickle files.
-	goto end
-)
-
-if "%1" == "json" (
-	%SPHINXBUILD% -b json %ALLSPHINXOPTS% %BUILDDIR%/json
-	echo.
-	echo.Build finished; now you can process the JSON files.
-	goto end
-)
-
-if "%1" == "htmlhelp" (
-	%SPHINXBUILD% -b htmlhelp %ALLSPHINXOPTS% %BUILDDIR%/htmlhelp
-	echo.
-	echo.Build finished; now you can run HTML Help Workshop with the ^
-.hhp project file in %BUILDDIR%/htmlhelp.
-	goto end
-)
-
-if "%1" == "qthelp" (
-	%SPHINXBUILD% -b qthelp %ALLSPHINXOPTS% %BUILDDIR%/qthelp
-	echo.
-	echo.Build finished; now you can run "qcollectiongenerator" with the ^
-.qhcp project file in %BUILDDIR%/qthelp, like this:
-	echo.^> qcollectiongenerator %BUILDDIR%\qthelp\qq.qhcp
-	echo.To view the help file:
-	echo.^> assistant -collectionFile %BUILDDIR%\qthelp\qq.ghc
-	goto end
-)
-
-if "%1" == "devhelp" (
-	%SPHINXBUILD% -b devhelp %ALLSPHINXOPTS% %BUILDDIR%/devhelp
-	echo.
-	echo.Build finished.
-	goto end
-)
-
-if "%1" == "epub" (
-	%SPHINXBUILD% -b epub %ALLSPHINXOPTS% %BUILDDIR%/epub
-	echo.
-	echo.Build finished. The epub file is in %BUILDDIR%/epub.
-	goto end
-)
-
-if "%1" == "latex" (
-	%SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex
-	echo.
-	echo.Build finished; the LaTeX files are in %BUILDDIR%/latex.
-	goto end
-)
-
-if "%1" == "text" (
-	%SPHINXBUILD% -b text %ALLSPHINXOPTS% %BUILDDIR%/text
-	echo.
-	echo.Build finished. The text files are in %BUILDDIR%/text.
-	goto end
-)
-
-if "%1" == "man" (
-	%SPHINXBUILD% -b man %ALLSPHINXOPTS% %BUILDDIR%/man
-	echo.
-	echo.Build finished. The manual pages are in %BUILDDIR%/man.
-	goto end
-)
-
-if "%1" == "changes" (
-	%SPHINXBUILD% -b changes %ALLSPHINXOPTS% %BUILDDIR%/changes
-	echo.
-	echo.The overview file is in %BUILDDIR%/changes.
-	goto end
-)
-
-if "%1" == "linkcheck" (
-	%SPHINXBUILD% -b linkcheck %ALLSPHINXOPTS% %BUILDDIR%/linkcheck
-	echo.
-	echo.Link check complete; look for any errors in the above output ^
-or in %BUILDDIR%/linkcheck/output.txt.
-	goto end
-)
-
-if "%1" == "doctest" (
-	%SPHINXBUILD% -b doctest %ALLSPHINXOPTS% %BUILDDIR%/doctest
-	echo.
-	echo.Testing of doctests in the sources finished, look at the ^
-results in %BUILDDIR%/doctest/output.txt.
-	goto end
-)
-
-:end
Binary file docs/pgame-tiled-crates.png has changed
Binary file docs/pgame-tiled-map-empty.png has changed
Binary file docs/pgame-tiled-skeletons.png has changed
Binary file docs/pgame-tiled-sliced.png has changed
Binary file docs/pgame-tiled-tileset.png has changed
--- a/docs/player.rst	Sat Sep 10 08:37:07 2011 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,10 +0,0 @@
-Player character
-================
-
-It's finally time to add a little bit of interactivity to this game. We will
-introduce a player character that walks around the map. But before we do that,
-we need to clean up our main loop a little bit, get rid of most of the globals
-and create a Game object.
-
-Main loop cleanup
------------------
--- a/docs/sprites.rst	Sat Sep 10 08:37:07 2011 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,133 +0,0 @@
-Sprites
-=======
-
-Immobile objects
-----------------
-
-Our map is kinda neat by now, but it's still a little bit empty. Before we populate it with the player character and monsters, lets just put some immobile crates in it. It should be easier, as they are not animated.
-
-We will need to add it to our map:
-
-.. code-block:: ini
-
-    [level]
-    tileset = ground.png
-    map = ..........
-          .#####.##.
-          .#...#..#.
-          .#..b####.
-          .##.##..b.
-          ......b...
-    [.]
-    name = floor
-    tile = 0, 3
-
-    [#]
-    name = wall
-    wall = true
-    block = true
-
-    [b]
-    name = crate
-    tile = 0, 3
-    block = true
-    sprite = crate.png
-
-Now we need to modify our level loading code to use the "sprite" attribute::
-
-    self.items = {}
-    for y, line in enumerate(self.map):
-        for x, c in enumerate(line):
-            if not self.is_wall(x, y) and 'sprite' in self.key[c]:
-                self.items[(x, y)] = self.key[c]
-                    
-Then we will load the sprite graphics into a separate cachem and keep a group of sprites for our level in our main loop. Our sprites will all be 32 by 32 pixels::
-
-    level = Level()
-    level.load_file('level.map')
-
-    SPRITE_CACHE = TileCache(32, 32)
-    sprites = pygame.sprite.RenderUpdates()
-    for pos, tile in level.items.iteritems():
-        sprite = Sprite(pos, SPRITE_CACHE[tile["sprite"]])
-        sprites.add(sprite)
-
-We still need to define our Sprite class. For now it will just use the very first frame as the image::
-
-    class Sprite(pygame.sprite.Sprite):
-        def __init__(self, pos=(0, 0), frames=None):
-            super(Sprite, self).__init__()
-            self.image = frames[0][0]
-            self.rect = self.image.get_rect()
-            self.pos = pos
-            
-        def _get_pos(self):
-            """Check the current position of the sprite on the map."""
-
-            return (self.rect.midbottom[0]-12)/24, (self.rect.midbottom[1]-16)/16
-
-        def _set_pos(self, pos):
-            """Set the position and depth of the sprite on the map."""
-
-            self.rect.midbottom = pos[0]*24+12, pos[1]*16+16
-            self.depth = self.rect.midbottom[1]
-
-        pos = property(_get_pos, _set_pos)
-
-        def move(self, dx, dy):
-            """Change the position of the sprite on screen."""
-
-            self.rect.move_ip(dx, dy)
-            self.depth = self.rect.midbottom[1]
-
-Finally, we can draw all those sprites in our main loop, just before we draw the overlays::
-
-    sprites.clear(screen, background)
-    dirty = sprites.draw(screen)
-    overlays.draw(screen)
-    pygame.display.update(dirty)
-    clock.tick(15)
-
-Note that instead using :func:`pygame.display.flip` we switched to :func:`pygame.display.update`, which takes a list of rectangles to update as a parameter. This way we are only updating the parts of the screen that contain sprites -- the only thing that can move.
-
-Your program should now display something like this:
-
-.. image:: pgame-tiled-crates.png
-
-Animation
----------
-
-That map is getting updated at 15 frames per minute, but we can't really see that because there is nothing moving. Lets fix that and add some animated monsters.
-
-We actually already have almost all that we need -- just need to extend the Sprite class a little bit::
-
-    class Sprite(pygame.sprite.Sprite):
-        def __init__(self, pos=(0, 0), frames=None):
-            super(Sprite, self).__init__()
-            self.frames = frames
-            self.animation = self.stand_animation()
-            self.image = frames[0][0]
-            self.rect = self.image.get_rect()
-            self.pos = pos
-
-        def stand_animation(self):
-            while True:
-                for frame in self.frames[0]:
-                    self.image = frame
-                    yield None
-                    yield None
-
-        def update(self, *args):
-            self.animation.next()
-
-We are using iterators for defining animations -- this way we don't need to keep track of the current frame and such -- we just iterate over the animation. The default animation just changes the frame to the next one every two ticks -- we need to change our crate sprites to "skeleton.png" to see the difference.
-
-Lastly, we need to update the sprites between clearing and drawing them::
-
-    sprites.clear(screen, background)
-    sprites.update()
-    dirty = sprites.draw(screen)
-
-If everything went right, you should now see some animated skeletons:
-
-.. image:: pgame-tiled-skeletons.png
--- a/docs/tiles.rst	Sat Sep 10 08:37:07 2011 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,194 +0,0 @@
-Tiles
-=====
-
-Just to make sure we are on the same page: if you ever played any RPG games for Game Boy, NES, SNES or some of the titles on Game Boy Advance or Nintendo DS, you have surely noticed that the display consists of a scrolled map, composed of square (or rectangular) elements, with animated characters, monsters and other objects added to it. This is what we are going to make. Usually games also have a more or less sophisticated system of menus for inventory and combat, and of course plot and dialogs a lot of finer details -- that's outside the scope of this article.
-
-As was said, the map is composed of rectangular elements, fit together on a grid. Sometimes there are so many of them and they are so well drawn that you can hardly tell where one of them begins and other ends. We will be calling them "tiles", because they are arranged like tiles on a kitchen floor. Incidentally, they will sometimes be tiles of actual floor tiles, but also of grass, walls, ground, trees, etc. -- usually most non-moving things in those games are created using tiles. The graphics for those tiles is usually taken from tilesets. Tilestes are, well sets of tiles, usually in a form of images containing rows of tiles aligned one next to the other, one of each tile type. Our program will slice them into single tiles, and "stamp" those on the screen to create the map. An example of a small tileset may look like this:
-
-.. image:: pgame-tiled-tileset.png
-
-To use that tileset, we will need some code that will load it into memory and slice into single tiles. We will use something like this::
-
-    import pygame
-    import pygame.locals
-
-    def load_tile_table(filename, width, height):
-        image = pygame.image.load(filename).convert()
-        image_width, image_height = image.get_size()
-        tile_table = []
-        for tile_x in range(0, image_width/width):
-            line = []
-            tile_table.append(line)
-            for tile_y in range(0, image_height/height):
-                rect = (tile_x*width, tile_y*height, width, height)
-                line.append(image.subsurface(rect))
-        return tile_table
-
-    if __name__=='__main__':
-        pygame.init()
-        screen = pygame.display.set_mode((128, 98))
-        screen.fill((255, 255, 255))
-        table = load_tile_table("ground.png", 24, 16)
-        for x, row in enumerate(table):
-            for y, tile in enumerate(row):
-                screen.blit(tile, (x*32, y*24))
-        pygame.display.flip()
-        while pygame.event.wait().type != pygame.locals.QUIT:
-            pass
-
-The function :func:`load_tile_table` will load tiles from a tileset file, and return them sliced up as a list of lists. At first I did that by creating separate surfaces, but later I found out that using ``subsurface`` is better -- it doesn't create copies in memory. Once the tiles are loaded, they are displayed, a little spaced so that you can see where they end:
-
-.. image:: pgame-tiled-sliced.png
-
-Map definition
---------------
-
-We usually don't want to hardcode the maps in our game, so it's best to put them in a file. You might distract yourself by writing a map editor, or use an existing editor and merely distract yourself trying to figure out how to parse the files it produces. I took an easier route and just used a plain text file, parsed with the :mod:`ConfigParser`. I define the map as lines of characters, every character representing one map square. What exactly that square contains is defined later in the file, in sort of a legend. So, an example map definition may look like this (save it in a file "level.map"):
-
-.. code-block:: ini
-
-    [level]
-    tileset = ground.png
-    map = ..........
-          .#####.##.
-          .#...#..#.
-          .#...####.
-          .##.##....
-          ..........
-
-    [.]
-    name = floor
-    tile = 0, 3
-
-    [#]
-    name = wall
-    wall = true
-    block = true
-
-This way, for every map square I have a dictionary of key-value pairs describing that square. If I need to add something, I just add a new character to the legend, with the description. Now, the parsing of that goes something like this::
-
-    import ConfigParser
-
-    class Level(object):
-        def load_file(self, filename="level.map"):
-            self.map = []
-            self.key = {}
-            parser = ConfigParser.ConfigParser()
-            parser.read(filename)
-            self.tileset = parser.get("level", "tileset")
-            self.map = parser.get("level", "map").split("\n")
-            for section in parser.sections():
-                if len(section) == 1:
-                    desc = dict(parser.items(section))
-                    self.key[section] = desc
-            self.width = len(self.map[0])
-            self.height = len(self.map)
-
-        def get_tile(self, x, y):
-            try:
-                char = self.map[y][x]
-            except IndexError:
-                return {}
-            try:
-                return self.key[char]
-            except KeyError:
-                return {}
-
-With this code, you can just use :func:`get_tile` to get a dict of values for any particular map square. We will add a couple of convenience methods for accessing oten used values::
-
-    class Level(object): # Continued...
-        def get_tile(self, x, y):
-            """Tell what's at the specified position of the map."""
-
-            try:
-                char = self.map[y][x]
-            except IndexError:
-                return {}
-            try:
-                return self.key[char]
-            except KeyError:
-                return {}
-
-        def get_bool(self, x, y, name):
-            """Tell if the specified flag is set for position on the map."""
-
-            value = self.get_tile(x, y).get(name)
-            return value in (True, 1, 'true', 'yes', 'True', 'Yes', '1', 'on', 'On')
-
-        def is_wall(self, x, y):
-            """Is there a wall?"""
-
-            return self.get_bool(x, y, 'wall')
-
-        def is_blocking(self, x, y):
-            """Is this place blocking movement?"""
-
-            if not 0 <= x < self.width or not 0 <= y < self.height:
-                return True
-            return self.get_bool(x, y, 'block')
-	
-
-Drawing the map 
----------------
-
-Now we can just iterate over all map squares and draw appropriate tiles in the right places. This works fine for floor tiles and maybe some simple walls, but you might have noticed that we have a lot of different tiles for corners, straight walls, etc. You could of course use different characters for them in your map definition, but making them match manually is pretty boring and can be easily automated. Se we have a flag "wall" for our map squares, and when that flag is set we choose the right tile by looking at the neighboring squares. The code is not very pretty, but it does what we want. Oh, I forgot, we don't draw our map directly on the screen, we draw it on a separate "background" surface, and we only do it once per map. Then we can draw that surface on the screen, draw some more elements on top and still be able to erase those elements, by drawing parts from the background over them. We might also make the background larger than the screen and implement scrolling, although I won't cover that here.
-
-This is enough if we have a "flat" map, for example only different kinds of terrain. But there is a problem if we want walls. Walls should obscure the view and so we need to draw parts of them on top of anything we add to the map. We will do it by keeping a dict of all the elements that need to be drawn on top, called overlays. Our finished map-drawing code may look like this::
-
-    class Level(object): # Continued...
-
-        def is_wall(self, x, y):
-            return self.get_bool(x, y, 'wall')
-
-        def render(self):
-            wall = self.is_wall
-            tiles = MAP_CACHE[self.tileset]
-            image = pygame.Surface((self.width*MAP_TILE_WIDTH, self.height*MAP_TILE_HEIGHT))
-            overlays = {}
-            for map_y, line in enumerate(self.map):
-                for map_x, c in enumerate(line):
-                    if wall(map_x, map_y):
-                        # Draw different tiles depending on neighbourhood
-                        if not wall(map_x, map_y+1):
-                            if wall(map_x+1, map_y) and wall(map_x-1, map_y):
-                                tile = 1, 2
-                            elif wall(map_x+1, map_y):
-                                tile = 0, 2
-                            elif wall(map_x-1, map_y):
-                                tile = 2, 2
-                            else:
-                                tile = 3, 2
-                        else:
-                            if wall(map_x+1, map_y+1) and wall(map_x-1, map_y+1):
-                                tile = 1, 1
-                            elif wall(map_x+1, map_y+1):
-                                tile = 0, 1
-                            elif wall(map_x-1, map_y+1):
-                                tile = 2, 1
-                            else:
-                                tile = 3, 1
-                        # Add overlays if the wall may be obscuring something
-                        if not wall(map_x, map_y-1):
-                            if wall(map_x+1, map_y) and wall(map_x-1, map_y):
-                                over = 1, 0
-                            elif wall(map_x+1, map_y):
-                                over = 0, 0
-                            elif wall(map_x-1, map_y):
-                                over = 2, 0
-                            else:
-                                over = 3, 0
-                            overlays[(map_x, map_y)] = tiles[over[0]][over[1]]
-                    else:
-                        try:
-                            tile = self.key[c]['tile'].split(',')
-                            tile = int(tile[0]), int(tile[1])
-                        except (ValueError, KeyError):
-                            # Default to ground tile
-                            tile = 0, 3
-                    tile_image = tiles[tile[0]][tile[1]]
-                    image.blit(tile_image,
-                               (map_x*MAP_TILE_WIDTH, map_y*MAP_TILE_HEIGHT))
-            return image, overlays
-
-Then we can draw the background image on the screen, followed by all the movable objects and sprites, and then draw the overlays on top of them. We will keep them as a sprite group for convenience.
-