├── .gitignore ├── LICENSE ├── MANIFEST ├── README.rst ├── TODO.txt ├── Vagrantfile ├── docs ├── .nojekyll ├── Makefile ├── _config.yml ├── _images │ ├── 001_final_spygame_game.png │ ├── 001_final_spygame_game1.png │ ├── 002_file_new.png │ ├── 002_moving_layers_up_and_down.png │ ├── 003_erasing_the_staircase.png │ ├── 003_file_new_specifics.png │ ├── 004_creating_a_sloped_hill.png │ ├── 004_empty_level.png │ ├── 005_file_save_as.png │ ├── 005_selecting_a_range_of_tiles.png │ ├── 005a_renaming_a_layer.png │ ├── 006_erik_disappearing_nicely_in_the_foreground_sand_hill.png │ ├── 006_map_new_tileset.png │ ├── 007_selecting_tiles_that_make_up_trunk.png │ ├── 007_tileset_ready_png_image.png │ ├── 008_our_first_tileset.png │ ├── 008_re_adding_the_palm_to_the_background.png │ ├── 009_changing_single_tiles_properties.png │ ├── 009_erik_climbing_up_a_ladder.png │ ├── 010_adding_a_quicksand_trap.png │ ├── 010_adding_the_offset_property_to_a_tile.png │ ├── 011_custom_properties_for_a_tile.png │ ├── 011_erik_sinking_into_the_trap.png │ ├── 012_baleog_and_erik_together.png │ ├── 012_drawing_a_floor.png │ ├── 013_tileset_for_a_movable_rock.png │ ├── 013_walls_and_other_structures.png │ ├── 014_background_layer.png │ ├── 014_baleog_pushing_the_rock.png │ ├── 015_erik_blocking_baleog_from_pushing_the_rock.png │ ├── 015_properties_of_background.png │ ├── 016_baleog_pushing_the_rock_with_erik_on_top.png │ ├── 016_the_egpt_tileset.png │ ├── 017_erik_pushing_the_rock_uphill.png │ ├── 017_using_more_than_one_tile_at_a_time.png │ ├── 018_a_possible_background_setup.png │ ├── 018_poor_baleog_getting_squeezed_by_the_rock.png │ ├── 019_a_possible_foreground_setup.png │ ├── 019_placing_an_elevator.png │ ├── 020_new_object_layer.png │ ├── 020_the_elevators_properties.png │ ├── 021_baleog_jumping_onto_the_elevator.png │ ├── 021_setting_up_the_erik_tileset.png │ ├── 022_erik_and_baleog_standing_on_the_elevator.png │ ├── 022_placing_erik_into_the_level.png │ ├── 023_placing_the_repeater_as_arbitrary_tile_in_the_level.png │ ├── 023_setting_eriks_constructor.png │ ├── 023a_exporting_eriks_tileset_as_tsx.png │ ├── 024_adding_keyboard_input_definitions.png │ ├── 024_repeater_properties.png │ ├── 025_defining_keyboard_input_definitions.png │ ├── 025_the_repeater_in_action_in_the_game.png │ ├── 026_erik_jumping_around_in_the_level.png │ ├── 026_the_two_firespitter_tiles.png │ ├── 027_the_custom_property_of_the_left_firespitter.png │ ├── 028_painting_a_firespitter_into_the_level.png │ ├── 029_erik_in_pain.png │ ├── index_001_screenshot.png │ ├── intro_001_level_tmx_file.png │ ├── intro_002_spygame_physics_component.png │ ├── intro_003_example_spygame_level.png │ ├── intro_004_openailogo.png │ ├── intro_004_pytorchlogo.png │ └── intro_004_tensorlogo.png ├── _modules │ ├── index.html │ ├── spygame.html │ └── spygame │ │ └── examples │ │ └── vikings.html ├── _sources │ ├── adding_more_things_to_our_platformer.rst.txt │ ├── blizzard_copyright_disclaimer.rst.txt │ ├── how_to_build_a_platformer_with_spygame.rst.txt │ ├── how_to_code_against_spygame.rst.txt │ ├── index.rst.txt │ ├── intro.rst.txt │ ├── readme_link.rst.txt │ └── spygame_reference.rst.txt ├── _static │ ├── ajax-loader.gif │ ├── basic.css │ ├── comment-bright.png │ ├── comment-close.png │ ├── comment.png │ ├── contents.png │ ├── doctools.js │ ├── down-pressed.png │ ├── down.png │ ├── file.png │ ├── jquery-3.1.0.js │ ├── jquery.js │ ├── minus.png │ ├── navigation.png │ ├── plus.png │ ├── pygments.css │ ├── searchtools.js │ ├── sphinxdoc.css │ ├── spygame_sphinx.css │ ├── underscore-1.3.1.js │ ├── underscore.js │ ├── up-pressed.png │ ├── up.png │ └── websupport.js ├── adding_more_things_to_our_platformer.html ├── adding_more_things_to_our_platformer.rst ├── blizzard_copyright_disclaimer.html ├── blizzard_copyright_disclaimer.rst ├── conf.py ├── doctrees │ ├── environment.pickle │ ├── index.doctree │ ├── modules.doctree │ └── spygame.doctree ├── genindex.html ├── how_to_build_a_platformer_with_spygame.html ├── how_to_build_a_platformer_with_spygame.rst ├── how_to_code_against_spygame.html ├── how_to_code_against_spygame.rst ├── images │ ├── index_001_screenshot.png │ ├── intro_001_level_tmx_file.png │ ├── intro_002_spygame_physics_component.png │ ├── intro_003_example_spygame_level.png │ ├── intro_004_openailogo.png │ ├── intro_004_pytorchlogo.png │ ├── intro_004_tensorlogo.png │ ├── tmx_egpt_level.png │ └── tmx_egpt_level_02.png ├── index.html ├── index.rst ├── intro.html ├── intro.rst ├── make.bat ├── objects.inv ├── py-modindex.html ├── readme_link.html ├── readme_link.rst ├── search.html ├── searchindex.js ├── slope_collision_solution_diagrams.pptx ├── spygame_reference.html ├── spygame_reference.rst ├── spygame_sphinx.css └── tutorial │ ├── 001_final_spygame_game.png │ ├── 002_file_new.png │ ├── 003_file_new_specifics.png │ ├── 004_empty_level.png │ ├── 005_file_save_as.png │ ├── 005a_renaming_a_layer.png │ ├── 006_map_new_tileset.png │ ├── 007_tileset_ready_png_image.png │ ├── 008_our_first_tileset.png │ ├── 009_changing_single_tiles_properties.png │ ├── 010_adding_the_offset_property_to_a_tile.png │ ├── 011_custom_properties_for_a_tile.png │ ├── 012_drawing_a_floor.png │ ├── 013_walls_and_other_structures.png │ ├── 014_background_layer.png │ ├── 015_properties_of_background.png │ ├── 016_the_egpt_tileset.png │ ├── 017_using_more_than_one_tile_at_a_time.png │ ├── 018_a_possible_background_setup.png │ ├── 019_a_possible_foreground_setup.png │ ├── 020_new_object_layer.png │ ├── 021_setting_up_the_erik_tileset.png │ ├── 022_placing_erik_into_the_level.png │ ├── 023_setting_eriks_constructor.png │ ├── 023a_exporting_eriks_tileset_as_tsx.png │ ├── 024_adding_keyboard_input_definitions.png │ ├── 025_defining_keyboard_input_definitions.png │ ├── 026_erik_jumping_around_in_the_level.png │ └── advanced │ ├── 001_final_spygame_game.png │ ├── 002_moving_layers_up_and_down.png │ ├── 003_erasing_the_staircase.png │ ├── 004_creating_a_sloped_hill.png │ ├── 005_selecting_a_range_of_tiles.png │ ├── 006_erik_disappearing_nicely_in_the_foreground_sand_hill.png │ ├── 007_selecting_tiles_that_make_up_trunk.png │ ├── 008_re_adding_the_palm_to_the_background.png │ ├── 009_erik_climbing_up_a_ladder.png │ ├── 010_adding_a_quicksand_trap.png │ ├── 011_erik_sinking_into_the_trap.png │ ├── 012_baleog_and_erik_together.png │ ├── 013_tileset_for_a_movable_rock.png │ ├── 014_baleog_pushing_the_rock.png │ ├── 015_erik_blocking_baleog_from_pushing_the_rock.png │ ├── 016_baleog_pushing_the_rock_with_erik_on_top.png │ ├── 017_erik_pushing_the_rock_uphill.png │ ├── 018_poor_baleog_getting_squeezed_by_the_rock.png │ ├── 019_placing_an_elevator.png │ ├── 020_the_elevators_properties.png │ ├── 021_baleog_jumping_onto_the_elevator.png │ ├── 022_erik_and_baleog_standing_on_the_elevator.png │ ├── 023_placing_the_repeater_as_arbitrary_tile_in_the_level.png │ ├── 024_repeater_properties.png │ ├── 025_the_repeater_in_action_in_the_game.png │ ├── 026_the_two_firespitter_tiles.png │ ├── 027_the_custom_property_of_the_left_firespitter.png │ ├── 028_painting_a_firespitter_into_the_level.png │ └── 029_erik_in_pain.png ├── examples ├── maze_runner │ ├── __init__.py │ ├── data │ │ ├── erik.tsx │ │ ├── generic.tsx │ │ ├── maze.tmx │ │ └── wrbc.tsx │ ├── images │ │ ├── erik.png │ │ ├── generic.png │ │ └── wrbc.png │ ├── maze_runner.py │ └── screen1.png ├── platformer_2d │ ├── data │ │ ├── baleog.tsx │ │ ├── coconut.tsx │ │ ├── egpt.tmx │ │ ├── egpt.tsx │ │ ├── elevator.tsx │ │ ├── enemies.tsx │ │ ├── erik.tsx │ │ ├── generic.tsx │ │ ├── llm0.tmx │ │ ├── llm0.tsx │ │ ├── lv_jlly.tsx │ │ ├── movable_rock.tsx │ │ ├── obsolete_arrow.tsx │ │ ├── olaf.tsx │ │ ├── scorpion.tsx │ │ ├── scorpion_shot.tsx │ │ ├── scorpionshot.tsx │ │ ├── slope_test.tmx │ │ ├── strt.tmx │ │ ├── test_aibrain.tmx │ │ ├── wrbc.tmx │ │ └── wrbc.tsx │ ├── images │ │ ├── arrow.png │ │ ├── baleog.png │ │ ├── coconut.png │ │ ├── debug.png │ │ ├── egpt.png │ │ ├── elevator.png │ │ ├── enemies.png │ │ ├── erik.png │ │ ├── generic.png │ │ ├── llm0.png │ │ ├── movable_rock.png │ │ ├── olaf.png │ │ ├── scorpion.png │ │ ├── scorpion_shot.png │ │ ├── tlv_items.png │ │ ├── tlv_level1_tileset.png │ │ ├── tlv_map01.png │ │ ├── world1.png │ │ ├── world2.png │ │ ├── world3.png │ │ └── wrbc.png │ ├── platformer_2d.py │ ├── raw │ │ ├── baleog.xcf │ │ ├── coconut.xcf │ │ ├── egpt.xcf │ │ ├── enemies.xcf │ │ ├── erik.xcf │ │ ├── llm0.xcf │ │ ├── olaf.xcf │ │ ├── rainforest1.jpg │ │ └── world1.xcf │ ├── screen1.png │ ├── screen2.png │ └── screen3_tiled.png ├── tutorial │ ├── data │ │ ├── erik.tsx │ │ └── tutorial.tmx │ ├── images │ │ ├── baleog.png │ │ ├── egpt.png │ │ ├── elevator.png │ │ ├── enemies.png │ │ ├── erik.png │ │ ├── generic.png │ │ ├── movable_rock.png │ │ ├── olaf.png │ │ └── world3.png │ └── tutorial.py └── tutorial_advanced │ ├── data │ ├── baleog.tsx │ ├── egpt.tsx │ ├── enemies.tsx │ ├── erik.tsx │ ├── tutorial.tmx │ └── tutorial.tmx.ni7520 │ ├── images │ ├── baleog.png │ ├── egpt.png │ ├── elevator.png │ ├── enemies.png │ ├── erik.png │ ├── generic.png │ ├── movable_rock.png │ ├── olaf.png │ └── world3.png │ └── tutorial.py ├── requirements.txt ├── setup.py └── spygame ├── __init__.py └── examples ├── __init__.py └── vikings.py /.gitignore: -------------------------------------------------------------------------------- 1 | # pycharm project 2 | .idea/ 3 | 4 | # Byte-compiled / optimized / DLL files 5 | __pycache__/ 6 | *.py[cod] 7 | *$py.class 8 | 9 | # C extensions 10 | *.so 11 | 12 | # Distribution / packaging 13 | .Python 14 | env/ 15 | build/ 16 | develop-eggs/ 17 | dist/ 18 | downloads/ 19 | eggs/ 20 | .eggs/ 21 | lib/ 22 | lib64/ 23 | parts/ 24 | sdist/ 25 | var/ 26 | wheels/ 27 | *.egg-info/ 28 | .installed.cfg 29 | *.egg 30 | 31 | # PyInstaller 32 | # Usually these files are written by a python script from a template 33 | # before PyInstaller builds the exe, so as to inject date/other infos into it. 34 | *.manifest 35 | *.spec 36 | 37 | # Installer logs 38 | pip-log.txt 39 | pip-delete-this-directory.txt 40 | 41 | # Unit test / coverage reports 42 | htmlcov/ 43 | .tox/ 44 | .coverage 45 | .coverage.* 46 | .cache 47 | nosetests.xml 48 | coverage.xml 49 | *.cover 50 | .hypothesis/ 51 | 52 | # Translations 53 | *.mo 54 | *.pot 55 | 56 | # Django stuff: 57 | *.log 58 | local_settings.py 59 | 60 | # Flask stuff: 61 | instance/ 62 | .webassets-cache 63 | 64 | # Scrapy stuff: 65 | .scrapy 66 | 67 | # PyBuilder 68 | target/ 69 | 70 | # Jupyter Notebook 71 | .ipynb_checkpoints 72 | 73 | # pyenv 74 | .python-version 75 | 76 | # celery beat schedule file 77 | celerybeat-schedule 78 | 79 | # SageMath parsed files 80 | *.sage.py 81 | 82 | # dotenv 83 | .env 84 | 85 | # virtualenv 86 | .venv 87 | venv/ 88 | ENV/ 89 | 90 | # Spyder project settings 91 | .spyderproject 92 | .spyproject 93 | 94 | # Rope project settings 95 | .ropeproject 96 | 97 | # mkdocs documentation 98 | /site 99 | 100 | # mypy 101 | .mypy_cache/ 102 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2017 Sven Mika, ducandu GmbH 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software", EXCEPT(!) the 7 | images in the examples/ directory, which are in part taken from the Game: 8 | The Lost Vikings ((c) Blizzard Entertainment Inc.)), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in all 15 | copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | SOFTWARE. 24 | -------------------------------------------------------------------------------- /MANIFEST: -------------------------------------------------------------------------------- 1 | # file GENERATED by distutils, do NOT edit 2 | setup.py 3 | spygame\__init__.py 4 | spygame\examples\vikings.py -------------------------------------------------------------------------------- /README.rst: -------------------------------------------------------------------------------- 1 | spygame - Quick Setup Instructions 2 | ================================== 3 | 4 | .. figure:: https://raw.githubusercontent.com/sven1977/spygame/master/examples/platformer_2d/screen2.png 5 | :alt: The Lost Vikings - Sample spygame Level 6 | 7 | The Lost Vikings - Sample spygame Level - *All graphics are (c) Blizzard Entertainment Inc (The Lost Vikings)* 8 | 9 | 10 | **IMPORTANT NOTE:** *All graphics used in this documentation and in the spygame.examples.vikings package of the spygame library were taken from the game 11 | "The Lost Vikings" (c) 1992 by Blizzard Entertainment Inc. (formerly known as Silicon and Synapse). Please use these images (in your own projects and repos) 12 | for demonstration purposes only and then also mention this copyright statement!* 13 | 14 | 15 | Get the code 16 | ------------ 17 | - You may need a pygame version that matches your python version. E.g. for Windows 10 64bit + python3.6, you can download `pygame‑1.9.3‑cp36‑cp36m‑win_amd64.whl from here `_ and then do a ``pip install [path to downloaded wheel]`` 18 | - Git the `spygame `_ code or do a ``pip install spygame`` 19 | 20 | Get started 21 | ----------- 22 | - write a simple game against the engine: 23 | 24 | .. code:: python 25 | 26 | import spygame as spyg 27 | 28 | 29 | class MyAgent(spyg.Sprite): 30 | def __init__(self, x, y): 31 | super().__init__(x, y, sprite_sheet=spyg.SpriteSheet("data/erik.tsx"), tile=0) 32 | 33 | # some custom settings 34 | self.handles_own_collisions = True # our agent handles its own collisions (instead of letting the Stage do it for us) 35 | # add a HumanPlayerBrain for keyboard input handling 36 | self.cmp_brain = self.add_component(spyg.SimpleHumanBrain("brain", ["up", "down", "left", "right"])) 37 | # add a physics component to physics handling (here we use: simple 2D top-down view and controls) 38 | self.cmp_physics = self.add_component(spyg.TopDownPhysics("physics")) 39 | 40 | # plain spyg.Sprite objects do not implement the `tick` function, so nothing ever happens with them 41 | # - we need to implement it here to make sure our components (brain and physics) are ticked as well 42 | def tick(self, game_loop): 43 | self.cmp_brain.tick(game_loop) 44 | self.cmp_physics.tick(game_loop) 45 | 46 | 47 | if __name__ == "__main__": 48 | # create a spyg.Game object 49 | game = spyg.Game(screens_and_levels=[ 50 | # the only level 51 | { 52 | "id": 1, "class": spyg.Level, "name": "MAZE", # <- this will read the data/maze.tmx file for the level's layout and setup data 53 | }, 54 | 55 | # add more of your levels here 56 | # { ... }, 57 | 58 | ], title="The Maze Runner - An A-maze-ing Game :)") 59 | 60 | # that's it, play one of the levels -> this will enter an endless game loop 61 | game.levels_by_name["MAZE"].play() 62 | 63 | 64 | All you need in order to run this game is the above code in a directory, and the additional subdirectories data/ and images/, which can 65 | be found `here `_. These directories contain the necessary SpriteSheets, 66 | level background images and level setup (collision layers, background images, position and class of the player, etc..). 67 | 68 | This should give you a level like this: 69 | 70 | .. figure:: https://raw.githubusercontent.com/sven1977/spygame/master/examples/maze_runner/screen1.png 71 | :alt: The Maze Runner - An A-maze-ing Game :) 72 | 73 | The Maze Runner - An A-maze-ing Game :) - *All graphics are (c) Blizzard Entertainment Inc (The Lost Vikings)* 74 | 75 | You can now control the Agent via the four arrow keys (up, down, left, right). 76 | 77 | Next steps and Full Documentation 78 | --------------------------------- 79 | 80 | If you would like to create more complex levels (or entire Games with many Screens and Levels), read the 81 | `spygame documentation `_, in which we'll create a full-blown 2D platformer Level 82 | (sorry about spygame's documentation still being work in progress). 83 | 84 | 85 | AI (Reinforcement Learning) with spygame 86 | ---------------------------------------- 87 | 88 | I'm currently working on making spygame available as an openAI-gym Environment type, so that reinforcement learning algorithms can run against any spygame 89 | Level objects. 90 | 91 | 92 | Contribute to spygame 93 | --------------------- 94 | If you would like to contribute to the spygame library, the following items are currently open: 95 | 96 | - add audio/sound support 97 | - create more example games 98 | - create more "Lost Vikings" levels 99 | - create more physics components (apart from the existing top-down and platformer) 100 | - create support for GUI elements (label, buttons, tick-boxes, etc..). This is an open Pygame problem and should probably be solved on the Pygame level. 101 | - help out with integrating spygame into openAI-gym and openAI-rllab repos 102 | 103 | .. figure:: https://raw.githubusercontent.com/sven1977/spygame/master/examples/platformer_2d/screen1.png 104 | :alt: Lost Vikings - Sample spygame Level 105 | 106 | Lost Vikings - Sample spygame Level - *All graphics are (c) Blizzard Entertainment Inc (The Lost Vikings)* 107 | 108 | 109 | -------------------------------------------------------------------------------- /TODO.txt: -------------------------------------------------------------------------------- 1 | - make Animation setting not dependent on SpriteSheet's name (some SpriteSheets contain many Anim settings , e.g. enemies.tsx) 2 | - include water, quicksand, waterfall, etc.. in the ladder-processing algo run on the background layer (if build_ladders=true) 3 | - create shootable coconuts that end up in the quicksand for Baleog to be able to cross 4 | - create key items that can be picked up by the Vikings -------------------------------------------------------------------------------- /Vagrantfile: -------------------------------------------------------------------------------- 1 | # -*- mode: ruby -*- 2 | # vi: set ft=ruby : 3 | 4 | # All Vagrant configuration is done below. The "2" in Vagrant.configure 5 | # configures the configuration version (we support older styles for 6 | # backwards compatibility). Please don't change it unless you know what 7 | # you're doing. 8 | Vagrant.configure("2") do |config| 9 | # The most common configuration options are documented and commented below. 10 | # For a complete reference, please see the online documentation at 11 | # https://docs.vagrantup.com. 12 | 13 | # Every Vagrant development environment requires a box. You can search for 14 | # boxes at https://atlas.hashicorp.com/search. 15 | config.vm.box = "ubuntu/xenial64" 16 | 17 | # Disable automatic box update checking. If you disable this, then 18 | # boxes will only be checked for updates when the user runs 19 | # `vagrant box outdated`. This is not recommended. 20 | # config.vm.box_check_update = false 21 | 22 | # Create a forwarded port mapping which allows access to a specific port 23 | # within the machine from a port on the host machine. In the example below, 24 | # accessing "localhost:8080" will access port 80 on the guest machine. 25 | # NOTE: This will enable public access to the opened port 26 | # config.vm.network "forwarded_port", guest: 80, host: 8080 27 | 28 | # Create a forwarded port mapping which allows access to a specific port 29 | # within the machine from a port on the host machine and only allow access 30 | # via 127.0.0.1 to disable public access 31 | # config.vm.network "forwarded_port", guest: 80, host: 8080, host_ip: "127.0.0.1" 32 | 33 | # Create a private network, which allows host-only access to the machine 34 | # using a specific IP. 35 | # config.vm.network "private_network", ip: "192.168.33.10" 36 | 37 | # Create a public network, which generally matched to bridged network. 38 | # Bridged networks make the machine appear as another physical device on 39 | # your network. 40 | # config.vm.network "public_network" 41 | 42 | # Share an additional folder to the guest VM. The first argument is 43 | # the path on the host to the actual folder. The second argument is 44 | # the path on the guest to mount the folder. And the optional third 45 | # argument is a set of non-required options. 46 | # config.vm.synced_folder "../data", "/vagrant_data" 47 | 48 | # Provider-specific configuration so you can fine-tune various 49 | # backing providers for Vagrant. These expose provider-specific options. 50 | # Example for VirtualBox: 51 | # 52 | # config.vm.provider "virtualbox" do |vb| 53 | # # Display the VirtualBox GUI when booting the machine 54 | # vb.gui = true 55 | # 56 | # # Customize the amount of memory on the VM: 57 | # vb.memory = "1024" 58 | # end 59 | # 60 | # View the documentation for the provider you are using for more 61 | # information on available options. 62 | 63 | # Define a Vagrant Push strategy for pushing to Atlas. Other push strategies 64 | # such as FTP and Heroku are also available. See the documentation at 65 | # https://docs.vagrantup.com/v2/push/atlas.html for more information. 66 | # config.push.define "atlas" do |push| 67 | # push.app = "YOUR_ATLAS_USERNAME/YOUR_APPLICATION_NAME" 68 | # end 69 | 70 | # Enable provisioning with a shell script. Additional provisioners such as 71 | # Puppet, Chef, Ansible, Salt, and Docker are also available. Please see the 72 | # documentation for more information about their specific syntax and use. 73 | # config.vm.provision "shell", inline: <<-SHELL 74 | # apt-get update 75 | # apt-get install -y apache2 76 | # SHELL 77 | end 78 | -------------------------------------------------------------------------------- /docs/.nojekyll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ducandu/spygame/5caac137e718cae24788784ec5558270e7613801/docs/.nojekyll -------------------------------------------------------------------------------- /docs/Makefile: -------------------------------------------------------------------------------- 1 | # Minimal makefile for Sphinx documentation 2 | # 3 | 4 | # You can set these variables from the command line. 5 | SPHINXOPTS = 6 | SPHINXBUILD = python -msphinx 7 | SPHINXPROJ = spygame 8 | SOURCEDIR = . 9 | BUILDDIR = .. 10 | 11 | # Put it first so that "make" without argument is like "make help". 12 | help: 13 | @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) 14 | 15 | .PHONY: help Makefile 16 | 17 | # Catch-all target: route all unknown targets to Sphinx using the new 18 | # "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). 19 | %: Makefile 20 | @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $ -------------------------------------------------------------------------------- /docs/_config.yml: -------------------------------------------------------------------------------- 1 | theme: jekyll-theme-leap-day -------------------------------------------------------------------------------- /docs/_images/001_final_spygame_game.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ducandu/spygame/5caac137e718cae24788784ec5558270e7613801/docs/_images/001_final_spygame_game.png -------------------------------------------------------------------------------- /docs/_images/001_final_spygame_game1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ducandu/spygame/5caac137e718cae24788784ec5558270e7613801/docs/_images/001_final_spygame_game1.png -------------------------------------------------------------------------------- /docs/_images/002_file_new.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ducandu/spygame/5caac137e718cae24788784ec5558270e7613801/docs/_images/002_file_new.png -------------------------------------------------------------------------------- /docs/_images/002_moving_layers_up_and_down.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ducandu/spygame/5caac137e718cae24788784ec5558270e7613801/docs/_images/002_moving_layers_up_and_down.png -------------------------------------------------------------------------------- /docs/_images/003_erasing_the_staircase.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ducandu/spygame/5caac137e718cae24788784ec5558270e7613801/docs/_images/003_erasing_the_staircase.png -------------------------------------------------------------------------------- /docs/_images/003_file_new_specifics.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ducandu/spygame/5caac137e718cae24788784ec5558270e7613801/docs/_images/003_file_new_specifics.png -------------------------------------------------------------------------------- /docs/_images/004_creating_a_sloped_hill.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ducandu/spygame/5caac137e718cae24788784ec5558270e7613801/docs/_images/004_creating_a_sloped_hill.png -------------------------------------------------------------------------------- /docs/_images/004_empty_level.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ducandu/spygame/5caac137e718cae24788784ec5558270e7613801/docs/_images/004_empty_level.png -------------------------------------------------------------------------------- /docs/_images/005_file_save_as.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ducandu/spygame/5caac137e718cae24788784ec5558270e7613801/docs/_images/005_file_save_as.png -------------------------------------------------------------------------------- /docs/_images/005_selecting_a_range_of_tiles.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ducandu/spygame/5caac137e718cae24788784ec5558270e7613801/docs/_images/005_selecting_a_range_of_tiles.png -------------------------------------------------------------------------------- /docs/_images/005a_renaming_a_layer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ducandu/spygame/5caac137e718cae24788784ec5558270e7613801/docs/_images/005a_renaming_a_layer.png -------------------------------------------------------------------------------- /docs/_images/006_erik_disappearing_nicely_in_the_foreground_sand_hill.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ducandu/spygame/5caac137e718cae24788784ec5558270e7613801/docs/_images/006_erik_disappearing_nicely_in_the_foreground_sand_hill.png -------------------------------------------------------------------------------- /docs/_images/006_map_new_tileset.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ducandu/spygame/5caac137e718cae24788784ec5558270e7613801/docs/_images/006_map_new_tileset.png -------------------------------------------------------------------------------- /docs/_images/007_selecting_tiles_that_make_up_trunk.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ducandu/spygame/5caac137e718cae24788784ec5558270e7613801/docs/_images/007_selecting_tiles_that_make_up_trunk.png -------------------------------------------------------------------------------- /docs/_images/007_tileset_ready_png_image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ducandu/spygame/5caac137e718cae24788784ec5558270e7613801/docs/_images/007_tileset_ready_png_image.png -------------------------------------------------------------------------------- /docs/_images/008_our_first_tileset.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ducandu/spygame/5caac137e718cae24788784ec5558270e7613801/docs/_images/008_our_first_tileset.png -------------------------------------------------------------------------------- /docs/_images/008_re_adding_the_palm_to_the_background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ducandu/spygame/5caac137e718cae24788784ec5558270e7613801/docs/_images/008_re_adding_the_palm_to_the_background.png -------------------------------------------------------------------------------- /docs/_images/009_changing_single_tiles_properties.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ducandu/spygame/5caac137e718cae24788784ec5558270e7613801/docs/_images/009_changing_single_tiles_properties.png -------------------------------------------------------------------------------- /docs/_images/009_erik_climbing_up_a_ladder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ducandu/spygame/5caac137e718cae24788784ec5558270e7613801/docs/_images/009_erik_climbing_up_a_ladder.png -------------------------------------------------------------------------------- /docs/_images/010_adding_a_quicksand_trap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ducandu/spygame/5caac137e718cae24788784ec5558270e7613801/docs/_images/010_adding_a_quicksand_trap.png -------------------------------------------------------------------------------- /docs/_images/010_adding_the_offset_property_to_a_tile.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ducandu/spygame/5caac137e718cae24788784ec5558270e7613801/docs/_images/010_adding_the_offset_property_to_a_tile.png -------------------------------------------------------------------------------- /docs/_images/011_custom_properties_for_a_tile.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ducandu/spygame/5caac137e718cae24788784ec5558270e7613801/docs/_images/011_custom_properties_for_a_tile.png -------------------------------------------------------------------------------- /docs/_images/011_erik_sinking_into_the_trap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ducandu/spygame/5caac137e718cae24788784ec5558270e7613801/docs/_images/011_erik_sinking_into_the_trap.png -------------------------------------------------------------------------------- /docs/_images/012_baleog_and_erik_together.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ducandu/spygame/5caac137e718cae24788784ec5558270e7613801/docs/_images/012_baleog_and_erik_together.png -------------------------------------------------------------------------------- /docs/_images/012_drawing_a_floor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ducandu/spygame/5caac137e718cae24788784ec5558270e7613801/docs/_images/012_drawing_a_floor.png -------------------------------------------------------------------------------- /docs/_images/013_tileset_for_a_movable_rock.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ducandu/spygame/5caac137e718cae24788784ec5558270e7613801/docs/_images/013_tileset_for_a_movable_rock.png -------------------------------------------------------------------------------- /docs/_images/013_walls_and_other_structures.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ducandu/spygame/5caac137e718cae24788784ec5558270e7613801/docs/_images/013_walls_and_other_structures.png -------------------------------------------------------------------------------- /docs/_images/014_background_layer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ducandu/spygame/5caac137e718cae24788784ec5558270e7613801/docs/_images/014_background_layer.png -------------------------------------------------------------------------------- /docs/_images/014_baleog_pushing_the_rock.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ducandu/spygame/5caac137e718cae24788784ec5558270e7613801/docs/_images/014_baleog_pushing_the_rock.png -------------------------------------------------------------------------------- /docs/_images/015_erik_blocking_baleog_from_pushing_the_rock.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ducandu/spygame/5caac137e718cae24788784ec5558270e7613801/docs/_images/015_erik_blocking_baleog_from_pushing_the_rock.png -------------------------------------------------------------------------------- /docs/_images/015_properties_of_background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ducandu/spygame/5caac137e718cae24788784ec5558270e7613801/docs/_images/015_properties_of_background.png -------------------------------------------------------------------------------- /docs/_images/016_baleog_pushing_the_rock_with_erik_on_top.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ducandu/spygame/5caac137e718cae24788784ec5558270e7613801/docs/_images/016_baleog_pushing_the_rock_with_erik_on_top.png -------------------------------------------------------------------------------- /docs/_images/016_the_egpt_tileset.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ducandu/spygame/5caac137e718cae24788784ec5558270e7613801/docs/_images/016_the_egpt_tileset.png -------------------------------------------------------------------------------- /docs/_images/017_erik_pushing_the_rock_uphill.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ducandu/spygame/5caac137e718cae24788784ec5558270e7613801/docs/_images/017_erik_pushing_the_rock_uphill.png -------------------------------------------------------------------------------- /docs/_images/017_using_more_than_one_tile_at_a_time.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ducandu/spygame/5caac137e718cae24788784ec5558270e7613801/docs/_images/017_using_more_than_one_tile_at_a_time.png -------------------------------------------------------------------------------- /docs/_images/018_a_possible_background_setup.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ducandu/spygame/5caac137e718cae24788784ec5558270e7613801/docs/_images/018_a_possible_background_setup.png -------------------------------------------------------------------------------- /docs/_images/018_poor_baleog_getting_squeezed_by_the_rock.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ducandu/spygame/5caac137e718cae24788784ec5558270e7613801/docs/_images/018_poor_baleog_getting_squeezed_by_the_rock.png -------------------------------------------------------------------------------- /docs/_images/019_a_possible_foreground_setup.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ducandu/spygame/5caac137e718cae24788784ec5558270e7613801/docs/_images/019_a_possible_foreground_setup.png -------------------------------------------------------------------------------- /docs/_images/019_placing_an_elevator.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ducandu/spygame/5caac137e718cae24788784ec5558270e7613801/docs/_images/019_placing_an_elevator.png -------------------------------------------------------------------------------- /docs/_images/020_new_object_layer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ducandu/spygame/5caac137e718cae24788784ec5558270e7613801/docs/_images/020_new_object_layer.png -------------------------------------------------------------------------------- /docs/_images/020_the_elevators_properties.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ducandu/spygame/5caac137e718cae24788784ec5558270e7613801/docs/_images/020_the_elevators_properties.png -------------------------------------------------------------------------------- /docs/_images/021_baleog_jumping_onto_the_elevator.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ducandu/spygame/5caac137e718cae24788784ec5558270e7613801/docs/_images/021_baleog_jumping_onto_the_elevator.png -------------------------------------------------------------------------------- /docs/_images/021_setting_up_the_erik_tileset.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ducandu/spygame/5caac137e718cae24788784ec5558270e7613801/docs/_images/021_setting_up_the_erik_tileset.png -------------------------------------------------------------------------------- /docs/_images/022_erik_and_baleog_standing_on_the_elevator.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ducandu/spygame/5caac137e718cae24788784ec5558270e7613801/docs/_images/022_erik_and_baleog_standing_on_the_elevator.png -------------------------------------------------------------------------------- /docs/_images/022_placing_erik_into_the_level.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ducandu/spygame/5caac137e718cae24788784ec5558270e7613801/docs/_images/022_placing_erik_into_the_level.png -------------------------------------------------------------------------------- /docs/_images/023_placing_the_repeater_as_arbitrary_tile_in_the_level.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ducandu/spygame/5caac137e718cae24788784ec5558270e7613801/docs/_images/023_placing_the_repeater_as_arbitrary_tile_in_the_level.png -------------------------------------------------------------------------------- /docs/_images/023_setting_eriks_constructor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ducandu/spygame/5caac137e718cae24788784ec5558270e7613801/docs/_images/023_setting_eriks_constructor.png -------------------------------------------------------------------------------- /docs/_images/023a_exporting_eriks_tileset_as_tsx.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ducandu/spygame/5caac137e718cae24788784ec5558270e7613801/docs/_images/023a_exporting_eriks_tileset_as_tsx.png -------------------------------------------------------------------------------- /docs/_images/024_adding_keyboard_input_definitions.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ducandu/spygame/5caac137e718cae24788784ec5558270e7613801/docs/_images/024_adding_keyboard_input_definitions.png -------------------------------------------------------------------------------- /docs/_images/024_repeater_properties.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ducandu/spygame/5caac137e718cae24788784ec5558270e7613801/docs/_images/024_repeater_properties.png -------------------------------------------------------------------------------- /docs/_images/025_defining_keyboard_input_definitions.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ducandu/spygame/5caac137e718cae24788784ec5558270e7613801/docs/_images/025_defining_keyboard_input_definitions.png -------------------------------------------------------------------------------- /docs/_images/025_the_repeater_in_action_in_the_game.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ducandu/spygame/5caac137e718cae24788784ec5558270e7613801/docs/_images/025_the_repeater_in_action_in_the_game.png -------------------------------------------------------------------------------- /docs/_images/026_erik_jumping_around_in_the_level.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ducandu/spygame/5caac137e718cae24788784ec5558270e7613801/docs/_images/026_erik_jumping_around_in_the_level.png -------------------------------------------------------------------------------- /docs/_images/026_the_two_firespitter_tiles.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ducandu/spygame/5caac137e718cae24788784ec5558270e7613801/docs/_images/026_the_two_firespitter_tiles.png -------------------------------------------------------------------------------- /docs/_images/027_the_custom_property_of_the_left_firespitter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ducandu/spygame/5caac137e718cae24788784ec5558270e7613801/docs/_images/027_the_custom_property_of_the_left_firespitter.png -------------------------------------------------------------------------------- /docs/_images/028_painting_a_firespitter_into_the_level.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ducandu/spygame/5caac137e718cae24788784ec5558270e7613801/docs/_images/028_painting_a_firespitter_into_the_level.png -------------------------------------------------------------------------------- /docs/_images/029_erik_in_pain.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ducandu/spygame/5caac137e718cae24788784ec5558270e7613801/docs/_images/029_erik_in_pain.png -------------------------------------------------------------------------------- /docs/_images/index_001_screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ducandu/spygame/5caac137e718cae24788784ec5558270e7613801/docs/_images/index_001_screenshot.png -------------------------------------------------------------------------------- /docs/_images/intro_001_level_tmx_file.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ducandu/spygame/5caac137e718cae24788784ec5558270e7613801/docs/_images/intro_001_level_tmx_file.png -------------------------------------------------------------------------------- /docs/_images/intro_002_spygame_physics_component.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ducandu/spygame/5caac137e718cae24788784ec5558270e7613801/docs/_images/intro_002_spygame_physics_component.png -------------------------------------------------------------------------------- /docs/_images/intro_003_example_spygame_level.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ducandu/spygame/5caac137e718cae24788784ec5558270e7613801/docs/_images/intro_003_example_spygame_level.png -------------------------------------------------------------------------------- /docs/_images/intro_004_openailogo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ducandu/spygame/5caac137e718cae24788784ec5558270e7613801/docs/_images/intro_004_openailogo.png -------------------------------------------------------------------------------- /docs/_images/intro_004_pytorchlogo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ducandu/spygame/5caac137e718cae24788784ec5558270e7613801/docs/_images/intro_004_pytorchlogo.png -------------------------------------------------------------------------------- /docs/_images/intro_004_tensorlogo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ducandu/spygame/5caac137e718cae24788784ec5558270e7613801/docs/_images/intro_004_tensorlogo.png -------------------------------------------------------------------------------- /docs/_modules/index.html: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | Overview: module code — spygame 0.1a9 documentation 10 | 11 | 12 | 13 | 14 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 44 | 58 | 59 |
60 |
61 |
62 |
63 | 64 |

All modules for which code is available

65 | 68 | 69 |
70 |
71 |
72 |
73 |
74 | 86 | 90 | 91 | -------------------------------------------------------------------------------- /docs/_sources/blizzard_copyright_disclaimer.rst.txt: -------------------------------------------------------------------------------- 1 | **IMPORTANT NOTE:** *All graphics used in this documentation and in the spygame.examples.vikings package of the spygame library were taken from the game 2 | "The Lost Vikings" (c) 1992 by Blizzard Entertainment Inc. (formerly known as Silicon and Synapse). Please use these images (in your own projects and repos) 3 | for demonstration purposes only and then also mention this copyright statement!* 4 | -------------------------------------------------------------------------------- /docs/_sources/how_to_code_against_spygame.rst.txt: -------------------------------------------------------------------------------- 1 | How to code against spygame 2 | =========================== 3 | 4 | In this tutorial, we will be exploring the spygame code and learn how to write our own custom classes for spygame. 5 | 6 | [WIP] 7 | -------------------------------------------------------------------------------- /docs/_sources/index.rst.txt: -------------------------------------------------------------------------------- 1 | .. spygame documentation master file, created by 2 | sphinx-quickstart on Thu Jun 15 19:39:47 2017. 3 | You can adapt this file completely to your liking, but it should at least 4 | contain the root `toctree` directive. 5 | 6 | Welcome to spygame's documentation! 7 | =================================== 8 | 9 | spygame is a python 2D game engine based on pygame and level-tmx files 10 | ---------------------------------------------------------------------- 11 | 12 | | 13 | 14 | .. image:: images/index_001_screenshot.png 15 | :alt: Level: "We are back!" 16 | 17 | .. toctree:: 18 | :maxdepth: 3 19 | :caption: Contents: 20 | :numbered: 21 | 22 | readme_link.rst 23 | intro.rst 24 | how_to_build_a_platformer_with_spygame.rst 25 | adding_more_things_to_our_platformer.rst 26 | how_to_code_against_spygame.rst 27 | spygame_reference.rst 28 | 29 | Indices and tables 30 | ================== 31 | 32 | * :ref:`genindex` 33 | * :ref:`modindex` 34 | * :ref:`search` 35 | -------------------------------------------------------------------------------- /docs/_sources/intro.rst.txt: -------------------------------------------------------------------------------- 1 | Introduction to spygame 2 | ======================= 3 | 4 | .. include:: blizzard_copyright_disclaimer.rst 5 | 6 | What is spygame? 7 | ---------------- 8 | 9 | Spygame is a lightweight 2D game engine written in python3 using the pygame library. It's purpose 10 | is to: 11 | 12 | #. Allow python enthusiasts to reverse engineer their favourite 2D classic games in python. 13 | #. Support bleeding-edge AI developments via integration into the openAI toolbox (gym and rllab) and thus 14 | allow researchers to test their reinforcement learning algorithms on complex and \"reward-sparse\" environments. 15 | #. Have fun developing new games and game genres using just python. 16 | 17 | Main Features 18 | ------------- 19 | 20 | Simple, yet Powerful 21 | ++++++++++++++++++++ 22 | 23 | Spygame is very lightweight. It comes as a single python module that can be installed on your machine 24 | via a simple ``pip install spygame``. 25 | 26 | Spygame uses so called level-tmx files to allow developers to create complex game worlds using the open-source 27 | `Tiled Editor `_. You can build a rather complex level from scratch only needing a few 28 | background images and sprite-sheets as prerequisites: 29 | 30 | .. image:: images/intro_001_level_tmx_file.png 31 | :alt: a level-tmx file opened in the Tiled editor 32 | :scale: 75% 33 | 34 | Built-In Complex Physics 35 | ++++++++++++++++++++++++ 36 | 37 | Spygame offers built-in complex platformer physics supporting the following features: 38 | - tiles with arbitrary slopes (including stairs options) 39 | - jumping 40 | - full support for ladders 41 | - pushable heavy objects 42 | - elevators and moving platforms that one can stand on 43 | - built-in game AIs (cliff- and character-detection mechanisms) 44 | 45 | .. image:: images/intro_002_spygame_physics_component.png 46 | :alt: spygame's physics component offers a rich set of physics rules 47 | 48 | Example Levels from "The Lost Vikings" Universe 49 | +++++++++++++++++++++++++++++++++++++++++++++++ 50 | 51 | Spygame comes with lots of fully playable example levels, mostly reverse-engineered from \"The Lost Vikings\" Game (c) 1992 Blizzard Entertainment Inc. 52 | 53 | .. image:: images/intro_003_example_spygame_level.png 54 | :alt: an example Lost Vikings reverse-engineered spygame level 55 | 56 | 57 | Support for Academic AI and Reinforcement Learning 58 | ++++++++++++++++++++++++++++++++++++++++++++++++++ 59 | 60 | This is still work in progress: Spygame will be fully integrated into the openAI gym and rllab tool sets. One of the core purposes of spygame is 61 | to allow running reinforcement learning (AI) algorithms on different computer games in order to help the AI community to 62 | test and improve their algorithms. 63 | 64 | .. image:: images/intro_004_openailogo.png 65 | :scale: 40% 66 | 67 | .. image:: images/intro_004_tensorlogo.png 68 | :scale: 60% 69 | 70 | .. image:: images/intro_004_pytorchlogo.png 71 | :scale: 30% 72 | 73 | -------------------------------------------------------------------------------- /docs/_sources/readme_link.rst.txt: -------------------------------------------------------------------------------- 1 | .. include:: ../README.rst -------------------------------------------------------------------------------- /docs/_sources/spygame_reference.rst.txt: -------------------------------------------------------------------------------- 1 | Spygame API Reference Documentation 2 | =================================== 3 | 4 | Core API 5 | -------- 6 | 7 | .. automodule:: spygame 8 | :members: 9 | :undoc-members: 10 | :show-inheritance: 11 | 12 | Example Classes: 13 | ---------------- 14 | 15 | The Lost Vikings 16 | ++++++++++++++++ 17 | 18 | .. automodule:: spygame.examples.vikings 19 | :members: 20 | :undoc-members: 21 | :show-inheritance: 22 | -------------------------------------------------------------------------------- /docs/_static/ajax-loader.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ducandu/spygame/5caac137e718cae24788784ec5558270e7613801/docs/_static/ajax-loader.gif -------------------------------------------------------------------------------- /docs/_static/comment-bright.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ducandu/spygame/5caac137e718cae24788784ec5558270e7613801/docs/_static/comment-bright.png -------------------------------------------------------------------------------- /docs/_static/comment-close.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ducandu/spygame/5caac137e718cae24788784ec5558270e7613801/docs/_static/comment-close.png -------------------------------------------------------------------------------- /docs/_static/comment.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ducandu/spygame/5caac137e718cae24788784ec5558270e7613801/docs/_static/comment.png -------------------------------------------------------------------------------- /docs/_static/contents.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ducandu/spygame/5caac137e718cae24788784ec5558270e7613801/docs/_static/contents.png -------------------------------------------------------------------------------- /docs/_static/doctools.js: -------------------------------------------------------------------------------- 1 | /* 2 | * doctools.js 3 | * ~~~~~~~~~~~ 4 | * 5 | * Sphinx JavaScript utilities for all documentation. 6 | * 7 | * :copyright: Copyright 2007-2017 by the Sphinx team, see AUTHORS. 8 | * :license: BSD, see LICENSE for details. 9 | * 10 | */ 11 | 12 | /** 13 | * select a different prefix for underscore 14 | */ 15 | $u = _.noConflict(); 16 | 17 | /** 18 | * make the code below compatible with browsers without 19 | * an installed firebug like debugger 20 | if (!window.console || !console.firebug) { 21 | var names = ["log", "debug", "info", "warn", "error", "assert", "dir", 22 | "dirxml", "group", "groupEnd", "time", "timeEnd", "count", "trace", 23 | "profile", "profileEnd"]; 24 | window.console = {}; 25 | for (var i = 0; i < names.length; ++i) 26 | window.console[names[i]] = function() {}; 27 | } 28 | */ 29 | 30 | /** 31 | * small helper function to urldecode strings 32 | */ 33 | jQuery.urldecode = function(x) { 34 | return decodeURIComponent(x).replace(/\+/g, ' '); 35 | }; 36 | 37 | /** 38 | * small helper function to urlencode strings 39 | */ 40 | jQuery.urlencode = encodeURIComponent; 41 | 42 | /** 43 | * This function returns the parsed url parameters of the 44 | * current request. Multiple values per key are supported, 45 | * it will always return arrays of strings for the value parts. 46 | */ 47 | jQuery.getQueryParameters = function(s) { 48 | if (typeof s == 'undefined') 49 | s = document.location.search; 50 | var parts = s.substr(s.indexOf('?') + 1).split('&'); 51 | var result = {}; 52 | for (var i = 0; i < parts.length; i++) { 53 | var tmp = parts[i].split('=', 2); 54 | var key = jQuery.urldecode(tmp[0]); 55 | var value = jQuery.urldecode(tmp[1]); 56 | if (key in result) 57 | result[key].push(value); 58 | else 59 | result[key] = [value]; 60 | } 61 | return result; 62 | }; 63 | 64 | /** 65 | * highlight a given string on a jquery object by wrapping it in 66 | * span elements with the given class name. 67 | */ 68 | jQuery.fn.highlightText = function(text, className) { 69 | function highlight(node) { 70 | if (node.nodeType == 3) { 71 | var val = node.nodeValue; 72 | var pos = val.toLowerCase().indexOf(text); 73 | if (pos >= 0 && !jQuery(node.parentNode).hasClass(className)) { 74 | var span = document.createElement("span"); 75 | span.className = className; 76 | span.appendChild(document.createTextNode(val.substr(pos, text.length))); 77 | node.parentNode.insertBefore(span, node.parentNode.insertBefore( 78 | document.createTextNode(val.substr(pos + text.length)), 79 | node.nextSibling)); 80 | node.nodeValue = val.substr(0, pos); 81 | } 82 | } 83 | else if (!jQuery(node).is("button, select, textarea")) { 84 | jQuery.each(node.childNodes, function() { 85 | highlight(this); 86 | }); 87 | } 88 | } 89 | return this.each(function() { 90 | highlight(this); 91 | }); 92 | }; 93 | 94 | /* 95 | * backward compatibility for jQuery.browser 96 | * This will be supported until firefox bug is fixed. 97 | */ 98 | if (!jQuery.browser) { 99 | jQuery.uaMatch = function(ua) { 100 | ua = ua.toLowerCase(); 101 | 102 | var match = /(chrome)[ \/]([\w.]+)/.exec(ua) || 103 | /(webkit)[ \/]([\w.]+)/.exec(ua) || 104 | /(opera)(?:.*version|)[ \/]([\w.]+)/.exec(ua) || 105 | /(msie) ([\w.]+)/.exec(ua) || 106 | ua.indexOf("compatible") < 0 && /(mozilla)(?:.*? rv:([\w.]+)|)/.exec(ua) || 107 | []; 108 | 109 | return { 110 | browser: match[ 1 ] || "", 111 | version: match[ 2 ] || "0" 112 | }; 113 | }; 114 | jQuery.browser = {}; 115 | jQuery.browser[jQuery.uaMatch(navigator.userAgent).browser] = true; 116 | } 117 | 118 | /** 119 | * Small JavaScript module for the documentation. 120 | */ 121 | var Documentation = { 122 | 123 | init : function() { 124 | this.fixFirefoxAnchorBug(); 125 | this.highlightSearchWords(); 126 | this.initIndexTable(); 127 | 128 | }, 129 | 130 | /** 131 | * i18n support 132 | */ 133 | TRANSLATIONS : {}, 134 | PLURAL_EXPR : function(n) { return n == 1 ? 0 : 1; }, 135 | LOCALE : 'unknown', 136 | 137 | // gettext and ngettext don't access this so that the functions 138 | // can safely bound to a different name (_ = Documentation.gettext) 139 | gettext : function(string) { 140 | var translated = Documentation.TRANSLATIONS[string]; 141 | if (typeof translated == 'undefined') 142 | return string; 143 | return (typeof translated == 'string') ? translated : translated[0]; 144 | }, 145 | 146 | ngettext : function(singular, plural, n) { 147 | var translated = Documentation.TRANSLATIONS[singular]; 148 | if (typeof translated == 'undefined') 149 | return (n == 1) ? singular : plural; 150 | return translated[Documentation.PLURALEXPR(n)]; 151 | }, 152 | 153 | addTranslations : function(catalog) { 154 | for (var key in catalog.messages) 155 | this.TRANSLATIONS[key] = catalog.messages[key]; 156 | this.PLURAL_EXPR = new Function('n', 'return +(' + catalog.plural_expr + ')'); 157 | this.LOCALE = catalog.locale; 158 | }, 159 | 160 | /** 161 | * add context elements like header anchor links 162 | */ 163 | addContextElements : function() { 164 | $('div[id] > :header:first').each(function() { 165 | $('\u00B6'). 166 | attr('href', '#' + this.id). 167 | attr('title', _('Permalink to this headline')). 168 | appendTo(this); 169 | }); 170 | $('dt[id]').each(function() { 171 | $('\u00B6'). 172 | attr('href', '#' + this.id). 173 | attr('title', _('Permalink to this definition')). 174 | appendTo(this); 175 | }); 176 | }, 177 | 178 | /** 179 | * workaround a firefox stupidity 180 | * see: https://bugzilla.mozilla.org/show_bug.cgi?id=645075 181 | */ 182 | fixFirefoxAnchorBug : function() { 183 | if (document.location.hash) 184 | window.setTimeout(function() { 185 | document.location.href += ''; 186 | }, 10); 187 | }, 188 | 189 | /** 190 | * highlight the search words provided in the url in the text 191 | */ 192 | highlightSearchWords : function() { 193 | var params = $.getQueryParameters(); 194 | var terms = (params.highlight) ? params.highlight[0].split(/\s+/) : []; 195 | if (terms.length) { 196 | var body = $('div.body'); 197 | if (!body.length) { 198 | body = $('body'); 199 | } 200 | window.setTimeout(function() { 201 | $.each(terms, function() { 202 | body.highlightText(this.toLowerCase(), 'highlighted'); 203 | }); 204 | }, 10); 205 | $('') 207 | .appendTo($('#searchbox')); 208 | } 209 | }, 210 | 211 | /** 212 | * init the domain index toggle buttons 213 | */ 214 | initIndexTable : function() { 215 | var togglers = $('img.toggler').click(function() { 216 | var src = $(this).attr('src'); 217 | var idnum = $(this).attr('id').substr(7); 218 | $('tr.cg-' + idnum).toggle(); 219 | if (src.substr(-9) == 'minus.png') 220 | $(this).attr('src', src.substr(0, src.length-9) + 'plus.png'); 221 | else 222 | $(this).attr('src', src.substr(0, src.length-8) + 'minus.png'); 223 | }).css('display', ''); 224 | if (DOCUMENTATION_OPTIONS.COLLAPSE_INDEX) { 225 | togglers.click(); 226 | } 227 | }, 228 | 229 | /** 230 | * helper function to hide the search marks again 231 | */ 232 | hideSearchWords : function() { 233 | $('#searchbox .highlight-link').fadeOut(300); 234 | $('span.highlighted').removeClass('highlighted'); 235 | }, 236 | 237 | /** 238 | * make the url absolute 239 | */ 240 | makeURL : function(relativeURL) { 241 | return DOCUMENTATION_OPTIONS.URL_ROOT + '/' + relativeURL; 242 | }, 243 | 244 | /** 245 | * get the current relative url 246 | */ 247 | getCurrentURL : function() { 248 | var path = document.location.pathname; 249 | var parts = path.split(/\//); 250 | $.each(DOCUMENTATION_OPTIONS.URL_ROOT.split(/\//), function() { 251 | if (this == '..') 252 | parts.pop(); 253 | }); 254 | var url = parts.join('/'); 255 | return path.substring(url.lastIndexOf('/') + 1, path.length - 1); 256 | }, 257 | 258 | initOnKeyListeners: function() { 259 | $(document).keyup(function(event) { 260 | var activeElementType = document.activeElement.tagName; 261 | // don't navigate when in search box or textarea 262 | if (activeElementType !== 'TEXTAREA' && activeElementType !== 'INPUT' && activeElementType !== 'SELECT') { 263 | switch (event.keyCode) { 264 | case 37: // left 265 | var prevHref = $('link[rel="prev"]').prop('href'); 266 | if (prevHref) { 267 | window.location.href = prevHref; 268 | return false; 269 | } 270 | case 39: // right 271 | var nextHref = $('link[rel="next"]').prop('href'); 272 | if (nextHref) { 273 | window.location.href = nextHref; 274 | return false; 275 | } 276 | } 277 | } 278 | }); 279 | } 280 | }; 281 | 282 | // quick alias for translations 283 | _ = Documentation.gettext; 284 | 285 | $(document).ready(function() { 286 | Documentation.init(); 287 | }); -------------------------------------------------------------------------------- /docs/_static/down-pressed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ducandu/spygame/5caac137e718cae24788784ec5558270e7613801/docs/_static/down-pressed.png -------------------------------------------------------------------------------- /docs/_static/down.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ducandu/spygame/5caac137e718cae24788784ec5558270e7613801/docs/_static/down.png -------------------------------------------------------------------------------- /docs/_static/file.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ducandu/spygame/5caac137e718cae24788784ec5558270e7613801/docs/_static/file.png -------------------------------------------------------------------------------- /docs/_static/minus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ducandu/spygame/5caac137e718cae24788784ec5558270e7613801/docs/_static/minus.png -------------------------------------------------------------------------------- /docs/_static/navigation.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ducandu/spygame/5caac137e718cae24788784ec5558270e7613801/docs/_static/navigation.png -------------------------------------------------------------------------------- /docs/_static/plus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ducandu/spygame/5caac137e718cae24788784ec5558270e7613801/docs/_static/plus.png -------------------------------------------------------------------------------- /docs/_static/pygments.css: -------------------------------------------------------------------------------- 1 | .highlight .hll { background-color: #ffffcc } 2 | .highlight { background: #eeffcc; } 3 | .highlight .c { color: #408090; font-style: italic } /* Comment */ 4 | .highlight .err { border: 1px solid #FF0000 } /* Error */ 5 | .highlight .k { color: #007020; font-weight: bold } /* Keyword */ 6 | .highlight .o { color: #666666 } /* Operator */ 7 | .highlight .ch { color: #408090; font-style: italic } /* Comment.Hashbang */ 8 | .highlight .cm { color: #408090; font-style: italic } /* Comment.Multiline */ 9 | .highlight .cp { color: #007020 } /* Comment.Preproc */ 10 | .highlight .cpf { color: #408090; font-style: italic } /* Comment.PreprocFile */ 11 | .highlight .c1 { color: #408090; font-style: italic } /* Comment.Single */ 12 | .highlight .cs { color: #408090; background-color: #fff0f0 } /* Comment.Special */ 13 | .highlight .gd { color: #A00000 } /* Generic.Deleted */ 14 | .highlight .ge { font-style: italic } /* Generic.Emph */ 15 | .highlight .gr { color: #FF0000 } /* Generic.Error */ 16 | .highlight .gh { color: #000080; font-weight: bold } /* Generic.Heading */ 17 | .highlight .gi { color: #00A000 } /* Generic.Inserted */ 18 | .highlight .go { color: #333333 } /* Generic.Output */ 19 | .highlight .gp { color: #c65d09; font-weight: bold } /* Generic.Prompt */ 20 | .highlight .gs { font-weight: bold } /* Generic.Strong */ 21 | .highlight .gu { color: #800080; font-weight: bold } /* Generic.Subheading */ 22 | .highlight .gt { color: #0044DD } /* Generic.Traceback */ 23 | .highlight .kc { color: #007020; font-weight: bold } /* Keyword.Constant */ 24 | .highlight .kd { color: #007020; font-weight: bold } /* Keyword.Declaration */ 25 | .highlight .kn { color: #007020; font-weight: bold } /* Keyword.Namespace */ 26 | .highlight .kp { color: #007020 } /* Keyword.Pseudo */ 27 | .highlight .kr { color: #007020; font-weight: bold } /* Keyword.Reserved */ 28 | .highlight .kt { color: #902000 } /* Keyword.Type */ 29 | .highlight .m { color: #208050 } /* Literal.Number */ 30 | .highlight .s { color: #4070a0 } /* Literal.String */ 31 | .highlight .na { color: #4070a0 } /* Name.Attribute */ 32 | .highlight .nb { color: #007020 } /* Name.Builtin */ 33 | .highlight .nc { color: #0e84b5; font-weight: bold } /* Name.Class */ 34 | .highlight .no { color: #60add5 } /* Name.Constant */ 35 | .highlight .nd { color: #555555; font-weight: bold } /* Name.Decorator */ 36 | .highlight .ni { color: #d55537; font-weight: bold } /* Name.Entity */ 37 | .highlight .ne { color: #007020 } /* Name.Exception */ 38 | .highlight .nf { color: #06287e } /* Name.Function */ 39 | .highlight .nl { color: #002070; font-weight: bold } /* Name.Label */ 40 | .highlight .nn { color: #0e84b5; font-weight: bold } /* Name.Namespace */ 41 | .highlight .nt { color: #062873; font-weight: bold } /* Name.Tag */ 42 | .highlight .nv { color: #bb60d5 } /* Name.Variable */ 43 | .highlight .ow { color: #007020; font-weight: bold } /* Operator.Word */ 44 | .highlight .w { color: #bbbbbb } /* Text.Whitespace */ 45 | .highlight .mb { color: #208050 } /* Literal.Number.Bin */ 46 | .highlight .mf { color: #208050 } /* Literal.Number.Float */ 47 | .highlight .mh { color: #208050 } /* Literal.Number.Hex */ 48 | .highlight .mi { color: #208050 } /* Literal.Number.Integer */ 49 | .highlight .mo { color: #208050 } /* Literal.Number.Oct */ 50 | .highlight .sa { color: #4070a0 } /* Literal.String.Affix */ 51 | .highlight .sb { color: #4070a0 } /* Literal.String.Backtick */ 52 | .highlight .sc { color: #4070a0 } /* Literal.String.Char */ 53 | .highlight .dl { color: #4070a0 } /* Literal.String.Delimiter */ 54 | .highlight .sd { color: #4070a0; font-style: italic } /* Literal.String.Doc */ 55 | .highlight .s2 { color: #4070a0 } /* Literal.String.Double */ 56 | .highlight .se { color: #4070a0; font-weight: bold } /* Literal.String.Escape */ 57 | .highlight .sh { color: #4070a0 } /* Literal.String.Heredoc */ 58 | .highlight .si { color: #70a0d0; font-style: italic } /* Literal.String.Interpol */ 59 | .highlight .sx { color: #c65d09 } /* Literal.String.Other */ 60 | .highlight .sr { color: #235388 } /* Literal.String.Regex */ 61 | .highlight .s1 { color: #4070a0 } /* Literal.String.Single */ 62 | .highlight .ss { color: #517918 } /* Literal.String.Symbol */ 63 | .highlight .bp { color: #007020 } /* Name.Builtin.Pseudo */ 64 | .highlight .fm { color: #06287e } /* Name.Function.Magic */ 65 | .highlight .vc { color: #bb60d5 } /* Name.Variable.Class */ 66 | .highlight .vg { color: #bb60d5 } /* Name.Variable.Global */ 67 | .highlight .vi { color: #bb60d5 } /* Name.Variable.Instance */ 68 | .highlight .vm { color: #bb60d5 } /* Name.Variable.Magic */ 69 | .highlight .il { color: #208050 } /* Literal.Number.Integer.Long */ -------------------------------------------------------------------------------- /docs/_static/sphinxdoc.css: -------------------------------------------------------------------------------- 1 | /* 2 | * sphinxdoc.css_t 3 | * ~~~~~~~~~~~~~~~ 4 | * 5 | * Sphinx stylesheet -- sphinxdoc theme. Originally created by 6 | * Armin Ronacher for Werkzeug. 7 | * 8 | * :copyright: Copyright 2007-2017 by the Sphinx team, see AUTHORS. 9 | * :license: BSD, see LICENSE for details. 10 | * 11 | */ 12 | 13 | @import url("basic.css"); 14 | 15 | /* -- page layout ----------------------------------------------------------- */ 16 | 17 | body { 18 | font-family: 'Lucida Grande', 'Lucida Sans Unicode', 'Geneva', 19 | 'Verdana', sans-serif; 20 | font-size: 14px; 21 | letter-spacing: -0.01em; 22 | line-height: 150%; 23 | text-align: center; 24 | background-color: #BFD1D4; 25 | color: black; 26 | padding: 0; 27 | border: 1px solid #aaa; 28 | 29 | margin: 0px 80px 0px 80px; 30 | min-width: 740px; 31 | } 32 | 33 | div.document { 34 | background-color: white; 35 | text-align: left; 36 | background-image: url(contents.png); 37 | background-repeat: repeat-x; 38 | } 39 | 40 | div.bodywrapper { 41 | margin: 0 240px 0 0; 42 | border-right: 1px solid #ccc; 43 | } 44 | 45 | div.body { 46 | margin: 0; 47 | padding: 0.5em 20px 20px 20px; 48 | } 49 | 50 | div.related { 51 | font-size: 1em; 52 | } 53 | 54 | div.related ul { 55 | background-image: url(navigation.png); 56 | height: 2em; 57 | border-top: 1px solid #ddd; 58 | border-bottom: 1px solid #ddd; 59 | } 60 | 61 | div.related ul li { 62 | margin: 0; 63 | padding: 0; 64 | height: 2em; 65 | float: left; 66 | } 67 | 68 | div.related ul li.right { 69 | float: right; 70 | margin-right: 5px; 71 | } 72 | 73 | div.related ul li a { 74 | margin: 0; 75 | padding: 0 5px 0 5px; 76 | line-height: 1.75em; 77 | color: #EE9816; 78 | } 79 | 80 | div.related ul li a:hover { 81 | color: #3CA8E7; 82 | } 83 | 84 | div.sphinxsidebarwrapper { 85 | padding: 0; 86 | } 87 | 88 | div.sphinxsidebar { 89 | margin: 0; 90 | padding: 0.5em 15px 15px 0; 91 | width: 210px; 92 | float: right; 93 | font-size: 1em; 94 | text-align: left; 95 | } 96 | 97 | div.sphinxsidebar h3, div.sphinxsidebar h4 { 98 | margin: 1em 0 0.5em 0; 99 | font-size: 1em; 100 | padding: 0.1em 0 0.1em 0.5em; 101 | color: white; 102 | border: 1px solid #86989B; 103 | background-color: #AFC1C4; 104 | } 105 | 106 | div.sphinxsidebar h3 a { 107 | color: white; 108 | } 109 | 110 | div.sphinxsidebar ul { 111 | padding-left: 1.5em; 112 | margin-top: 7px; 113 | padding: 0; 114 | line-height: 130%; 115 | } 116 | 117 | div.sphinxsidebar ul ul { 118 | margin-left: 20px; 119 | } 120 | 121 | div.footer { 122 | background-color: #E3EFF1; 123 | color: #86989B; 124 | padding: 3px 8px 3px 0; 125 | clear: both; 126 | font-size: 0.8em; 127 | text-align: right; 128 | } 129 | 130 | div.footer a { 131 | color: #86989B; 132 | text-decoration: underline; 133 | } 134 | 135 | /* -- body styles ----------------------------------------------------------- */ 136 | 137 | p { 138 | margin: 0.8em 0 0.5em 0; 139 | } 140 | 141 | a { 142 | color: #CA7900; 143 | text-decoration: none; 144 | } 145 | 146 | a:hover { 147 | color: #2491CF; 148 | } 149 | 150 | div.body a { 151 | text-decoration: underline; 152 | } 153 | 154 | h1 { 155 | margin: 0; 156 | padding: 0.7em 0 0.3em 0; 157 | font-size: 1.5em; 158 | color: #11557C; 159 | } 160 | 161 | h2 { 162 | margin: 1.3em 0 0.2em 0; 163 | font-size: 1.35em; 164 | padding: 0; 165 | } 166 | 167 | h3 { 168 | margin: 1em 0 -0.3em 0; 169 | font-size: 1.2em; 170 | } 171 | 172 | div.body h1 a, div.body h2 a, div.body h3 a, div.body h4 a, div.body h5 a, div.body h6 a { 173 | color: black!important; 174 | } 175 | 176 | h1 a.anchor, h2 a.anchor, h3 a.anchor, h4 a.anchor, h5 a.anchor, h6 a.anchor { 177 | display: none; 178 | margin: 0 0 0 0.3em; 179 | padding: 0 0.2em 0 0.2em; 180 | color: #aaa!important; 181 | } 182 | 183 | h1:hover a.anchor, h2:hover a.anchor, h3:hover a.anchor, h4:hover a.anchor, 184 | h5:hover a.anchor, h6:hover a.anchor { 185 | display: inline; 186 | } 187 | 188 | h1 a.anchor:hover, h2 a.anchor:hover, h3 a.anchor:hover, h4 a.anchor:hover, 189 | h5 a.anchor:hover, h6 a.anchor:hover { 190 | color: #777; 191 | background-color: #eee; 192 | } 193 | 194 | a.headerlink { 195 | color: #c60f0f!important; 196 | font-size: 1em; 197 | margin-left: 6px; 198 | padding: 0 4px 0 4px; 199 | text-decoration: none!important; 200 | } 201 | 202 | a.headerlink:hover { 203 | background-color: #ccc; 204 | color: white!important; 205 | } 206 | 207 | cite, code, code { 208 | font-family: 'Consolas', 'Deja Vu Sans Mono', 209 | 'Bitstream Vera Sans Mono', monospace; 210 | font-size: 0.95em; 211 | letter-spacing: 0.01em; 212 | } 213 | 214 | code { 215 | background-color: #f2f2f2; 216 | border-bottom: 1px solid #ddd; 217 | color: #333; 218 | } 219 | 220 | code.descname, code.descclassname, code.xref { 221 | border: 0; 222 | } 223 | 224 | hr { 225 | border: 1px solid #abc; 226 | margin: 2em; 227 | } 228 | 229 | a code { 230 | border: 0; 231 | color: #CA7900; 232 | } 233 | 234 | a code:hover { 235 | color: #2491CF; 236 | } 237 | 238 | pre { 239 | font-family: 'Consolas', 'Deja Vu Sans Mono', 240 | 'Bitstream Vera Sans Mono', monospace; 241 | font-size: 0.95em; 242 | letter-spacing: 0.015em; 243 | line-height: 120%; 244 | padding: 0.5em; 245 | border: 1px solid #ccc; 246 | background-color: #f8f8f8; 247 | } 248 | 249 | pre a { 250 | color: inherit; 251 | text-decoration: underline; 252 | } 253 | 254 | td.linenos pre { 255 | padding: 0.5em 0; 256 | } 257 | 258 | div.quotebar { 259 | background-color: #f8f8f8; 260 | max-width: 250px; 261 | float: right; 262 | padding: 2px 7px; 263 | border: 1px solid #ccc; 264 | } 265 | 266 | div.topic { 267 | background-color: #f8f8f8; 268 | } 269 | 270 | table { 271 | border-collapse: collapse; 272 | margin: 0 -0.5em 0 -0.5em; 273 | } 274 | 275 | table td, table th { 276 | padding: 0.2em 0.5em 0.2em 0.5em; 277 | } 278 | 279 | div.admonition, div.warning { 280 | font-size: 0.9em; 281 | margin: 1em 0 1em 0; 282 | border: 1px solid #86989B; 283 | background-color: #f7f7f7; 284 | padding: 0; 285 | } 286 | 287 | div.admonition p, div.warning p { 288 | margin: 0.5em 1em 0.5em 1em; 289 | padding: 0; 290 | } 291 | 292 | div.admonition pre, div.warning pre { 293 | margin: 0.4em 1em 0.4em 1em; 294 | } 295 | 296 | div.admonition p.admonition-title, 297 | div.warning p.admonition-title { 298 | margin: 0; 299 | padding: 0.1em 0 0.1em 0.5em; 300 | color: white; 301 | border-bottom: 1px solid #86989B; 302 | font-weight: bold; 303 | background-color: #AFC1C4; 304 | } 305 | 306 | div.warning { 307 | border: 1px solid #940000; 308 | } 309 | 310 | div.warning p.admonition-title { 311 | background-color: #CF0000; 312 | border-bottom-color: #940000; 313 | } 314 | 315 | div.admonition ul, div.admonition ol, 316 | div.warning ul, div.warning ol { 317 | margin: 0.1em 0.5em 0.5em 3em; 318 | padding: 0; 319 | } 320 | 321 | div.versioninfo { 322 | margin: 1em 0 0 0; 323 | border: 1px solid #ccc; 324 | background-color: #DDEAF0; 325 | padding: 8px; 326 | line-height: 1.3em; 327 | font-size: 0.9em; 328 | } 329 | 330 | .viewcode-back { 331 | font-family: 'Lucida Grande', 'Lucida Sans Unicode', 'Geneva', 332 | 'Verdana', sans-serif; 333 | } 334 | 335 | div.viewcode-block:target { 336 | background-color: #f4debf; 337 | border-top: 1px solid #ac9; 338 | border-bottom: 1px solid #ac9; 339 | } 340 | 341 | div.code-block-caption { 342 | background-color: #ddd; 343 | color: #222; 344 | border: 1px solid #ccc; 345 | } -------------------------------------------------------------------------------- /docs/_static/spygame_sphinx.css: -------------------------------------------------------------------------------- 1 | @import url("sphinxdoc.css"); 2 | 3 | 4 | body { 5 | max-width: 1200px; 6 | } 7 | 8 | -------------------------------------------------------------------------------- /docs/_static/underscore.js: -------------------------------------------------------------------------------- 1 | // Underscore.js 1.3.1 2 | // (c) 2009-2012 Jeremy Ashkenas, DocumentCloud Inc. 3 | // Underscore is freely distributable under the MIT license. 4 | // Portions of Underscore are inspired or borrowed from Prototype, 5 | // Oliver Steele's Functional, and John Resig's Micro-Templating. 6 | // For all details and documentation: 7 | // http://documentcloud.github.com/underscore 8 | (function(){function q(a,c,d){if(a===c)return a!==0||1/a==1/c;if(a==null||c==null)return a===c;if(a._chain)a=a._wrapped;if(c._chain)c=c._wrapped;if(a.isEqual&&b.isFunction(a.isEqual))return a.isEqual(c);if(c.isEqual&&b.isFunction(c.isEqual))return c.isEqual(a);var e=l.call(a);if(e!=l.call(c))return false;switch(e){case "[object String]":return a==String(c);case "[object Number]":return a!=+a?c!=+c:a==0?1/a==1/c:a==+c;case "[object Date]":case "[object Boolean]":return+a==+c;case "[object RegExp]":return a.source== 9 | c.source&&a.global==c.global&&a.multiline==c.multiline&&a.ignoreCase==c.ignoreCase}if(typeof a!="object"||typeof c!="object")return false;for(var f=d.length;f--;)if(d[f]==a)return true;d.push(a);var f=0,g=true;if(e=="[object Array]"){if(f=a.length,g=f==c.length)for(;f--;)if(!(g=f in a==f in c&&q(a[f],c[f],d)))break}else{if("constructor"in a!="constructor"in c||a.constructor!=c.constructor)return false;for(var h in a)if(b.has(a,h)&&(f++,!(g=b.has(c,h)&&q(a[h],c[h],d))))break;if(g){for(h in c)if(b.has(c, 10 | h)&&!f--)break;g=!f}}d.pop();return g}var r=this,G=r._,n={},k=Array.prototype,o=Object.prototype,i=k.slice,H=k.unshift,l=o.toString,I=o.hasOwnProperty,w=k.forEach,x=k.map,y=k.reduce,z=k.reduceRight,A=k.filter,B=k.every,C=k.some,p=k.indexOf,D=k.lastIndexOf,o=Array.isArray,J=Object.keys,s=Function.prototype.bind,b=function(a){return new m(a)};if(typeof exports!=="undefined"){if(typeof module!=="undefined"&&module.exports)exports=module.exports=b;exports._=b}else r._=b;b.VERSION="1.3.1";var j=b.each= 11 | b.forEach=function(a,c,d){if(a!=null)if(w&&a.forEach===w)a.forEach(c,d);else if(a.length===+a.length)for(var e=0,f=a.length;e2;a== 12 | null&&(a=[]);if(y&&a.reduce===y)return e&&(c=b.bind(c,e)),f?a.reduce(c,d):a.reduce(c);j(a,function(a,b,i){f?d=c.call(e,d,a,b,i):(d=a,f=true)});if(!f)throw new TypeError("Reduce of empty array with no initial value");return d};b.reduceRight=b.foldr=function(a,c,d,e){var f=arguments.length>2;a==null&&(a=[]);if(z&&a.reduceRight===z)return e&&(c=b.bind(c,e)),f?a.reduceRight(c,d):a.reduceRight(c);var g=b.toArray(a).reverse();e&&!f&&(c=b.bind(c,e));return f?b.reduce(g,c,d,e):b.reduce(g,c)};b.find=b.detect= 13 | function(a,c,b){var e;E(a,function(a,g,h){if(c.call(b,a,g,h))return e=a,true});return e};b.filter=b.select=function(a,c,b){var e=[];if(a==null)return e;if(A&&a.filter===A)return a.filter(c,b);j(a,function(a,g,h){c.call(b,a,g,h)&&(e[e.length]=a)});return e};b.reject=function(a,c,b){var e=[];if(a==null)return e;j(a,function(a,g,h){c.call(b,a,g,h)||(e[e.length]=a)});return e};b.every=b.all=function(a,c,b){var e=true;if(a==null)return e;if(B&&a.every===B)return a.every(c,b);j(a,function(a,g,h){if(!(e= 14 | e&&c.call(b,a,g,h)))return n});return e};var E=b.some=b.any=function(a,c,d){c||(c=b.identity);var e=false;if(a==null)return e;if(C&&a.some===C)return a.some(c,d);j(a,function(a,b,h){if(e||(e=c.call(d,a,b,h)))return n});return!!e};b.include=b.contains=function(a,c){var b=false;if(a==null)return b;return p&&a.indexOf===p?a.indexOf(c)!=-1:b=E(a,function(a){return a===c})};b.invoke=function(a,c){var d=i.call(arguments,2);return b.map(a,function(a){return(b.isFunction(c)?c||a:a[c]).apply(a,d)})};b.pluck= 15 | function(a,c){return b.map(a,function(a){return a[c]})};b.max=function(a,c,d){if(!c&&b.isArray(a))return Math.max.apply(Math,a);if(!c&&b.isEmpty(a))return-Infinity;var e={computed:-Infinity};j(a,function(a,b,h){b=c?c.call(d,a,b,h):a;b>=e.computed&&(e={value:a,computed:b})});return e.value};b.min=function(a,c,d){if(!c&&b.isArray(a))return Math.min.apply(Math,a);if(!c&&b.isEmpty(a))return Infinity;var e={computed:Infinity};j(a,function(a,b,h){b=c?c.call(d,a,b,h):a;bd?1:0}),"value")};b.groupBy=function(a,c){var d={},e=b.isFunction(c)?c:function(a){return a[c]};j(a,function(a,b){var c=e(a,b);(d[c]||(d[c]=[])).push(a)});return d};b.sortedIndex=function(a, 17 | c,d){d||(d=b.identity);for(var e=0,f=a.length;e>1;d(a[g])=0})})};b.difference=function(a){var c=b.flatten(i.call(arguments,1));return b.filter(a,function(a){return!b.include(c,a)})};b.zip=function(){for(var a=i.call(arguments),c=b.max(b.pluck(a,"length")),d=Array(c),e=0;e=0;d--)b=[a[d].apply(this,b)];return b[0]}}; 24 | b.after=function(a,b){return a<=0?b():function(){if(--a<1)return b.apply(this,arguments)}};b.keys=J||function(a){if(a!==Object(a))throw new TypeError("Invalid object");var c=[],d;for(d in a)b.has(a,d)&&(c[c.length]=d);return c};b.values=function(a){return b.map(a,b.identity)};b.functions=b.methods=function(a){var c=[],d;for(d in a)b.isFunction(a[d])&&c.push(d);return c.sort()};b.extend=function(a){j(i.call(arguments,1),function(b){for(var d in b)a[d]=b[d]});return a};b.defaults=function(a){j(i.call(arguments, 25 | 1),function(b){for(var d in b)a[d]==null&&(a[d]=b[d])});return a};b.clone=function(a){return!b.isObject(a)?a:b.isArray(a)?a.slice():b.extend({},a)};b.tap=function(a,b){b(a);return a};b.isEqual=function(a,b){return q(a,b,[])};b.isEmpty=function(a){if(b.isArray(a)||b.isString(a))return a.length===0;for(var c in a)if(b.has(a,c))return false;return true};b.isElement=function(a){return!!(a&&a.nodeType==1)};b.isArray=o||function(a){return l.call(a)=="[object Array]"};b.isObject=function(a){return a===Object(a)}; 26 | b.isArguments=function(a){return l.call(a)=="[object Arguments]"};if(!b.isArguments(arguments))b.isArguments=function(a){return!(!a||!b.has(a,"callee"))};b.isFunction=function(a){return l.call(a)=="[object Function]"};b.isString=function(a){return l.call(a)=="[object String]"};b.isNumber=function(a){return l.call(a)=="[object Number]"};b.isNaN=function(a){return a!==a};b.isBoolean=function(a){return a===true||a===false||l.call(a)=="[object Boolean]"};b.isDate=function(a){return l.call(a)=="[object Date]"}; 27 | b.isRegExp=function(a){return l.call(a)=="[object RegExp]"};b.isNull=function(a){return a===null};b.isUndefined=function(a){return a===void 0};b.has=function(a,b){return I.call(a,b)};b.noConflict=function(){r._=G;return this};b.identity=function(a){return a};b.times=function(a,b,d){for(var e=0;e/g,">").replace(/"/g,""").replace(/'/g,"'").replace(/\//g,"/")};b.mixin=function(a){j(b.functions(a), 28 | function(c){K(c,b[c]=a[c])})};var L=0;b.uniqueId=function(a){var b=L++;return a?a+b:b};b.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var t=/.^/,u=function(a){return a.replace(/\\\\/g,"\\").replace(/\\'/g,"'")};b.template=function(a,c){var d=b.templateSettings,d="var __p=[],print=function(){__p.push.apply(__p,arguments);};with(obj||{}){__p.push('"+a.replace(/\\/g,"\\\\").replace(/'/g,"\\'").replace(d.escape||t,function(a,b){return"',_.escape("+ 29 | u(b)+"),'"}).replace(d.interpolate||t,function(a,b){return"',"+u(b)+",'"}).replace(d.evaluate||t,function(a,b){return"');"+u(b).replace(/[\r\n\t]/g," ")+";__p.push('"}).replace(/\r/g,"\\r").replace(/\n/g,"\\n").replace(/\t/g,"\\t")+"');}return __p.join('');",e=new Function("obj","_",d);return c?e(c,b):function(a){return e.call(this,a,b)}};b.chain=function(a){return b(a).chain()};var m=function(a){this._wrapped=a};b.prototype=m.prototype;var v=function(a,c){return c?b(a).chain():a},K=function(a,c){m.prototype[a]= 30 | function(){var a=i.call(arguments);H.call(a,this._wrapped);return v(c.apply(b,a),this._chain)}};b.mixin(b);j("pop,push,reverse,shift,sort,splice,unshift".split(","),function(a){var b=k[a];m.prototype[a]=function(){var d=this._wrapped;b.apply(d,arguments);var e=d.length;(a=="shift"||a=="splice")&&e===0&&delete d[0];return v(d,this._chain)}});j(["concat","join","slice"],function(a){var b=k[a];m.prototype[a]=function(){return v(b.apply(this._wrapped,arguments),this._chain)}});m.prototype.chain=function(){this._chain= 31 | true;return this};m.prototype.value=function(){return this._wrapped}}).call(this); 32 | -------------------------------------------------------------------------------- /docs/_static/up-pressed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ducandu/spygame/5caac137e718cae24788784ec5558270e7613801/docs/_static/up-pressed.png -------------------------------------------------------------------------------- /docs/_static/up.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ducandu/spygame/5caac137e718cae24788784ec5558270e7613801/docs/_static/up.png -------------------------------------------------------------------------------- /docs/blizzard_copyright_disclaimer.html: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | <no title> — spygame 0.1a9 documentation 10 | 11 | 12 | 13 | 14 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 44 | 65 | 66 |
67 |
68 |
69 |
70 | 71 |

IMPORTANT NOTE: All graphics used in this documentation and in the spygame.examples.vikings package of the spygame library were taken from the game 72 | “The Lost Vikings” (c) 1992 by Blizzard Entertainment Inc. (formerly known as Silicon and Synapse). Please use these images (in your own projects and repos) 73 | for demonstration purposes only and then also mention this copyright statement!

74 | 75 | 76 |
77 |
78 |
79 |
80 |
81 | 93 | 97 | 98 | -------------------------------------------------------------------------------- /docs/blizzard_copyright_disclaimer.rst: -------------------------------------------------------------------------------- 1 | **IMPORTANT NOTE:** *All graphics used in this documentation and in the spygame.examples.vikings package of the spygame library were taken from the game 2 | "The Lost Vikings" (c) 1992 by Blizzard Entertainment Inc. (formerly known as Silicon and Synapse). Please use these images (in your own projects and repos) 3 | for demonstration purposes only and then also mention this copyright statement!* 4 | -------------------------------------------------------------------------------- /docs/conf.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | # 4 | # spygame documentation build configuration file, created by 5 | # sphinx-quickstart on Thu Jun 15 19:39:47 2017. 6 | # 7 | # This file is execfile()d with the current directory set to its 8 | # containing dir. 9 | # 10 | # Note that not all possible configuration values are present in this 11 | # autogenerated file. 12 | # 13 | # All configuration values have a default; values that are commented out 14 | # serve to show the default. 15 | 16 | # If extensions (or modules to document with autodoc) are in another directory, 17 | # add these directories to sys.path here. If the directory is relative to the 18 | # documentation root, use os.path.abspath to make it absolute, like shown here. 19 | # 20 | 21 | import os 22 | import sys 23 | sys.path.insert(0, os.path.abspath('../spygame')) 24 | sys.path.insert(0, os.path.abspath('../')) 25 | import spygame as spyg 26 | 27 | 28 | # -- General configuration ------------------------------------------------ 29 | 30 | # If your documentation needs a minimal Sphinx version, state it here. 31 | # 32 | # needs_sphinx = '1.0' 33 | 34 | # Add any Sphinx extension module names here, as strings. They can be 35 | # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom 36 | # ones. 37 | extensions = ['sphinx.ext.autodoc', 38 | 'sphinx.ext.doctest', 39 | 'sphinx.ext.intersphinx', 40 | 'sphinx.ext.todo', 41 | 'sphinx.ext.coverage', 42 | 'sphinx.ext.mathjax', 43 | 'sphinx.ext.viewcode', 44 | 'sphinx.ext.githubpages'] 45 | 46 | # Add any paths that contain templates here, relative to this directory. 47 | templates_path = ['_templates'] 48 | 49 | # The suffix(es) of source filenames. 50 | # You can specify multiple suffix as a list of string: 51 | # 52 | # source_suffix = ['.rst', '.md'] 53 | source_suffix = '.rst' 54 | 55 | # The master toctree document. 56 | master_doc = 'index' 57 | 58 | # General information about the project. 59 | project = 'spygame' 60 | copyright = '2017, ducandu GmbH' 61 | author = 'Sven Mika' 62 | 63 | # The version info for the project you're documenting, acts as replacement for 64 | # |version| and |release|, also used in various other places throughout the 65 | # built documents. 66 | # 67 | # The short X.Y version. 68 | version = spyg.VERSION_ 69 | # The full version, including alpha/beta/rc tags. 70 | release = spyg.RELEASE_ 71 | 72 | # The language for content autogenerated by Sphinx. Refer to documentation 73 | # for a list of supported languages. 74 | # 75 | # This is also used if you do content translation via gettext catalogs. 76 | # Usually you set "language" from the command line for these cases. 77 | language = None 78 | 79 | # List of patterns, relative to source directory, that match files and 80 | # directories to ignore when looking for source files. 81 | # This patterns also effect to html_static_path and html_extra_path 82 | exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store'] 83 | 84 | # The name of the Pygments (syntax highlighting) style to use. 85 | pygments_style = 'sphinx' 86 | 87 | # If true, `todo` and `todoList` produce output, else they produce nothing. 88 | todo_include_todos = True 89 | 90 | 91 | # -- Options for HTML output ---------------------------------------------- 92 | 93 | # The theme to use for HTML and HTML Help pages. See the documentation for 94 | # a list of builtin themes. 95 | # 96 | html_theme = 'sphinxdoc' 97 | html_style = 'spygame_sphinx.css' 98 | 99 | # Theme options are theme-specific and customize the look and feel of a theme 100 | # further. For a list of options available for each theme, see the 101 | # documentation. 102 | # 103 | # html_theme_options = {} 104 | 105 | # Add any paths that contain custom static files (such as style sheets) here, 106 | # relative to this directory. They are copied after the builtin static files, 107 | # so a file named "default.css" will overwrite the builtin "default.css". 108 | html_static_path = ['_static'] 109 | 110 | 111 | # -- Options for HTMLHelp output ------------------------------------------ 112 | 113 | # Output file base name for HTML help builder. 114 | htmlhelp_basename = 'spygamedoc' 115 | 116 | 117 | # -- Options for LaTeX output --------------------------------------------- 118 | 119 | latex_elements = { 120 | # The paper size ('letterpaper' or 'a4paper'). 121 | # 122 | # 'papersize': 'letterpaper', 123 | 124 | # The font size ('10pt', '11pt' or '12pt'). 125 | # 126 | # 'pointsize': '10pt', 127 | 128 | # Additional stuff for the LaTeX preamble. 129 | # 130 | # 'preamble': '', 131 | 132 | # Latex figure (float) alignment 133 | # 134 | # 'figure_align': 'htbp', 135 | } 136 | 137 | # Grouping the document tree into LaTeX files. List of tuples 138 | # (source start file, target name, title, 139 | # author, documentclass [howto, manual, or own class]). 140 | latex_documents = [ 141 | (master_doc, 'spygame.tex', 'spygame Documentation', 142 | 'Sven Mika', 'manual'), 143 | ] 144 | 145 | 146 | # -- Options for manual page output --------------------------------------- 147 | 148 | # One entry per manual page. List of tuples 149 | # (source start file, name, description, authors, manual section). 150 | man_pages = [ 151 | (master_doc, 'spygame', 'spygame Documentation', 152 | [author], 1) 153 | ] 154 | 155 | 156 | # -- Options for Texinfo output ------------------------------------------- 157 | 158 | # Grouping the document tree into Texinfo files. List of tuples 159 | # (source start file, target name, title, author, 160 | # dir menu entry, description, category) 161 | texinfo_documents = [ 162 | (master_doc, 'spygame', 'spygame Documentation', 163 | author, 'spygame', 'One line description of project.', 164 | 'Miscellaneous'), 165 | ] 166 | 167 | 168 | 169 | 170 | # Example configuration for intersphinx: refer to the Python standard library. 171 | intersphinx_mapping = {'https://docs.python.org/': None} 172 | -------------------------------------------------------------------------------- /docs/doctrees/environment.pickle: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ducandu/spygame/5caac137e718cae24788784ec5558270e7613801/docs/doctrees/environment.pickle -------------------------------------------------------------------------------- /docs/doctrees/index.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ducandu/spygame/5caac137e718cae24788784ec5558270e7613801/docs/doctrees/index.doctree -------------------------------------------------------------------------------- /docs/doctrees/modules.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ducandu/spygame/5caac137e718cae24788784ec5558270e7613801/docs/doctrees/modules.doctree -------------------------------------------------------------------------------- /docs/doctrees/spygame.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ducandu/spygame/5caac137e718cae24788784ec5558270e7613801/docs/doctrees/spygame.doctree -------------------------------------------------------------------------------- /docs/how_to_code_against_spygame.html: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | 5. How to code against spygame — spygame 0.1a9 documentation 10 | 11 | 12 | 13 | 14 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 52 | 79 | 80 |
81 |
82 |
83 |
84 | 85 |
86 |

5. How to code against spygame

87 |

In this tutorial, we will be exploring the spygame code and learn how to write our own custom classes for spygame.

88 |

[WIP]

89 |
90 | 91 | 92 |
93 |
94 |
95 |
96 |
97 | 115 | 119 | 120 | -------------------------------------------------------------------------------- /docs/how_to_code_against_spygame.rst: -------------------------------------------------------------------------------- 1 | How to code against spygame 2 | =========================== 3 | 4 | In this tutorial, we will be exploring the spygame code and learn how to write our own custom classes for spygame. 5 | 6 | [WIP] 7 | -------------------------------------------------------------------------------- /docs/images/index_001_screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ducandu/spygame/5caac137e718cae24788784ec5558270e7613801/docs/images/index_001_screenshot.png -------------------------------------------------------------------------------- /docs/images/intro_001_level_tmx_file.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ducandu/spygame/5caac137e718cae24788784ec5558270e7613801/docs/images/intro_001_level_tmx_file.png -------------------------------------------------------------------------------- /docs/images/intro_002_spygame_physics_component.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ducandu/spygame/5caac137e718cae24788784ec5558270e7613801/docs/images/intro_002_spygame_physics_component.png -------------------------------------------------------------------------------- /docs/images/intro_003_example_spygame_level.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ducandu/spygame/5caac137e718cae24788784ec5558270e7613801/docs/images/intro_003_example_spygame_level.png -------------------------------------------------------------------------------- /docs/images/intro_004_openailogo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ducandu/spygame/5caac137e718cae24788784ec5558270e7613801/docs/images/intro_004_openailogo.png -------------------------------------------------------------------------------- /docs/images/intro_004_pytorchlogo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ducandu/spygame/5caac137e718cae24788784ec5558270e7613801/docs/images/intro_004_pytorchlogo.png -------------------------------------------------------------------------------- /docs/images/intro_004_tensorlogo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ducandu/spygame/5caac137e718cae24788784ec5558270e7613801/docs/images/intro_004_tensorlogo.png -------------------------------------------------------------------------------- /docs/images/tmx_egpt_level.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ducandu/spygame/5caac137e718cae24788784ec5558270e7613801/docs/images/tmx_egpt_level.png -------------------------------------------------------------------------------- /docs/images/tmx_egpt_level_02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ducandu/spygame/5caac137e718cae24788784ec5558270e7613801/docs/images/tmx_egpt_level_02.png -------------------------------------------------------------------------------- /docs/index.rst: -------------------------------------------------------------------------------- 1 | .. spygame documentation master file, created by 2 | sphinx-quickstart on Thu Jun 15 19:39:47 2017. 3 | You can adapt this file completely to your liking, but it should at least 4 | contain the root `toctree` directive. 5 | 6 | Welcome to spygame's documentation! 7 | =================================== 8 | 9 | spygame is a python 2D game engine based on pygame and level-tmx files 10 | ---------------------------------------------------------------------- 11 | 12 | | 13 | 14 | .. image:: images/index_001_screenshot.png 15 | :alt: Level: "We are back!" 16 | 17 | .. toctree:: 18 | :maxdepth: 3 19 | :caption: Contents: 20 | :numbered: 21 | 22 | readme_link.rst 23 | intro.rst 24 | how_to_build_a_platformer_with_spygame.rst 25 | adding_more_things_to_our_platformer.rst 26 | how_to_code_against_spygame.rst 27 | spygame_reference.rst 28 | 29 | Indices and tables 30 | ================== 31 | 32 | * :ref:`genindex` 33 | * :ref:`modindex` 34 | * :ref:`search` 35 | -------------------------------------------------------------------------------- /docs/intro.html: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | 2. Introduction to spygame — spygame 0.1a9 documentation 10 | 11 | 12 | 13 | 14 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 52 | 94 | 95 |
96 |
97 |
98 |
99 | 100 |
101 |

2. Introduction to spygame

102 |

IMPORTANT NOTE: All graphics used in this documentation and in the spygame.examples.vikings package of the spygame library were taken from the game 103 | “The Lost Vikings” (c) 1992 by Blizzard Entertainment Inc. (formerly known as Silicon and Synapse). Please use these images (in your own projects and repos) 104 | for demonstration purposes only and then also mention this copyright statement!

105 |
106 |

2.1. What is spygame?

107 |

Spygame is a lightweight 2D game engine written in python3 using the pygame library. It’s purpose 108 | is to:

109 |
    110 |
  1. Allow python enthusiasts to reverse engineer their favourite 2D classic games in python.
  2. 111 |
  3. Support bleeding-edge AI developments via integration into the openAI toolbox (gym and rllab) and thus 112 | allow researchers to test their reinforcement learning algorithms on complex and “reward-sparse” environments.
  4. 113 |
  5. Have fun developing new games and game genres using just python.
  6. 114 |
115 |
116 |
117 |

2.2. Main Features

118 |
119 |

2.2.1. Simple, yet Powerful

120 |

Spygame is very lightweight. It comes as a single python module that can be installed on your machine 121 | via a simple pip install spygame.

122 |

Spygame uses so called level-tmx files to allow developers to create complex game worlds using the open-source 123 | Tiled Editor. You can build a rather complex level from scratch only needing a few 124 | background images and sprite-sheets as prerequisites:

125 | a level-tmx file opened in the Tiled editor 126 |
127 |
128 |

2.2.2. Built-In Complex Physics

129 |

Spygame offers built-in complex platformer physics supporting the following features: 130 | - tiles with arbitrary slopes (including stairs options) 131 | - jumping 132 | - full support for ladders 133 | - pushable heavy objects 134 | - elevators and moving platforms that one can stand on 135 | - built-in game AIs (cliff- and character-detection mechanisms)

136 | spygame's physics component offers a rich set of physics rules 137 |
138 |
139 |

2.2.3. Example Levels from “The Lost Vikings” Universe

140 |

Spygame comes with lots of fully playable example levels, mostly reverse-engineered from “The Lost Vikings” Game (c) 1992 Blizzard Entertainment Inc.

141 | an example Lost Vikings reverse-engineered spygame level 142 |
143 |
144 |

2.2.4. Support for Academic AI and Reinforcement Learning

145 |

This is still work in progress: Spygame will be fully integrated into the openAI gym and rllab tool sets. One of the core purposes of spygame is 146 | to allow running reinforcement learning (AI) algorithms on different computer games in order to help the AI community to 147 | test and improve their algorithms.

148 | _images/intro_004_openailogo.png 149 | _images/intro_004_tensorlogo.png 150 | _images/intro_004_pytorchlogo.png 151 |
152 |
153 |
154 | 155 | 156 |
157 |
158 |
159 |
160 |
161 | 179 | 183 | 184 | -------------------------------------------------------------------------------- /docs/intro.rst: -------------------------------------------------------------------------------- 1 | Introduction to spygame 2 | ======================= 3 | 4 | .. include:: blizzard_copyright_disclaimer.rst 5 | 6 | What is spygame? 7 | ---------------- 8 | 9 | Spygame is a lightweight 2D game engine written in python3 using the pygame library. It's purpose 10 | is to: 11 | 12 | #. Allow python enthusiasts to reverse engineer their favourite 2D classic games in python. 13 | #. Support bleeding-edge AI developments via integration into the openAI toolbox (gym and rllab) and thus 14 | allow researchers to test their reinforcement learning algorithms on complex and \"reward-sparse\" environments. 15 | #. Have fun developing new games and game genres using just python. 16 | 17 | Main Features 18 | ------------- 19 | 20 | Simple, yet Powerful 21 | ++++++++++++++++++++ 22 | 23 | Spygame is very lightweight. It comes as a single python module that can be installed on your machine 24 | via a simple ``pip install spygame``. 25 | 26 | Spygame uses so called level-tmx files to allow developers to create complex game worlds using the open-source 27 | `Tiled Editor `_. You can build a rather complex level from scratch only needing a few 28 | background images and sprite-sheets as prerequisites: 29 | 30 | .. image:: images/intro_001_level_tmx_file.png 31 | :alt: a level-tmx file opened in the Tiled editor 32 | :scale: 75% 33 | 34 | Built-In Complex Physics 35 | ++++++++++++++++++++++++ 36 | 37 | Spygame offers built-in complex platformer physics supporting the following features: 38 | - tiles with arbitrary slopes (including stairs options) 39 | - jumping 40 | - full support for ladders 41 | - pushable heavy objects 42 | - elevators and moving platforms that one can stand on 43 | - built-in game AIs (cliff- and character-detection mechanisms) 44 | 45 | .. image:: images/intro_002_spygame_physics_component.png 46 | :alt: spygame's physics component offers a rich set of physics rules 47 | 48 | Example Levels from "The Lost Vikings" Universe 49 | +++++++++++++++++++++++++++++++++++++++++++++++ 50 | 51 | Spygame comes with lots of fully playable example levels, mostly reverse-engineered from \"The Lost Vikings\" Game (c) 1992 Blizzard Entertainment Inc. 52 | 53 | .. image:: images/intro_003_example_spygame_level.png 54 | :alt: an example Lost Vikings reverse-engineered spygame level 55 | 56 | 57 | Support for Academic AI and Reinforcement Learning 58 | ++++++++++++++++++++++++++++++++++++++++++++++++++ 59 | 60 | This is still work in progress: Spygame will be fully integrated into the openAI gym and rllab tool sets. One of the core purposes of spygame is 61 | to allow running reinforcement learning (AI) algorithms on different computer games in order to help the AI community to 62 | test and improve their algorithms. 63 | 64 | .. image:: images/intro_004_openailogo.png 65 | :scale: 40% 66 | 67 | .. image:: images/intro_004_tensorlogo.png 68 | :scale: 60% 69 | 70 | .. image:: images/intro_004_pytorchlogo.png 71 | :scale: 30% 72 | 73 | -------------------------------------------------------------------------------- /docs/make.bat: -------------------------------------------------------------------------------- 1 | @ECHO OFF 2 | 3 | pushd %~dp0 4 | 5 | REM Command file for Sphinx documentation 6 | 7 | if "%SPHINXBUILD%" == "" ( 8 | set SPHINXBUILD=python -msphinx 9 | ) 10 | set SOURCEDIR=. 11 | set BUILDDIR=.. 12 | set SPHINXPROJ=spygame 13 | 14 | if "%1" == "" goto help 15 | 16 | %SPHINXBUILD% >NUL 2>NUL 17 | if errorlevel 9009 ( 18 | echo. 19 | echo.The Sphinx module was not found. Make sure you have Sphinx installed, 20 | echo.then set the SPHINXBUILD environment variable to point to the full 21 | echo.path of the 'sphinx-build' executable. Alternatively you may add the 22 | echo.Sphinx directory to PATH. 23 | echo. 24 | echo.If you don't have Sphinx installed, grab it from 25 | echo.http://sphinx-doc.org/ 26 | exit /b 1 27 | ) 28 | 29 | %SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% 30 | goto end 31 | 32 | :help 33 | %SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% 34 | 35 | :end 36 | 37 | cd .. 38 | rd docs\_images\ /s /q 39 | rd docs\_static\ /s /q 40 | rd docs\_modules\ /s /q 41 | rd docs\_sources\ /s /q 42 | xcopy html\*.* docs /e /s /y 43 | xcopy docs\spygame_sphinx.css docs\_static\ /y 44 | rd html /s /q 45 | 46 | popd 47 | 48 | -------------------------------------------------------------------------------- /docs/objects.inv: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ducandu/spygame/5caac137e718cae24788784ec5558270e7613801/docs/objects.inv -------------------------------------------------------------------------------- /docs/py-modindex.html: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | Python Module Index — spygame 0.1a9 documentation 10 | 11 | 12 | 13 | 14 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 47 | 61 | 62 |
63 |
64 |
65 |
66 | 67 | 68 |

Python Module Index

69 | 70 |
71 | s 72 |
73 | 74 | 75 | 76 | 78 | 79 | 81 | 84 | 85 | 86 | 89 |
 
77 | s
82 | spygame 83 |
    87 | spygame.examples.vikings 88 |
90 | 91 | 92 |
93 |
94 |
95 |
96 |
97 | 109 | 113 | 114 | -------------------------------------------------------------------------------- /docs/readme_link.rst: -------------------------------------------------------------------------------- 1 | .. include:: ../README.rst -------------------------------------------------------------------------------- /docs/search.html: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | Search — spygame 0.1a9 documentation 10 | 11 | 12 | 13 | 14 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 52 | 56 | 57 |
58 |
59 |
60 |
61 | 62 |

Search

63 |
64 | 65 |

66 | Please activate JavaScript to enable the search 67 | functionality. 68 |

69 |
70 |

71 | From here you can search these documents. Enter your search 72 | words into the box below and click "search". Note that the search 73 | function will automatically search for all of the words. Pages 74 | containing fewer words won't appear in the result list. 75 |

76 |
77 | 78 | 79 | 80 |
81 | 82 |
83 | 84 |
85 | 86 |
87 |
88 |
89 |
90 |
91 | 103 | 107 | 108 | -------------------------------------------------------------------------------- /docs/slope_collision_solution_diagrams.pptx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ducandu/spygame/5caac137e718cae24788784ec5558270e7613801/docs/slope_collision_solution_diagrams.pptx -------------------------------------------------------------------------------- /docs/spygame_reference.rst: -------------------------------------------------------------------------------- 1 | Spygame API Reference Documentation 2 | =================================== 3 | 4 | Core API 5 | -------- 6 | 7 | .. automodule:: spygame 8 | :members: 9 | :undoc-members: 10 | :show-inheritance: 11 | 12 | Example Classes: 13 | ---------------- 14 | 15 | The Lost Vikings 16 | ++++++++++++++++ 17 | 18 | .. automodule:: spygame.examples.vikings 19 | :members: 20 | :undoc-members: 21 | :show-inheritance: 22 | -------------------------------------------------------------------------------- /docs/spygame_sphinx.css: -------------------------------------------------------------------------------- 1 | @import url("sphinxdoc.css"); 2 | 3 | 4 | body { 5 | max-width: 1200px; 6 | } 7 | 8 | -------------------------------------------------------------------------------- /docs/tutorial/001_final_spygame_game.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ducandu/spygame/5caac137e718cae24788784ec5558270e7613801/docs/tutorial/001_final_spygame_game.png -------------------------------------------------------------------------------- /docs/tutorial/002_file_new.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ducandu/spygame/5caac137e718cae24788784ec5558270e7613801/docs/tutorial/002_file_new.png -------------------------------------------------------------------------------- /docs/tutorial/003_file_new_specifics.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ducandu/spygame/5caac137e718cae24788784ec5558270e7613801/docs/tutorial/003_file_new_specifics.png -------------------------------------------------------------------------------- /docs/tutorial/004_empty_level.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ducandu/spygame/5caac137e718cae24788784ec5558270e7613801/docs/tutorial/004_empty_level.png -------------------------------------------------------------------------------- /docs/tutorial/005_file_save_as.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ducandu/spygame/5caac137e718cae24788784ec5558270e7613801/docs/tutorial/005_file_save_as.png -------------------------------------------------------------------------------- /docs/tutorial/005a_renaming_a_layer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ducandu/spygame/5caac137e718cae24788784ec5558270e7613801/docs/tutorial/005a_renaming_a_layer.png -------------------------------------------------------------------------------- /docs/tutorial/006_map_new_tileset.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ducandu/spygame/5caac137e718cae24788784ec5558270e7613801/docs/tutorial/006_map_new_tileset.png -------------------------------------------------------------------------------- /docs/tutorial/007_tileset_ready_png_image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ducandu/spygame/5caac137e718cae24788784ec5558270e7613801/docs/tutorial/007_tileset_ready_png_image.png -------------------------------------------------------------------------------- /docs/tutorial/008_our_first_tileset.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ducandu/spygame/5caac137e718cae24788784ec5558270e7613801/docs/tutorial/008_our_first_tileset.png -------------------------------------------------------------------------------- /docs/tutorial/009_changing_single_tiles_properties.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ducandu/spygame/5caac137e718cae24788784ec5558270e7613801/docs/tutorial/009_changing_single_tiles_properties.png -------------------------------------------------------------------------------- /docs/tutorial/010_adding_the_offset_property_to_a_tile.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ducandu/spygame/5caac137e718cae24788784ec5558270e7613801/docs/tutorial/010_adding_the_offset_property_to_a_tile.png -------------------------------------------------------------------------------- /docs/tutorial/011_custom_properties_for_a_tile.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ducandu/spygame/5caac137e718cae24788784ec5558270e7613801/docs/tutorial/011_custom_properties_for_a_tile.png -------------------------------------------------------------------------------- /docs/tutorial/012_drawing_a_floor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ducandu/spygame/5caac137e718cae24788784ec5558270e7613801/docs/tutorial/012_drawing_a_floor.png -------------------------------------------------------------------------------- /docs/tutorial/013_walls_and_other_structures.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ducandu/spygame/5caac137e718cae24788784ec5558270e7613801/docs/tutorial/013_walls_and_other_structures.png -------------------------------------------------------------------------------- /docs/tutorial/014_background_layer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ducandu/spygame/5caac137e718cae24788784ec5558270e7613801/docs/tutorial/014_background_layer.png -------------------------------------------------------------------------------- /docs/tutorial/015_properties_of_background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ducandu/spygame/5caac137e718cae24788784ec5558270e7613801/docs/tutorial/015_properties_of_background.png -------------------------------------------------------------------------------- /docs/tutorial/016_the_egpt_tileset.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ducandu/spygame/5caac137e718cae24788784ec5558270e7613801/docs/tutorial/016_the_egpt_tileset.png -------------------------------------------------------------------------------- /docs/tutorial/017_using_more_than_one_tile_at_a_time.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ducandu/spygame/5caac137e718cae24788784ec5558270e7613801/docs/tutorial/017_using_more_than_one_tile_at_a_time.png -------------------------------------------------------------------------------- /docs/tutorial/018_a_possible_background_setup.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ducandu/spygame/5caac137e718cae24788784ec5558270e7613801/docs/tutorial/018_a_possible_background_setup.png -------------------------------------------------------------------------------- /docs/tutorial/019_a_possible_foreground_setup.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ducandu/spygame/5caac137e718cae24788784ec5558270e7613801/docs/tutorial/019_a_possible_foreground_setup.png -------------------------------------------------------------------------------- /docs/tutorial/020_new_object_layer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ducandu/spygame/5caac137e718cae24788784ec5558270e7613801/docs/tutorial/020_new_object_layer.png -------------------------------------------------------------------------------- /docs/tutorial/021_setting_up_the_erik_tileset.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ducandu/spygame/5caac137e718cae24788784ec5558270e7613801/docs/tutorial/021_setting_up_the_erik_tileset.png -------------------------------------------------------------------------------- /docs/tutorial/022_placing_erik_into_the_level.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ducandu/spygame/5caac137e718cae24788784ec5558270e7613801/docs/tutorial/022_placing_erik_into_the_level.png -------------------------------------------------------------------------------- /docs/tutorial/023_setting_eriks_constructor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ducandu/spygame/5caac137e718cae24788784ec5558270e7613801/docs/tutorial/023_setting_eriks_constructor.png -------------------------------------------------------------------------------- /docs/tutorial/023a_exporting_eriks_tileset_as_tsx.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ducandu/spygame/5caac137e718cae24788784ec5558270e7613801/docs/tutorial/023a_exporting_eriks_tileset_as_tsx.png -------------------------------------------------------------------------------- /docs/tutorial/024_adding_keyboard_input_definitions.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ducandu/spygame/5caac137e718cae24788784ec5558270e7613801/docs/tutorial/024_adding_keyboard_input_definitions.png -------------------------------------------------------------------------------- /docs/tutorial/025_defining_keyboard_input_definitions.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ducandu/spygame/5caac137e718cae24788784ec5558270e7613801/docs/tutorial/025_defining_keyboard_input_definitions.png -------------------------------------------------------------------------------- /docs/tutorial/026_erik_jumping_around_in_the_level.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ducandu/spygame/5caac137e718cae24788784ec5558270e7613801/docs/tutorial/026_erik_jumping_around_in_the_level.png -------------------------------------------------------------------------------- /docs/tutorial/advanced/001_final_spygame_game.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ducandu/spygame/5caac137e718cae24788784ec5558270e7613801/docs/tutorial/advanced/001_final_spygame_game.png -------------------------------------------------------------------------------- /docs/tutorial/advanced/002_moving_layers_up_and_down.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ducandu/spygame/5caac137e718cae24788784ec5558270e7613801/docs/tutorial/advanced/002_moving_layers_up_and_down.png -------------------------------------------------------------------------------- /docs/tutorial/advanced/003_erasing_the_staircase.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ducandu/spygame/5caac137e718cae24788784ec5558270e7613801/docs/tutorial/advanced/003_erasing_the_staircase.png -------------------------------------------------------------------------------- /docs/tutorial/advanced/004_creating_a_sloped_hill.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ducandu/spygame/5caac137e718cae24788784ec5558270e7613801/docs/tutorial/advanced/004_creating_a_sloped_hill.png -------------------------------------------------------------------------------- /docs/tutorial/advanced/005_selecting_a_range_of_tiles.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ducandu/spygame/5caac137e718cae24788784ec5558270e7613801/docs/tutorial/advanced/005_selecting_a_range_of_tiles.png -------------------------------------------------------------------------------- /docs/tutorial/advanced/006_erik_disappearing_nicely_in_the_foreground_sand_hill.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ducandu/spygame/5caac137e718cae24788784ec5558270e7613801/docs/tutorial/advanced/006_erik_disappearing_nicely_in_the_foreground_sand_hill.png -------------------------------------------------------------------------------- /docs/tutorial/advanced/007_selecting_tiles_that_make_up_trunk.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ducandu/spygame/5caac137e718cae24788784ec5558270e7613801/docs/tutorial/advanced/007_selecting_tiles_that_make_up_trunk.png -------------------------------------------------------------------------------- /docs/tutorial/advanced/008_re_adding_the_palm_to_the_background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ducandu/spygame/5caac137e718cae24788784ec5558270e7613801/docs/tutorial/advanced/008_re_adding_the_palm_to_the_background.png -------------------------------------------------------------------------------- /docs/tutorial/advanced/009_erik_climbing_up_a_ladder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ducandu/spygame/5caac137e718cae24788784ec5558270e7613801/docs/tutorial/advanced/009_erik_climbing_up_a_ladder.png -------------------------------------------------------------------------------- /docs/tutorial/advanced/010_adding_a_quicksand_trap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ducandu/spygame/5caac137e718cae24788784ec5558270e7613801/docs/tutorial/advanced/010_adding_a_quicksand_trap.png -------------------------------------------------------------------------------- /docs/tutorial/advanced/011_erik_sinking_into_the_trap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ducandu/spygame/5caac137e718cae24788784ec5558270e7613801/docs/tutorial/advanced/011_erik_sinking_into_the_trap.png -------------------------------------------------------------------------------- /docs/tutorial/advanced/012_baleog_and_erik_together.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ducandu/spygame/5caac137e718cae24788784ec5558270e7613801/docs/tutorial/advanced/012_baleog_and_erik_together.png -------------------------------------------------------------------------------- /docs/tutorial/advanced/013_tileset_for_a_movable_rock.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ducandu/spygame/5caac137e718cae24788784ec5558270e7613801/docs/tutorial/advanced/013_tileset_for_a_movable_rock.png -------------------------------------------------------------------------------- /docs/tutorial/advanced/014_baleog_pushing_the_rock.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ducandu/spygame/5caac137e718cae24788784ec5558270e7613801/docs/tutorial/advanced/014_baleog_pushing_the_rock.png -------------------------------------------------------------------------------- /docs/tutorial/advanced/015_erik_blocking_baleog_from_pushing_the_rock.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ducandu/spygame/5caac137e718cae24788784ec5558270e7613801/docs/tutorial/advanced/015_erik_blocking_baleog_from_pushing_the_rock.png -------------------------------------------------------------------------------- /docs/tutorial/advanced/016_baleog_pushing_the_rock_with_erik_on_top.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ducandu/spygame/5caac137e718cae24788784ec5558270e7613801/docs/tutorial/advanced/016_baleog_pushing_the_rock_with_erik_on_top.png -------------------------------------------------------------------------------- /docs/tutorial/advanced/017_erik_pushing_the_rock_uphill.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ducandu/spygame/5caac137e718cae24788784ec5558270e7613801/docs/tutorial/advanced/017_erik_pushing_the_rock_uphill.png -------------------------------------------------------------------------------- /docs/tutorial/advanced/018_poor_baleog_getting_squeezed_by_the_rock.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ducandu/spygame/5caac137e718cae24788784ec5558270e7613801/docs/tutorial/advanced/018_poor_baleog_getting_squeezed_by_the_rock.png -------------------------------------------------------------------------------- /docs/tutorial/advanced/019_placing_an_elevator.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ducandu/spygame/5caac137e718cae24788784ec5558270e7613801/docs/tutorial/advanced/019_placing_an_elevator.png -------------------------------------------------------------------------------- /docs/tutorial/advanced/020_the_elevators_properties.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ducandu/spygame/5caac137e718cae24788784ec5558270e7613801/docs/tutorial/advanced/020_the_elevators_properties.png -------------------------------------------------------------------------------- /docs/tutorial/advanced/021_baleog_jumping_onto_the_elevator.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ducandu/spygame/5caac137e718cae24788784ec5558270e7613801/docs/tutorial/advanced/021_baleog_jumping_onto_the_elevator.png -------------------------------------------------------------------------------- /docs/tutorial/advanced/022_erik_and_baleog_standing_on_the_elevator.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ducandu/spygame/5caac137e718cae24788784ec5558270e7613801/docs/tutorial/advanced/022_erik_and_baleog_standing_on_the_elevator.png -------------------------------------------------------------------------------- /docs/tutorial/advanced/023_placing_the_repeater_as_arbitrary_tile_in_the_level.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ducandu/spygame/5caac137e718cae24788784ec5558270e7613801/docs/tutorial/advanced/023_placing_the_repeater_as_arbitrary_tile_in_the_level.png -------------------------------------------------------------------------------- /docs/tutorial/advanced/024_repeater_properties.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ducandu/spygame/5caac137e718cae24788784ec5558270e7613801/docs/tutorial/advanced/024_repeater_properties.png -------------------------------------------------------------------------------- /docs/tutorial/advanced/025_the_repeater_in_action_in_the_game.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ducandu/spygame/5caac137e718cae24788784ec5558270e7613801/docs/tutorial/advanced/025_the_repeater_in_action_in_the_game.png -------------------------------------------------------------------------------- /docs/tutorial/advanced/026_the_two_firespitter_tiles.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ducandu/spygame/5caac137e718cae24788784ec5558270e7613801/docs/tutorial/advanced/026_the_two_firespitter_tiles.png -------------------------------------------------------------------------------- /docs/tutorial/advanced/027_the_custom_property_of_the_left_firespitter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ducandu/spygame/5caac137e718cae24788784ec5558270e7613801/docs/tutorial/advanced/027_the_custom_property_of_the_left_firespitter.png -------------------------------------------------------------------------------- /docs/tutorial/advanced/028_painting_a_firespitter_into_the_level.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ducandu/spygame/5caac137e718cae24788784ec5558270e7613801/docs/tutorial/advanced/028_painting_a_firespitter_into_the_level.png -------------------------------------------------------------------------------- /docs/tutorial/advanced/029_erik_in_pain.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ducandu/spygame/5caac137e718cae24788784ec5558270e7613801/docs/tutorial/advanced/029_erik_in_pain.png -------------------------------------------------------------------------------- /examples/maze_runner/__init__.py: -------------------------------------------------------------------------------- 1 | from .maze_runner import MyAgent -------------------------------------------------------------------------------- /examples/maze_runner/data/erik.tsx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /examples/maze_runner/data/generic.tsx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /examples/maze_runner/data/maze.tmx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 1960,1999,2000,2001,2002,2003,1888,1889,2006,2007,1888,1889,1888,1888,1960, 17 | 1997,0,0,0,0,0,0,0,0,0,0,0,0,0,1960, 18 | 2034,0,0,0,0,0,0,0,0,0,0,0,0,0,1960, 19 | 2071,0,0,1999,2000,2001,0,0,0,0,0,0,0,0,1960, 20 | 2108,0,0,0,0,0,0,0,0,0,0,0,0,0,1960, 21 | 2145,0,0,0,0,0,0,0,0,0,0,0,0,0,1960, 22 | 2182,0,0,0,0,0,0,0,0,0,0,0,0,0,1960, 23 | 1960,0,0,0,2809,2810,2811,2812,2813,2814,2811,2812,2813,2814,1960, 24 | 1997,0,0,0,0,0,0,0,0,0,0,0,0,0,1960, 25 | 2034,0,0,0,0,0,0,0,0,0,0,0,0,0,1997, 26 | 2071,2808,2809,2810,2811,2812,2808,2809,2810,2811,2812,0,0,0,2034, 27 | 2108,0,0,0,0,0,0,0,0,0,0,0,0,0,2071, 28 | 2145,0,0,0,0,0,0,0,0,0,0,0,0,0,2108, 29 | 1960,0,0,0,0,0,0,0,0,0,0,0,0,0,2145, 30 | 1997,1999,2000,2001,2002,2003,2003,2003,2003,2003,2003,2003,2003,2003,2182 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 43 | 0,0,0,0,0,0,0,2651,2652,2653,2654,2655,2656,2657,0, 44 | 0,0,0,0,0,0,0,2688,2689,2690,2691,2692,2693,2694,0, 45 | 0,0,0,0,0,0,0,2725,2726,2727,2728,2729,2730,2731,0, 46 | 0,0,0,0,0,0,0,2762,2763,2764,2765,2766,2767,2768,0, 47 | 0,0,0,0,0,0,0,2799,2800,2801,2802,2803,2804,2805,0, 48 | 0,0,0,0,0,0,0,2836,2837,2838,2839,2840,2841,2842,0, 49 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 50 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 51 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 52 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 53 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 54 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 55 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 56 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 57 | 58 | 59 | 60 | -------------------------------------------------------------------------------- /examples/maze_runner/data/wrbc.tsx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /examples/maze_runner/images/erik.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ducandu/spygame/5caac137e718cae24788784ec5558270e7613801/examples/maze_runner/images/erik.png -------------------------------------------------------------------------------- /examples/maze_runner/images/generic.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ducandu/spygame/5caac137e718cae24788784ec5558270e7613801/examples/maze_runner/images/generic.png -------------------------------------------------------------------------------- /examples/maze_runner/images/wrbc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ducandu/spygame/5caac137e718cae24788784ec5558270e7613801/examples/maze_runner/images/wrbc.png -------------------------------------------------------------------------------- /examples/maze_runner/maze_runner.py: -------------------------------------------------------------------------------- 1 | """ 2 | ------------------------------------------------------------------------- 3 | spygame - maze_runner.py 4 | 5 | a simple maze-runner demo 6 | 7 | all you need to run this example are the files in: 8 | data/ 9 | images/ 10 | from www.github.com/sven1977/spygame/tree/master/examples/maze_runner 11 | 12 | created: 2017/06/11 in PyCharm 13 | (c) 2017 Sven - ducandu GmbH 14 | ------------------------------------------------------------------------- 15 | """ 16 | 17 | import spygame as spyg 18 | 19 | 20 | class MyAgent(spyg.Sprite): 21 | def __init__(self, x, y): 22 | super().__init__(x, y, sprite_sheet=spyg.SpriteSheet("data/erik.tsx"), tile=0) 23 | 24 | # some custom settings 25 | self.handles_own_collisions = True # our agent handles its own collisions (instead of letting the Stage do it for us) 26 | # add a HumanPlayerBrain for keyboard input handling 27 | self.cmp_brain = self.add_component(spyg.SimpleHumanBrain("brain", ["up", "down", "left", "right"])) 28 | # add a physics component to physics handling (here we use: simple 2D top-down view and controls) 29 | self.cmp_physics = self.add_component(spyg.TopDownPhysics("physics")) 30 | 31 | # plain spyg.Sprite objects do not implement the `tick` function, so nothing ever happens with them 32 | # - we need to implement it here to make sure our components (brain and physics) are ticked as well 33 | def tick(self, game_loop): 34 | self.cmp_brain.tick(game_loop) 35 | self.cmp_physics.tick(game_loop) 36 | 37 | 38 | if __name__ == "__main__": 39 | # create a spyg.Game object 40 | game = spyg.Game(screens_and_levels=[ 41 | # the only level 42 | { 43 | "class": spyg.Level, "name": "MAZE", "id": 1, # <- this will read the data/maze.tmx file for the level's layout and setup data 44 | }, 45 | 46 | # add more of your levels here 47 | # { ... }, 48 | 49 | ], title="The Maze Runner - An A-maze-ing Game :)") 50 | 51 | # that's it, play one of the levels -> this will enter an endless game loop 52 | game.levels_by_name["MAZE"].play() 53 | -------------------------------------------------------------------------------- /examples/maze_runner/screen1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ducandu/spygame/5caac137e718cae24788784ec5558270e7613801/examples/maze_runner/screen1.png -------------------------------------------------------------------------------- /examples/platformer_2d/data/baleog.tsx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /examples/platformer_2d/data/coconut.tsx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /examples/platformer_2d/data/egpt.tsx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | 216 | 217 | 218 | 219 | 220 | 221 | 222 | 223 | 224 | 225 | 226 | 227 | 228 | 229 | 230 | 231 | 232 | 233 | 234 | 235 | 236 | 237 | 238 | 239 | 240 | 241 | 242 | 243 | 244 | 245 | 246 | 247 | 248 | 249 | 250 | 251 | 252 | 253 | 254 | 255 | -------------------------------------------------------------------------------- /examples/platformer_2d/data/elevator.tsx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /examples/platformer_2d/data/enemies.tsx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /examples/platformer_2d/data/erik.tsx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /examples/platformer_2d/data/generic.tsx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | -------------------------------------------------------------------------------- /examples/platformer_2d/data/llm0.tsx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | -------------------------------------------------------------------------------- /examples/platformer_2d/data/lv_jlly.tsx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /examples/platformer_2d/data/movable_rock.tsx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /examples/platformer_2d/data/obsolete_arrow.tsx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /examples/platformer_2d/data/olaf.tsx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /examples/platformer_2d/data/scorpion.tsx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /examples/platformer_2d/data/scorpion_shot.tsx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /examples/platformer_2d/data/scorpionshot.tsx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /examples/platformer_2d/data/slope_test.tmx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 21 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 22 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,0,0,0,0,0,0, 23 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,6,7,8,0,0,0,0,0,0,0,0, 24 | 0,0,7,0,0,0,0,0,6,2,0,0,0,3,2,10,11,0,3,0,0,0,0,0,0,0,0,0,0,0, 25 | 2,2,2,2,2,2,2,2,2,2,2,2,2,0,0,0,0,2,2,2,2,2,2,2,2,0,0,0,0,0, 26 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 27 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 28 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 29 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 30 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 31 | 0,0,0,0,0,0,0,0,0,0,6,7,8,10,11,0,0,0,0,0,0,0,0,0,3,12,13,14,0,0, 32 | 0,0,0,0,0,2,2,2,2,2,0,0,0,0,0,2,2,2,2,2,2,2,2,2,0,0,0,0,2,2, 33 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 34 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 35 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 36 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 37 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,2,9,0,0, 38 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0, 39 | 0,0,0,0,4,5,10,11,0,0,0,0,6,7,8,12,13,14,0,0,0,0,0,3,0,0,0,0,0,0, 40 | 2,2,2,2,0,0,0,0,2,2,2,2,0,0,0,0,0,0,2,2,2,2,2,0,0,2,2,2,0,0, 41 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 42 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 43 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 44 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 45 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 46 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,11,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 47 | 0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,0,9,0,0,0,0,0,0,0,0,0,0,0,0,0, 48 | 0,0,3,9,0,0,3,2,9,0,0,0,3,0,0,0,0,9,0,4,5,2,0,0,3,9,3,9,0,0, 49 | 2,2,0,0,2,2,0,0,0,2,2,2,0,0,0,0,0,0,2,0,0,0,2,2,0,0,0,0,2,2 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | -------------------------------------------------------------------------------- /examples/platformer_2d/data/test_aibrain.tmx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 15 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 16 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 17 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 18 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 19 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 20 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 21 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 22 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 23 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 24 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 25 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2, 26 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2, 27 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2, 28 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2, 29 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2, 30 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0, 31 | 0,0,0,0,3,2,2,2,2,2,2,2,2,2,2,2,2,2,12,13,14,0,0,0,0,0,4,5,0,0, 32 | 0,0,0,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,12,13,14,4,5,0,0,0,0, 33 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 34 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 35 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 36 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 37 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 38 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 39 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 40 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 41 | 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2, 42 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 43 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | -------------------------------------------------------------------------------- /examples/platformer_2d/data/wrbc.tsx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | 216 | 217 | 218 | 219 | 220 | 221 | 222 | 223 | 224 | 225 | 226 | 227 | 228 | 229 | 230 | 231 | 232 | 233 | 234 | 235 | 236 | 237 | 238 | 239 | 240 | 241 | 242 | 243 | 244 | 245 | 246 | 247 | 248 | 249 | 250 | 251 | 252 | 253 | 254 | 255 | 256 | 257 | 258 | 259 | 260 | -------------------------------------------------------------------------------- /examples/platformer_2d/images/arrow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ducandu/spygame/5caac137e718cae24788784ec5558270e7613801/examples/platformer_2d/images/arrow.png -------------------------------------------------------------------------------- /examples/platformer_2d/images/baleog.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ducandu/spygame/5caac137e718cae24788784ec5558270e7613801/examples/platformer_2d/images/baleog.png -------------------------------------------------------------------------------- /examples/platformer_2d/images/coconut.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ducandu/spygame/5caac137e718cae24788784ec5558270e7613801/examples/platformer_2d/images/coconut.png -------------------------------------------------------------------------------- /examples/platformer_2d/images/debug.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ducandu/spygame/5caac137e718cae24788784ec5558270e7613801/examples/platformer_2d/images/debug.png -------------------------------------------------------------------------------- /examples/platformer_2d/images/egpt.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ducandu/spygame/5caac137e718cae24788784ec5558270e7613801/examples/platformer_2d/images/egpt.png -------------------------------------------------------------------------------- /examples/platformer_2d/images/elevator.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ducandu/spygame/5caac137e718cae24788784ec5558270e7613801/examples/platformer_2d/images/elevator.png -------------------------------------------------------------------------------- /examples/platformer_2d/images/enemies.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ducandu/spygame/5caac137e718cae24788784ec5558270e7613801/examples/platformer_2d/images/enemies.png -------------------------------------------------------------------------------- /examples/platformer_2d/images/erik.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ducandu/spygame/5caac137e718cae24788784ec5558270e7613801/examples/platformer_2d/images/erik.png -------------------------------------------------------------------------------- /examples/platformer_2d/images/generic.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ducandu/spygame/5caac137e718cae24788784ec5558270e7613801/examples/platformer_2d/images/generic.png -------------------------------------------------------------------------------- /examples/platformer_2d/images/llm0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ducandu/spygame/5caac137e718cae24788784ec5558270e7613801/examples/platformer_2d/images/llm0.png -------------------------------------------------------------------------------- /examples/platformer_2d/images/movable_rock.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ducandu/spygame/5caac137e718cae24788784ec5558270e7613801/examples/platformer_2d/images/movable_rock.png -------------------------------------------------------------------------------- /examples/platformer_2d/images/olaf.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ducandu/spygame/5caac137e718cae24788784ec5558270e7613801/examples/platformer_2d/images/olaf.png -------------------------------------------------------------------------------- /examples/platformer_2d/images/scorpion.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ducandu/spygame/5caac137e718cae24788784ec5558270e7613801/examples/platformer_2d/images/scorpion.png -------------------------------------------------------------------------------- /examples/platformer_2d/images/scorpion_shot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ducandu/spygame/5caac137e718cae24788784ec5558270e7613801/examples/platformer_2d/images/scorpion_shot.png -------------------------------------------------------------------------------- /examples/platformer_2d/images/tlv_items.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ducandu/spygame/5caac137e718cae24788784ec5558270e7613801/examples/platformer_2d/images/tlv_items.png -------------------------------------------------------------------------------- /examples/platformer_2d/images/tlv_level1_tileset.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ducandu/spygame/5caac137e718cae24788784ec5558270e7613801/examples/platformer_2d/images/tlv_level1_tileset.png -------------------------------------------------------------------------------- /examples/platformer_2d/images/tlv_map01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ducandu/spygame/5caac137e718cae24788784ec5558270e7613801/examples/platformer_2d/images/tlv_map01.png -------------------------------------------------------------------------------- /examples/platformer_2d/images/world1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ducandu/spygame/5caac137e718cae24788784ec5558270e7613801/examples/platformer_2d/images/world1.png -------------------------------------------------------------------------------- /examples/platformer_2d/images/world2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ducandu/spygame/5caac137e718cae24788784ec5558270e7613801/examples/platformer_2d/images/world2.png -------------------------------------------------------------------------------- /examples/platformer_2d/images/world3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ducandu/spygame/5caac137e718cae24788784ec5558270e7613801/examples/platformer_2d/images/world3.png -------------------------------------------------------------------------------- /examples/platformer_2d/images/wrbc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ducandu/spygame/5caac137e718cae24788784ec5558270e7613801/examples/platformer_2d/images/wrbc.png -------------------------------------------------------------------------------- /examples/platformer_2d/platformer_2d.py: -------------------------------------------------------------------------------- 1 | """ 2 | ------------------------------------------------------------------------- 3 | spygame - platformer_2d.py 4 | 5 | a 2D platformer demo (all graphics are (c) Blizzard Entertainment Inc) 6 | 7 | all you need to run this example are the files in: 8 | data/ 9 | images/ 10 | from www.github.com/sven1977/spygame/tree/master/examples/platformer_2d 11 | 12 | created: 2017/06/12 in PyCharm 13 | (c) 2017 Sven Mika - ducandu GmbH 14 | ------------------------------------------------------------------------- 15 | """ 16 | 17 | import spygame as spyg 18 | import spygame.examples.vikings as vik 19 | 20 | 21 | # main program 22 | if __name__ == "__main__": 23 | 24 | level = "WRBC" # make this match your tmx file (tmx-file's name in all upper case and without the .tmx extension) 25 | 26 | # create a spyg.Game object 27 | game = spyg.Game(screens_and_levels=[ 28 | # a level definition 29 | { 30 | "class": vik.VikingLevel, "name": level, "id": 1, 31 | }, 32 | 33 | # add more of your levels here 34 | # { ... }, 35 | 36 | ], #width=1200, height=380, 37 | # debug_flags=(spyg.DEBUG_DONT_RENDER_TILED_TILE_LAYERS | spyg.DEBUG_RENDER_COLLISION_TILES | spyg.DEBUG_RENDER_SPRITES_RECTS | spyg.DEBUG_RENDER_ACTIVE_COLLISION_TILES)) 38 | title="The Lost Vikings - Return of the Heroes :)") #, debug_flags=(spyg.DEBUG_DONT_RENDER_TILED_TILE_LAYERS | spyg.DEBUG_RENDER_COLLISION_TILES | spyg.DEBUG_RENDER_SPRITES_RECTS)) 39 | 40 | # that's it, play one of the levels -> this will enter an endless game loop 41 | game.levels_by_name[level].play() 42 | -------------------------------------------------------------------------------- /examples/platformer_2d/raw/baleog.xcf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ducandu/spygame/5caac137e718cae24788784ec5558270e7613801/examples/platformer_2d/raw/baleog.xcf -------------------------------------------------------------------------------- /examples/platformer_2d/raw/coconut.xcf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ducandu/spygame/5caac137e718cae24788784ec5558270e7613801/examples/platformer_2d/raw/coconut.xcf -------------------------------------------------------------------------------- /examples/platformer_2d/raw/egpt.xcf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ducandu/spygame/5caac137e718cae24788784ec5558270e7613801/examples/platformer_2d/raw/egpt.xcf -------------------------------------------------------------------------------- /examples/platformer_2d/raw/enemies.xcf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ducandu/spygame/5caac137e718cae24788784ec5558270e7613801/examples/platformer_2d/raw/enemies.xcf -------------------------------------------------------------------------------- /examples/platformer_2d/raw/erik.xcf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ducandu/spygame/5caac137e718cae24788784ec5558270e7613801/examples/platformer_2d/raw/erik.xcf -------------------------------------------------------------------------------- /examples/platformer_2d/raw/llm0.xcf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ducandu/spygame/5caac137e718cae24788784ec5558270e7613801/examples/platformer_2d/raw/llm0.xcf -------------------------------------------------------------------------------- /examples/platformer_2d/raw/olaf.xcf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ducandu/spygame/5caac137e718cae24788784ec5558270e7613801/examples/platformer_2d/raw/olaf.xcf -------------------------------------------------------------------------------- /examples/platformer_2d/raw/rainforest1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ducandu/spygame/5caac137e718cae24788784ec5558270e7613801/examples/platformer_2d/raw/rainforest1.jpg -------------------------------------------------------------------------------- /examples/platformer_2d/raw/world1.xcf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ducandu/spygame/5caac137e718cae24788784ec5558270e7613801/examples/platformer_2d/raw/world1.xcf -------------------------------------------------------------------------------- /examples/platformer_2d/screen1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ducandu/spygame/5caac137e718cae24788784ec5558270e7613801/examples/platformer_2d/screen1.png -------------------------------------------------------------------------------- /examples/platformer_2d/screen2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ducandu/spygame/5caac137e718cae24788784ec5558270e7613801/examples/platformer_2d/screen2.png -------------------------------------------------------------------------------- /examples/platformer_2d/screen3_tiled.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ducandu/spygame/5caac137e718cae24788784ec5558270e7613801/examples/platformer_2d/screen3_tiled.png -------------------------------------------------------------------------------- /examples/tutorial/data/erik.tsx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /examples/tutorial/data/tutorial.tmx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 29 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 30 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 31 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 32 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 33 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 34 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 35 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 36 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2, 37 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2, 38 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2, 39 | 2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2, 40 | 2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2, 41 | 2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2, 42 | 2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,2,2,0,0,0,2,2,2, 43 | 2,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,2, 44 | 2,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,2, 45 | 2,0,0,0,0,0,0,0,0,0,0,0,2,2,0,0,0,0,2,2,0,0,0,2, 46 | 2,0,0,0,0,0,0,0,0,0,0,2,0,2,0,0,0,0,2,2,0,0,0,2, 47 | 2,0,0,0,0,0,0,0,0,0,2,0,0,2,0,0,0,0,2,2,0,0,0,2, 48 | 2,2,2,2,2,2,2,2,2,2,0,0,0,2,2,2,2,2,2,2,2,2,2,2, 49 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 50 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 51 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 60 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 61 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2161,2162, 62 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2201,2202, 63 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2241,2242, 64 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2281,2282, 65 | 1861,1862,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2321,2322, 66 | 1901,1902,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2361,2362, 67 | 1941,1942,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1725, 68 | 1981,1982,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1765, 69 | 2021,2022,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1784, 70 | 1725,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1784, 71 | 1765,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1725, 72 | 1785,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1765, 73 | 1785,0,0,0,0,0,0,0,0,0,0,0,0,2168,2169,2170,2060,2061,1848,1848,1849,2481,2482,1784, 74 | 1785,0,0,0,0,0,0,0,0,0,0,0,2207,2208,2209,2249,1842,1843,1844,1841,1842,1843,1844,1784, 75 | 1725,0,0,0,0,0,0,0,0,0,2245,2246,2247,2248,2249,1881,1882,1883,1884,1881,1882,1883,1884,1784, 76 | 1765,0,0,0,0,0,0,0,0,0,2285,2286,2287,2288,1848,1849,1848,1849,1725,1725,1848,1848,1849,1725, 77 | 1785,0,0,0,0,0,0,0,0,2324,2325,2326,2327,1725,1841,1842,1843,1844,1765,1725,1848,1849,1849,1765, 78 | 1684,0,0,0,0,0,0,2089,0,2364,2365,2366,1778,1765,1881,1882,1883,1884,1765,1725,1848,1848,1849,1784, 79 | 1724,2485,2486,2487,2488,2489,2401,2402,2403,2404,1811,1811,1812,1784,1785,1785,1785,1785,1765,1765,1784,1785,1785,1785, 80 | 1686,2525,2526,2527,2528,2529,2441,2442,2443,2444,1732,1733,1734,1735,1733,1734,1735,1811,1812,1778,1732,1733,1734,1735, 81 | 1766,1767,1692,1693,1694,1695,1696,1697,1698,1811,1812,1773,1774,1775,1773,1774,1775,1696,1697,1732,1772,1773,1774,1775, 82 | 1767,1767,1732,1733,1734,1735,1736,1737,1738,1811,1812,1773,1774,1775,1733,1734,1735,1736,1737,1772,1773,1774,1811,1812 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 91 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 92 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 93 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 94 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 95 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 96 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 97 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 98 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 99 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 100 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 101 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 102 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 103 | 0,0,0,0,2250,2251,2252,2253,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 104 | 0,0,0,0,2290,2291,2292,2293,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 105 | 0,0,0,0,2330,2331,2332,2333,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 106 | 0,0,0,0,2370,2371,2372,2373,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 107 | 0,0,0,0,2410,2411,2412,2413,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 108 | 0,0,0,0,2450,2451,2452,2453,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 109 | 0,0,0,0,2490,2491,2492,2493,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 110 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 111 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 112 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 113 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 114 | 115 | 116 | 117 | 118 | 119 | 120 | -------------------------------------------------------------------------------- /examples/tutorial/images/baleog.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ducandu/spygame/5caac137e718cae24788784ec5558270e7613801/examples/tutorial/images/baleog.png -------------------------------------------------------------------------------- /examples/tutorial/images/egpt.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ducandu/spygame/5caac137e718cae24788784ec5558270e7613801/examples/tutorial/images/egpt.png -------------------------------------------------------------------------------- /examples/tutorial/images/elevator.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ducandu/spygame/5caac137e718cae24788784ec5558270e7613801/examples/tutorial/images/elevator.png -------------------------------------------------------------------------------- /examples/tutorial/images/enemies.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ducandu/spygame/5caac137e718cae24788784ec5558270e7613801/examples/tutorial/images/enemies.png -------------------------------------------------------------------------------- /examples/tutorial/images/erik.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ducandu/spygame/5caac137e718cae24788784ec5558270e7613801/examples/tutorial/images/erik.png -------------------------------------------------------------------------------- /examples/tutorial/images/generic.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ducandu/spygame/5caac137e718cae24788784ec5558270e7613801/examples/tutorial/images/generic.png -------------------------------------------------------------------------------- /examples/tutorial/images/movable_rock.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ducandu/spygame/5caac137e718cae24788784ec5558270e7613801/examples/tutorial/images/movable_rock.png -------------------------------------------------------------------------------- /examples/tutorial/images/olaf.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ducandu/spygame/5caac137e718cae24788784ec5558270e7613801/examples/tutorial/images/olaf.png -------------------------------------------------------------------------------- /examples/tutorial/images/world3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ducandu/spygame/5caac137e718cae24788784ec5558270e7613801/examples/tutorial/images/world3.png -------------------------------------------------------------------------------- /examples/tutorial/tutorial.py: -------------------------------------------------------------------------------- 1 | import spygame as spyg 2 | import spygame.examples.vikings as vik 3 | 4 | if __name__ == "__main__": 5 | # create a spyg.Game object 6 | game = spyg.Game(screens_and_levels=[ 7 | # the only level 8 | { 9 | "class": vik.VikingLevel, "name": "TUTORIAL", "id": 1, 10 | }, 11 | 12 | # add more of your levels here 13 | # { ... }, 14 | 15 | ], title="Erik's Trip to Egypt") 16 | 17 | game.levels_by_name["TUTORIAL"].play() 18 | 19 | -------------------------------------------------------------------------------- /examples/tutorial_advanced/data/baleog.tsx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /examples/tutorial_advanced/data/egpt.tsx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | 216 | 217 | 218 | 219 | 220 | 221 | 222 | 223 | 224 | 225 | 226 | 227 | 228 | 229 | 230 | 231 | 232 | 233 | 234 | 235 | 236 | 237 | 238 | 239 | 240 | 241 | 242 | 243 | 244 | 245 | 246 | 247 | 248 | 249 | 250 | 251 | 252 | 253 | 254 | 255 | 256 | 257 | 258 | 259 | 260 | 261 | 262 | 263 | 264 | 265 | 266 | 267 | 268 | 269 | 270 | 271 | 272 | 273 | 274 | 275 | 276 | 277 | 278 | 279 | 280 | 281 | 282 | 283 | 284 | 285 | 286 | 287 | 288 | 289 | -------------------------------------------------------------------------------- /examples/tutorial_advanced/data/enemies.tsx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /examples/tutorial_advanced/data/erik.tsx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /examples/tutorial_advanced/images/baleog.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ducandu/spygame/5caac137e718cae24788784ec5558270e7613801/examples/tutorial_advanced/images/baleog.png -------------------------------------------------------------------------------- /examples/tutorial_advanced/images/egpt.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ducandu/spygame/5caac137e718cae24788784ec5558270e7613801/examples/tutorial_advanced/images/egpt.png -------------------------------------------------------------------------------- /examples/tutorial_advanced/images/elevator.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ducandu/spygame/5caac137e718cae24788784ec5558270e7613801/examples/tutorial_advanced/images/elevator.png -------------------------------------------------------------------------------- /examples/tutorial_advanced/images/enemies.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ducandu/spygame/5caac137e718cae24788784ec5558270e7613801/examples/tutorial_advanced/images/enemies.png -------------------------------------------------------------------------------- /examples/tutorial_advanced/images/erik.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ducandu/spygame/5caac137e718cae24788784ec5558270e7613801/examples/tutorial_advanced/images/erik.png -------------------------------------------------------------------------------- /examples/tutorial_advanced/images/generic.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ducandu/spygame/5caac137e718cae24788784ec5558270e7613801/examples/tutorial_advanced/images/generic.png -------------------------------------------------------------------------------- /examples/tutorial_advanced/images/movable_rock.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ducandu/spygame/5caac137e718cae24788784ec5558270e7613801/examples/tutorial_advanced/images/movable_rock.png -------------------------------------------------------------------------------- /examples/tutorial_advanced/images/olaf.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ducandu/spygame/5caac137e718cae24788784ec5558270e7613801/examples/tutorial_advanced/images/olaf.png -------------------------------------------------------------------------------- /examples/tutorial_advanced/images/world3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ducandu/spygame/5caac137e718cae24788784ec5558270e7613801/examples/tutorial_advanced/images/world3.png -------------------------------------------------------------------------------- /examples/tutorial_advanced/tutorial.py: -------------------------------------------------------------------------------- 1 | import spygame as spyg 2 | import spygame.examples.vikings as vik 3 | 4 | if __name__ == "__main__": 5 | # create a spyg.Game object 6 | game = spyg.Game(screens_and_levels=[ 7 | # the only level 8 | { 9 | "class": vik.VikingLevel, "name": "TUTORIAL", "id": 1, 10 | }, 11 | 12 | # add more of your levels here 13 | # { ... }, 14 | 15 | ], title="Erik's and Baleog's Trip to Egypt") # , debug_flags=spyg.DEBUG_DONT_RENDER_TILED_TILE_LAYERS| spyg.DEBUG_RENDER_COLLISION_TILES | spyg.DEBUG_RENDER_SPRITES_RECTS) 16 | 17 | game.levels_by_name["TUTORIAL"].play() 18 | 19 | -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | pygame 2 | pytmx 3 | numpy -------------------------------------------------------------------------------- /setup.py: -------------------------------------------------------------------------------- 1 | from setuptools import setup, find_packages 2 | import os 3 | import spygame as spyg 4 | 5 | 6 | # Utility function to read the README file. 7 | # Used for the long_description. It's nice, because now 1) we have a top level 8 | # README file and 2) it's easier to type in the README file than to put a raw 9 | # string in below ... 10 | def read(file_name): 11 | return open(os.path.join(os.path.dirname(__file__), file_name)).read() 12 | 13 | setup( 14 | name="spygame", 15 | version=spyg.RELEASE_, 16 | packages=find_packages(), 17 | url="http://www.github.com/sven1977/spygame", 18 | download_url="https://github.com/sven1977/spygame/archive/spygame-"+spyg.VERSION_+".zip", 19 | license="MIT", 20 | author="Sven Mika", 21 | author_email="sven.mika@ducandu.com", 22 | description="2D game engine based on pygame and level-tmx files (soon to be: fully openAI gym integrated)", 23 | long_description=read("README.rst"), 24 | install_requires=["pygame", "pytmx", "numpy"], 25 | keywords=["python-3", "pygame", "2d-game-engine", "tmx-files", "game-engine-library", "reinforcement-learning", 26 | "openai-gym", "openai-rllab", "game-engine", "the-lost-vikings", "lost-viking-game"], 27 | ) 28 | -------------------------------------------------------------------------------- /spygame/examples/__init__.py: -------------------------------------------------------------------------------- 1 | """ 2 | ------------------------------------------------------------------------- 3 | spygame - __init__.py 4 | 5 | created: 2017/07/05 in PyCharm 6 | (c) 2017 Sven - ducandu GmbH 7 | ------------------------------------------------------------------------- 8 | """ 9 | 10 | 11 | --------------------------------------------------------------------------------