├── examples ├── audio.py ├── events.py ├── input.py ├── rects.py ├── video.py ├── sprites.py ├── resources │ ├── hud │ │ ├── hud0.png │ │ ├── hud1.png │ │ ├── hud2.png │ │ ├── hud3.png │ │ ├── hud4.png │ │ ├── hud5.png │ │ ├── hud6.png │ │ ├── hud7.png │ │ ├── hud8.png │ │ ├── hud9.png │ │ ├── hudX.png │ │ ├── hudCoin.png │ │ ├── hudKey_blue.png │ │ ├── hudKey_red.png │ │ ├── hudHeart_empty.png │ │ ├── hudHeart_full.png │ │ ├── hudHeart_half.png │ │ ├── hudJewel_blue.png │ │ ├── hudJewel_green.png │ │ ├── hudJewel_red.png │ │ ├── hudKey_green.png │ │ ├── hudKey_yellow.png │ │ ├── hudPlayer_blue.png │ │ ├── hudPlayer_pink.png │ │ ├── hudJewel_yellow.png │ │ ├── hudKey_red_empty.png │ │ ├── hudPlayer_beige.png │ │ ├── hudPlayer_green.png │ │ ├── hudPlayer_yellow.png │ │ ├── hudJewel_blue_empty.png │ │ ├── hudJewel_red_empty.png │ │ ├── hudKey_blue_empty.png │ │ ├── hudKey_green_empty.png │ │ ├── hudKey_yellow_empty.png │ │ ├── hudJewel_green_empty.png │ │ └── hudJewel_yellow_empty.png │ ├── pygame2.png │ ├── items │ │ ├── star.png │ │ ├── gemBlue.png │ │ ├── gemRed.png │ │ ├── keyBlue.png │ │ ├── keyRed.png │ │ ├── coinGold.png │ │ ├── flagBlue1.png │ │ ├── flagBlue2.png │ │ ├── flagRed1.png │ │ ├── flagRed2.png │ │ ├── gemGreen.png │ │ ├── gemYellow.png │ │ ├── keyGreen.png │ │ ├── keyYellow.png │ │ ├── coinBronze.png │ │ ├── coinSilver.png │ │ ├── flagGreen1.png │ │ ├── flagGreen2.png │ │ ├── flagRed_down.png │ │ ├── flagYellow1.png │ │ ├── flagYellow2.png │ │ ├── flagBlue_down.png │ │ ├── flagGreen_down.png │ │ └── flagYellow_down.png │ ├── tiles │ │ ├── bomb.png │ │ ├── bush.png │ │ ├── lava.png │ │ ├── rock.png │ │ ├── sign.png │ │ ├── snow.png │ │ ├── boxCoin.png │ │ ├── boxItem.png │ │ ├── bridgeA.png │ │ ├── bridgeB.png │ │ ├── cactus.png │ │ ├── chain.png │ │ ├── fence.png │ │ ├── grass.png │ │ ├── lockRed.png │ │ ├── spikes.png │ │ ├── spring.png │ │ ├── sprung.png │ │ ├── torch1.png │ │ ├── torch2.png │ │ ├── water.png │ │ ├── weight.png │ │ ├── window.png │ │ ├── bombWhite.png │ │ ├── boxCrate.png │ │ ├── brickGrey.png │ │ ├── ladderMid.png │ │ ├── ladderTop.png │ │ ├── leverLeft.png │ │ ├── leverMid.png │ │ ├── lockBlue.png │ │ ├── lockGreen.png │ │ ├── signExit.png │ │ ├── signLeft.png │ │ ├── signRight.png │ │ ├── switchRed.png │ │ ├── torchOff.png │ │ ├── boxExplosive.png │ │ ├── brickBrown.png │ │ ├── doorOpen_mid.png │ │ ├── doorOpen_top.png │ │ ├── fenceBroken.png │ │ ├── lavaTop_high.png │ │ ├── lavaTop_low.png │ │ ├── leverRight.png │ │ ├── lockYellow.png │ │ ├── mushroomRed.png │ │ ├── plantPurple.png │ │ ├── switchBlue.png │ │ ├── switchGreen.png │ │ ├── switchYellow.png │ │ ├── waterTop_low.png │ │ ├── boxCoin_boxed.png │ │ ├── boxItem_boxed.png │ │ ├── doorClosed_mid.png │ │ ├── doorClosed_top.png │ │ ├── mushroomBrown.png │ │ ├── waterTop_high.png │ │ ├── weightAttached.png │ │ ├── boxCoin_disabled.png │ │ ├── boxCrate_double.png │ │ ├── boxCrate_single.png │ │ ├── boxCrate_warning.png │ │ ├── boxExplosive_used.png │ │ ├── boxItem_disabled.png │ │ ├── switchRed_pressed.png │ │ ├── switchBlue_pressed.png │ │ ├── switchGreen_pressed.png │ │ ├── boxCoin_disabled_boxed.png │ │ ├── boxExplosive_disabled.png │ │ ├── boxItem_disabled_boxed.png │ │ └── switchYellow_pressed.png │ ├── enemies │ │ ├── bee.png │ │ ├── fly.png │ │ ├── frog.png │ │ ├── mouse.png │ │ ├── saw.png │ │ ├── snail.png │ │ ├── sawHalf.png │ │ ├── barnacle.png │ │ ├── bee_dead.png │ │ ├── bee_move.png │ │ ├── fishBlue.png │ │ ├── fishGreen.png │ │ ├── fishPink.png │ │ ├── fly_dead.png │ │ ├── fly_move.png │ │ ├── frog_dead.png │ │ ├── frog_move.png │ │ ├── mouse_dead.png │ │ ├── mouse_move.png │ │ ├── saw_dead.png │ │ ├── saw_move.png │ │ ├── slimeBlock.png │ │ ├── slimeBlue.png │ │ ├── slimeGreen.png │ │ ├── snail_move.png │ │ ├── wormGreen.png │ │ ├── wormPink.png │ │ ├── sawHalf_dead.png │ │ ├── sawHalf_move.png │ │ ├── slimePurple.png │ │ ├── snail_shell.png │ │ ├── barnacle_attack.png │ │ ├── barnacle_dead.png │ │ ├── fishBlue_dead.png │ │ ├── fishBlue_fall.png │ │ ├── fishGreen_dead.png │ │ ├── fishGreen_move.png │ │ ├── fishPink_dead.png │ │ ├── fishPink_move.png │ │ ├── slimeBlock_dead.png │ │ ├── slimeBlock_move.png │ │ ├── slimeBlue_dead.png │ │ ├── slimeBlue_hit.png │ │ ├── slimeBlue_move.png │ │ ├── slimeGreen_dead.png │ │ ├── slimeGreen_hit.png │ │ ├── slimeGreen_move.png │ │ ├── slimePurple_hit.png │ │ ├── wormGreen_dead.png │ │ ├── wormGreen_move.png │ │ ├── wormPink_dead.png │ │ ├── wormPink_move.png │ │ ├── slimePurple_dead.png │ │ └── slimePurple_move.png │ ├── pygame2-nologo.png │ ├── backgrounds │ │ ├── Thumbs.db │ │ ├── blue_desert.png │ │ ├── blue_grass.png │ │ ├── blue_land.png │ │ ├── blue_shroom.png │ │ ├── colored_grass.png │ │ ├── colored_land.png │ │ ├── colored_desert.png │ │ └── colored_shroom.png │ ├── ground │ │ ├── Dirt │ │ │ ├── dirt.png │ │ │ ├── dirtHalf.png │ │ │ ├── dirtLeft.png │ │ │ ├── dirtMid.png │ │ │ ├── dirtCenter.png │ │ │ ├── dirtRight.png │ │ │ ├── dirtHalf_left.png │ │ │ ├── dirtHalf_mid.png │ │ │ ├── dirtHill_left.png │ │ │ ├── dirtCliff_left.png │ │ │ ├── dirtCliff_right.png │ │ │ ├── dirtCorner_left.png │ │ │ ├── dirtCorner_right.png │ │ │ ├── dirtHalf_right.png │ │ │ ├── dirtHill_right.png │ │ │ ├── dirtCenter_rounded.png │ │ │ ├── dirtCliffAlt_left.png │ │ │ └── dirtCliffAlt_right.png │ │ ├── Grass │ │ │ ├── grass.png │ │ │ ├── grassHalf.png │ │ │ ├── grassLeft.png │ │ │ ├── grassMid.png │ │ │ ├── grassRight.png │ │ │ ├── grassCenter.png │ │ │ ├── grassCliff_left.png │ │ │ ├── grassHalf_left.png │ │ │ ├── grassHalf_mid.png │ │ │ ├── grassHalf_right.png │ │ │ ├── grassHill_left.png │ │ │ ├── grassHill_right.png │ │ │ ├── grassCenter_round.png │ │ │ ├── grassCliff_right.png │ │ │ ├── grassCorner_left.png │ │ │ ├── grassCorner_right.png │ │ │ ├── grassCliffAlt_left.png │ │ │ └── grassCliffAlt_right.png │ │ ├── Sand │ │ │ ├── sand.png │ │ │ ├── sandHalf.png │ │ │ ├── sandLeft.png │ │ │ ├── sandMid.png │ │ │ ├── sandCenter.png │ │ │ ├── sandRight.png │ │ │ ├── sandHalf_left.png │ │ │ ├── sandHalf_mid.png │ │ │ ├── sandHill_left.png │ │ │ ├── sandCliff_left.png │ │ │ ├── sandCliff_right.png │ │ │ ├── sandCorner_leftg.png │ │ │ ├── sandCorner_right.png │ │ │ ├── sandHalf_right.png │ │ │ ├── sandHill_right.png │ │ │ ├── sandCenter_rounded.png │ │ │ ├── sandCliffAlt_left.png │ │ │ └── sandCliffAlt_right.png │ │ ├── Snow │ │ │ ├── snow.png │ │ │ ├── snowHalf.png │ │ │ ├── snowLeft.png │ │ │ ├── snowMid.png │ │ │ ├── snowCenter.png │ │ │ ├── snowRight.png │ │ │ ├── snowHalf_left.png │ │ │ ├── snowHalf_mid.png │ │ │ ├── snowHill_left.png │ │ │ ├── snowCliff_left.png │ │ │ ├── snowCliff_right.png │ │ │ ├── snowCorner_left.png │ │ │ ├── snowCorner_right.png │ │ │ ├── snowHalf_right.png │ │ │ ├── snowHill_right.png │ │ │ ├── snowCenter_rounded.png │ │ │ ├── snowCliffAlt_left.png │ │ │ └── snowCliffAlt_right.png │ │ ├── Stone │ │ │ ├── stone.png │ │ │ ├── stoneHalf.png │ │ │ ├── stoneLeft.png │ │ │ ├── stoneMid.png │ │ │ ├── stoneRight.png │ │ │ ├── stoneCenter.png │ │ │ ├── stoneCliff_left.png │ │ │ ├── stoneHalf_left.png │ │ │ ├── stoneHalf_mid.png │ │ │ ├── stoneHalf_right.png │ │ │ ├── stoneHill_left.png │ │ │ ├── stoneHill_right.png │ │ │ ├── stoneCliff_right.png │ │ │ ├── stoneCorner_left.png │ │ │ ├── stoneCorner_right.png │ │ │ ├── stoneCenter_rounded.png │ │ │ ├── stoneCliffAlt_left.png │ │ │ └── stoneCliffAlt_right.png │ │ └── Planet │ │ │ ├── planet.png │ │ │ ├── planetMid.png │ │ │ ├── planetHalf.png │ │ │ ├── planetLeft.png │ │ │ ├── planetRight.png │ │ │ ├── planetCenter.png │ │ │ ├── planetHalf_mid.png │ │ │ ├── planetCliff_left.png │ │ │ ├── planetHalf_left.png │ │ │ ├── planetHalf_right.png │ │ │ ├── planetHill_left.png │ │ │ ├── planetHill_right.png │ │ │ ├── planetCliffAlt_left.png │ │ │ ├── planetCliff_right.png │ │ │ ├── planetCorner_left.png │ │ │ ├── planetCorner_right.png │ │ │ ├── planetCenter_rounded.png │ │ │ └── planetCliffAlt_right.png │ ├── particles │ │ ├── fireball.png │ │ ├── brickBrown.png │ │ └── brickGrey.png │ └── players │ │ ├── Beige │ │ ├── alienBeige_hit.png │ │ ├── alienBeige_duck.png │ │ ├── alienBeige_front.png │ │ ├── alienBeige_jump.png │ │ ├── alienBeige_stand.png │ │ ├── alienBeige_swim1.png │ │ ├── alienBeige_swim2.png │ │ ├── alienBeige_walk1.png │ │ ├── alienBeige_walk2.png │ │ ├── alienBeige_climb1.png │ │ └── alienBeige_climb2.png │ │ ├── Blue │ │ ├── alienBlue_duck.png │ │ ├── alienBlue_front.png │ │ ├── alienBlue_hit.png │ │ ├── alienBlue_jump.png │ │ ├── alienBlue_stand.png │ │ ├── alienBlue_swim1.png │ │ ├── alienBlue_swim2.png │ │ ├── alienBlue_walk1.png │ │ ├── alienBlue_walk2.png │ │ ├── alienBlue_climb1.png │ │ └── alienBlue_climb2.png │ │ ├── Green │ │ ├── alienGreen_hit.png │ │ ├── alienGreen_duck.png │ │ ├── alienGreen_front.png │ │ ├── alienGreen_jump.png │ │ ├── alienGreen_stand.png │ │ ├── alienGreen_swim1.png │ │ ├── alienGreen_swim2.png │ │ ├── alienGreen_walk1.png │ │ ├── alienGreen_walk2.png │ │ ├── alienGreen_climb1.png │ │ └── alienGreen_climb2.png │ │ ├── Pink │ │ ├── alienPink_duck.png │ │ ├── alienPink_front.png │ │ ├── alienPink_hit.png │ │ ├── alienPink_jump.png │ │ ├── alienPink_stand.png │ │ ├── alienPink_swim1.png │ │ ├── alienPink_swim2.png │ │ ├── alienPink_walk1.png │ │ ├── alienPink_walk2.png │ │ ├── alienPink_climb1.png │ │ └── alienPink_climb2.png │ │ └── Yellow │ │ ├── alienYellow_hit.png │ │ ├── alienYellow_climb1.png │ │ ├── alienYellow_climb2.png │ │ ├── alienYellow_duck.png │ │ ├── alienYellow_front.png │ │ ├── alienYellow_jump.png │ │ ├── alienYellow_stand.png │ │ ├── alienYellow_swim1.png │ │ ├── alienYellow_swim2.png │ │ ├── alienYellow_walk1.png │ │ └── alienYellow_walk2.png ├── demos │ ├── chimp │ │ └── data │ │ │ ├── chimp.bmp │ │ │ ├── fist.bmp │ │ │ ├── punch.wav │ │ │ └── whiff.wav │ └── platformer │ │ └── platformer.py └── logo-spin.py ├── pygame2 ├── devtools │ ├── __init__.py │ ├── __main__.py │ └── cli.py ├── core │ ├── audio │ │ ├── audio_pysdl2.py │ │ ├── audio_fmod.py │ │ └── __init__.py │ ├── platform │ │ ├── platform_pysdl2.py │ │ ├── __init__.py │ │ └── platform_pyglet.py │ ├── input │ │ ├── input_xinput.py │ │ ├── input_pyglet.py │ │ └── __init__.py │ ├── graphics │ │ └── __init__.py │ ├── __init__.py │ └── image │ │ ├── image_pysdl2.py │ │ ├── image_pyglet.py │ │ └── image_pillow.py ├── .coverage ├── docs │ └── coverage │ │ ├── keybd_open.png │ │ ├── keybd_closed.png │ │ ├── jquery.isonscreen.js │ │ ├── pygame2_tests.html │ │ └── pygame2_window.html ├── actor.py ├── input │ ├── mouse.py │ ├── touch.py │ ├── keyboard.py │ ├── gamepad.py │ └── __init__.py ├── graphics │ ├── fragment_shader.glsl │ ├── vertex_shader.glsl │ └── texture.py ├── resources.py ├── node.py ├── screen.py ├── __init__.py ├── display.py ├── audio.py ├── app.py ├── surface.py └── window.py ├── .coverage ├── tests ├── pygame2.bmp ├── pygame2.gif ├── pygame2.jpg ├── pygame2.png ├── docs │ └── coverage │ │ ├── status.dat │ │ ├── keybd_closed.png │ │ ├── keybd_open.png │ │ ├── jquery.isonscreen.js │ │ ├── pygame2_tests.html │ │ └── jquery.hotkeys.js ├── test_key.py ├── test_image.py ├── test_time.py ├── test_surface.py ├── integration │ └── image.py ├── test_sprite.py └── test_window.py ├── .gitignore ├── docs ├── surface-display.dia ├── build │ ├── html │ │ ├── objects.inv │ │ ├── _static │ │ │ ├── up.png │ │ │ ├── down.png │ │ │ ├── file.png │ │ │ ├── minus.png │ │ │ ├── plus.png │ │ │ ├── comment.png │ │ │ ├── up-pressed.png │ │ │ ├── ajax-loader.gif │ │ │ ├── comment-close.png │ │ │ ├── down-pressed.png │ │ │ ├── comment-bright.png │ │ │ └── pygments.css │ │ ├── _sources │ │ │ ├── modules.txt │ │ │ ├── pygame2.rect.txt │ │ │ ├── pygame2.txt │ │ │ └── index.txt │ │ ├── .buildinfo │ │ ├── _modules │ │ │ └── index.html │ │ └── search.html │ └── doctrees │ │ ├── index.doctree │ │ ├── modules.doctree │ │ ├── pygame2.doctree │ │ ├── environment.pickle │ │ ├── pygame2.color.doctree │ │ └── pygame2.rect.doctree └── source │ ├── modules.rst │ ├── pygame2.rect.rst │ ├── pygame2.color.rst │ ├── pygame2.core.graphics.rst │ ├── pygame2.rst │ ├── pygame2.core.rst │ ├── pygame2.graphics.rst │ ├── pygame2.core.audio.rst │ ├── pygame2.core.input.rst │ ├── pygame2.core.platform.rst │ ├── pygame2.core.image.rst │ ├── pygame2.input.rst │ └── index.rst ├── setup.py ├── tox.ini ├── setup.cfg ├── README.md ├── requirements.txt ├── .travis.yml └── notes.md /examples/audio.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /examples/events.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /examples/input.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /examples/rects.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /examples/video.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /examples/sprites.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /pygame2/devtools/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /pygame2/core/audio/audio_pysdl2.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.coverage: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/.coverage -------------------------------------------------------------------------------- /pygame2/.coverage: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/pygame2/.coverage -------------------------------------------------------------------------------- /tests/pygame2.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/tests/pygame2.bmp -------------------------------------------------------------------------------- /tests/pygame2.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/tests/pygame2.gif -------------------------------------------------------------------------------- /tests/pygame2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/tests/pygame2.jpg -------------------------------------------------------------------------------- /tests/pygame2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/tests/pygame2.png -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | __pycache__ 2 | *.pyc 3 | *.pyo 4 | .idea 5 | docs/coverage 6 | .coverage 7 | *~ -------------------------------------------------------------------------------- /docs/surface-display.dia: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/docs/surface-display.dia -------------------------------------------------------------------------------- /docs/build/html/objects.inv: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/docs/build/html/objects.inv -------------------------------------------------------------------------------- /docs/build/html/_static/up.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/docs/build/html/_static/up.png -------------------------------------------------------------------------------- /docs/source/modules.rst: -------------------------------------------------------------------------------- 1 | pygame2 2 | ======= 3 | 4 | .. toctree:: 5 | :maxdepth: 4 6 | 7 | pygame2 8 | -------------------------------------------------------------------------------- /examples/resources/hud/hud0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/hud/hud0.png -------------------------------------------------------------------------------- /examples/resources/hud/hud1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/hud/hud1.png -------------------------------------------------------------------------------- /examples/resources/hud/hud2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/hud/hud2.png -------------------------------------------------------------------------------- /examples/resources/hud/hud3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/hud/hud3.png -------------------------------------------------------------------------------- /examples/resources/hud/hud4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/hud/hud4.png -------------------------------------------------------------------------------- /examples/resources/hud/hud5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/hud/hud5.png -------------------------------------------------------------------------------- /examples/resources/hud/hud6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/hud/hud6.png -------------------------------------------------------------------------------- /examples/resources/hud/hud7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/hud/hud7.png -------------------------------------------------------------------------------- /examples/resources/hud/hud8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/hud/hud8.png -------------------------------------------------------------------------------- /examples/resources/hud/hud9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/hud/hud9.png -------------------------------------------------------------------------------- /examples/resources/hud/hudX.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/hud/hudX.png -------------------------------------------------------------------------------- /examples/resources/pygame2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/pygame2.png -------------------------------------------------------------------------------- /tests/docs/coverage/status.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/tests/docs/coverage/status.dat -------------------------------------------------------------------------------- /docs/build/doctrees/index.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/docs/build/doctrees/index.doctree -------------------------------------------------------------------------------- /docs/build/html/_static/down.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/docs/build/html/_static/down.png -------------------------------------------------------------------------------- /docs/build/html/_static/file.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/docs/build/html/_static/file.png -------------------------------------------------------------------------------- /docs/build/html/_static/minus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/docs/build/html/_static/minus.png -------------------------------------------------------------------------------- /docs/build/html/_static/plus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/docs/build/html/_static/plus.png -------------------------------------------------------------------------------- /examples/resources/items/star.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/items/star.png -------------------------------------------------------------------------------- /examples/resources/tiles/bomb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/tiles/bomb.png -------------------------------------------------------------------------------- /examples/resources/tiles/bush.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/tiles/bush.png -------------------------------------------------------------------------------- /examples/resources/tiles/lava.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/tiles/lava.png -------------------------------------------------------------------------------- /examples/resources/tiles/rock.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/tiles/rock.png -------------------------------------------------------------------------------- /examples/resources/tiles/sign.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/tiles/sign.png -------------------------------------------------------------------------------- /examples/resources/tiles/snow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/tiles/snow.png -------------------------------------------------------------------------------- /docs/build/doctrees/modules.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/docs/build/doctrees/modules.doctree -------------------------------------------------------------------------------- /docs/build/doctrees/pygame2.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/docs/build/doctrees/pygame2.doctree -------------------------------------------------------------------------------- /docs/build/html/_sources/modules.txt: -------------------------------------------------------------------------------- 1 | pygame2 2 | ======= 3 | 4 | .. toctree:: 5 | :maxdepth: 4 6 | 7 | pygame2 8 | -------------------------------------------------------------------------------- /docs/build/html/_static/comment.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/docs/build/html/_static/comment.png -------------------------------------------------------------------------------- /examples/demos/chimp/data/chimp.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/demos/chimp/data/chimp.bmp -------------------------------------------------------------------------------- /examples/demos/chimp/data/fist.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/demos/chimp/data/fist.bmp -------------------------------------------------------------------------------- /examples/demos/chimp/data/punch.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/demos/chimp/data/punch.wav -------------------------------------------------------------------------------- /examples/demos/chimp/data/whiff.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/demos/chimp/data/whiff.wav -------------------------------------------------------------------------------- /examples/resources/enemies/bee.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/enemies/bee.png -------------------------------------------------------------------------------- /examples/resources/enemies/fly.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/enemies/fly.png -------------------------------------------------------------------------------- /examples/resources/enemies/frog.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/enemies/frog.png -------------------------------------------------------------------------------- /examples/resources/enemies/mouse.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/enemies/mouse.png -------------------------------------------------------------------------------- /examples/resources/enemies/saw.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/enemies/saw.png -------------------------------------------------------------------------------- /examples/resources/enemies/snail.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/enemies/snail.png -------------------------------------------------------------------------------- /examples/resources/hud/hudCoin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/hud/hudCoin.png -------------------------------------------------------------------------------- /examples/resources/items/gemBlue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/items/gemBlue.png -------------------------------------------------------------------------------- /examples/resources/items/gemRed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/items/gemRed.png -------------------------------------------------------------------------------- /examples/resources/items/keyBlue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/items/keyBlue.png -------------------------------------------------------------------------------- /examples/resources/items/keyRed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/items/keyRed.png -------------------------------------------------------------------------------- /examples/resources/tiles/boxCoin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/tiles/boxCoin.png -------------------------------------------------------------------------------- /examples/resources/tiles/boxItem.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/tiles/boxItem.png -------------------------------------------------------------------------------- /examples/resources/tiles/bridgeA.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/tiles/bridgeA.png -------------------------------------------------------------------------------- /examples/resources/tiles/bridgeB.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/tiles/bridgeB.png -------------------------------------------------------------------------------- /examples/resources/tiles/cactus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/tiles/cactus.png -------------------------------------------------------------------------------- /examples/resources/tiles/chain.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/tiles/chain.png -------------------------------------------------------------------------------- /examples/resources/tiles/fence.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/tiles/fence.png -------------------------------------------------------------------------------- /examples/resources/tiles/grass.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/tiles/grass.png -------------------------------------------------------------------------------- /examples/resources/tiles/lockRed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/tiles/lockRed.png -------------------------------------------------------------------------------- /examples/resources/tiles/spikes.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/tiles/spikes.png -------------------------------------------------------------------------------- /examples/resources/tiles/spring.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/tiles/spring.png -------------------------------------------------------------------------------- /examples/resources/tiles/sprung.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/tiles/sprung.png -------------------------------------------------------------------------------- /examples/resources/tiles/torch1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/tiles/torch1.png -------------------------------------------------------------------------------- /examples/resources/tiles/torch2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/tiles/torch2.png -------------------------------------------------------------------------------- /examples/resources/tiles/water.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/tiles/water.png -------------------------------------------------------------------------------- /examples/resources/tiles/weight.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/tiles/weight.png -------------------------------------------------------------------------------- /examples/resources/tiles/window.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/tiles/window.png -------------------------------------------------------------------------------- /pygame2/docs/coverage/keybd_open.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/pygame2/docs/coverage/keybd_open.png -------------------------------------------------------------------------------- /tests/docs/coverage/keybd_closed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/tests/docs/coverage/keybd_closed.png -------------------------------------------------------------------------------- /tests/docs/coverage/keybd_open.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/tests/docs/coverage/keybd_open.png -------------------------------------------------------------------------------- /docs/build/doctrees/environment.pickle: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/docs/build/doctrees/environment.pickle -------------------------------------------------------------------------------- /docs/build/html/_static/up-pressed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/docs/build/html/_static/up-pressed.png -------------------------------------------------------------------------------- /examples/resources/enemies/sawHalf.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/enemies/sawHalf.png -------------------------------------------------------------------------------- /examples/resources/hud/hudKey_blue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/hud/hudKey_blue.png -------------------------------------------------------------------------------- /examples/resources/hud/hudKey_red.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/hud/hudKey_red.png -------------------------------------------------------------------------------- /examples/resources/items/coinGold.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/items/coinGold.png -------------------------------------------------------------------------------- /examples/resources/items/flagBlue1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/items/flagBlue1.png -------------------------------------------------------------------------------- /examples/resources/items/flagBlue2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/items/flagBlue2.png -------------------------------------------------------------------------------- /examples/resources/items/flagRed1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/items/flagRed1.png -------------------------------------------------------------------------------- /examples/resources/items/flagRed2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/items/flagRed2.png -------------------------------------------------------------------------------- /examples/resources/items/gemGreen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/items/gemGreen.png -------------------------------------------------------------------------------- /examples/resources/items/gemYellow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/items/gemYellow.png -------------------------------------------------------------------------------- /examples/resources/items/keyGreen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/items/keyGreen.png -------------------------------------------------------------------------------- /examples/resources/items/keyYellow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/items/keyYellow.png -------------------------------------------------------------------------------- /examples/resources/pygame2-nologo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/pygame2-nologo.png -------------------------------------------------------------------------------- /examples/resources/tiles/bombWhite.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/tiles/bombWhite.png -------------------------------------------------------------------------------- /examples/resources/tiles/boxCrate.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/tiles/boxCrate.png -------------------------------------------------------------------------------- /examples/resources/tiles/brickGrey.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/tiles/brickGrey.png -------------------------------------------------------------------------------- /examples/resources/tiles/ladderMid.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/tiles/ladderMid.png -------------------------------------------------------------------------------- /examples/resources/tiles/ladderTop.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/tiles/ladderTop.png -------------------------------------------------------------------------------- /examples/resources/tiles/leverLeft.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/tiles/leverLeft.png -------------------------------------------------------------------------------- /examples/resources/tiles/leverMid.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/tiles/leverMid.png -------------------------------------------------------------------------------- /examples/resources/tiles/lockBlue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/tiles/lockBlue.png -------------------------------------------------------------------------------- /examples/resources/tiles/lockGreen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/tiles/lockGreen.png -------------------------------------------------------------------------------- /examples/resources/tiles/signExit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/tiles/signExit.png -------------------------------------------------------------------------------- /examples/resources/tiles/signLeft.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/tiles/signLeft.png -------------------------------------------------------------------------------- /examples/resources/tiles/signRight.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/tiles/signRight.png -------------------------------------------------------------------------------- /examples/resources/tiles/switchRed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/tiles/switchRed.png -------------------------------------------------------------------------------- /examples/resources/tiles/torchOff.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/tiles/torchOff.png -------------------------------------------------------------------------------- /pygame2/actor.py: -------------------------------------------------------------------------------- 1 | """ 2 | sprites are for graphics, actors are for behavior 3 | """ 4 | 5 | 6 | class Actor: 7 | pass 8 | -------------------------------------------------------------------------------- /pygame2/docs/coverage/keybd_closed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/pygame2/docs/coverage/keybd_closed.png -------------------------------------------------------------------------------- /docs/build/doctrees/pygame2.color.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/docs/build/doctrees/pygame2.color.doctree -------------------------------------------------------------------------------- /docs/build/doctrees/pygame2.rect.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/docs/build/doctrees/pygame2.rect.doctree -------------------------------------------------------------------------------- /docs/build/html/_static/ajax-loader.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/docs/build/html/_static/ajax-loader.gif -------------------------------------------------------------------------------- /docs/build/html/_static/comment-close.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/docs/build/html/_static/comment-close.png -------------------------------------------------------------------------------- /docs/build/html/_static/down-pressed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/docs/build/html/_static/down-pressed.png -------------------------------------------------------------------------------- /examples/resources/backgrounds/Thumbs.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/backgrounds/Thumbs.db -------------------------------------------------------------------------------- /examples/resources/enemies/barnacle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/enemies/barnacle.png -------------------------------------------------------------------------------- /examples/resources/enemies/bee_dead.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/enemies/bee_dead.png -------------------------------------------------------------------------------- /examples/resources/enemies/bee_move.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/enemies/bee_move.png -------------------------------------------------------------------------------- /examples/resources/enemies/fishBlue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/enemies/fishBlue.png -------------------------------------------------------------------------------- /examples/resources/enemies/fishGreen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/enemies/fishGreen.png -------------------------------------------------------------------------------- /examples/resources/enemies/fishPink.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/enemies/fishPink.png -------------------------------------------------------------------------------- /examples/resources/enemies/fly_dead.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/enemies/fly_dead.png -------------------------------------------------------------------------------- /examples/resources/enemies/fly_move.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/enemies/fly_move.png -------------------------------------------------------------------------------- /examples/resources/enemies/frog_dead.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/enemies/frog_dead.png -------------------------------------------------------------------------------- /examples/resources/enemies/frog_move.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/enemies/frog_move.png -------------------------------------------------------------------------------- /examples/resources/enemies/mouse_dead.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/enemies/mouse_dead.png -------------------------------------------------------------------------------- /examples/resources/enemies/mouse_move.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/enemies/mouse_move.png -------------------------------------------------------------------------------- /examples/resources/enemies/saw_dead.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/enemies/saw_dead.png -------------------------------------------------------------------------------- /examples/resources/enemies/saw_move.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/enemies/saw_move.png -------------------------------------------------------------------------------- /examples/resources/enemies/slimeBlock.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/enemies/slimeBlock.png -------------------------------------------------------------------------------- /examples/resources/enemies/slimeBlue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/enemies/slimeBlue.png -------------------------------------------------------------------------------- /examples/resources/enemies/slimeGreen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/enemies/slimeGreen.png -------------------------------------------------------------------------------- /examples/resources/enemies/snail_move.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/enemies/snail_move.png -------------------------------------------------------------------------------- /examples/resources/enemies/wormGreen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/enemies/wormGreen.png -------------------------------------------------------------------------------- /examples/resources/enemies/wormPink.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/enemies/wormPink.png -------------------------------------------------------------------------------- /examples/resources/ground/Dirt/dirt.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/ground/Dirt/dirt.png -------------------------------------------------------------------------------- /examples/resources/ground/Grass/grass.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/ground/Grass/grass.png -------------------------------------------------------------------------------- /examples/resources/ground/Sand/sand.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/ground/Sand/sand.png -------------------------------------------------------------------------------- /examples/resources/ground/Snow/snow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/ground/Snow/snow.png -------------------------------------------------------------------------------- /examples/resources/ground/Stone/stone.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/ground/Stone/stone.png -------------------------------------------------------------------------------- /examples/resources/hud/hudHeart_empty.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/hud/hudHeart_empty.png -------------------------------------------------------------------------------- /examples/resources/hud/hudHeart_full.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/hud/hudHeart_full.png -------------------------------------------------------------------------------- /examples/resources/hud/hudHeart_half.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/hud/hudHeart_half.png -------------------------------------------------------------------------------- /examples/resources/hud/hudJewel_blue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/hud/hudJewel_blue.png -------------------------------------------------------------------------------- /examples/resources/hud/hudJewel_green.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/hud/hudJewel_green.png -------------------------------------------------------------------------------- /examples/resources/hud/hudJewel_red.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/hud/hudJewel_red.png -------------------------------------------------------------------------------- /examples/resources/hud/hudKey_green.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/hud/hudKey_green.png -------------------------------------------------------------------------------- /examples/resources/hud/hudKey_yellow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/hud/hudKey_yellow.png -------------------------------------------------------------------------------- /examples/resources/hud/hudPlayer_blue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/hud/hudPlayer_blue.png -------------------------------------------------------------------------------- /examples/resources/hud/hudPlayer_pink.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/hud/hudPlayer_pink.png -------------------------------------------------------------------------------- /examples/resources/items/coinBronze.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/items/coinBronze.png -------------------------------------------------------------------------------- /examples/resources/items/coinSilver.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/items/coinSilver.png -------------------------------------------------------------------------------- /examples/resources/items/flagGreen1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/items/flagGreen1.png -------------------------------------------------------------------------------- /examples/resources/items/flagGreen2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/items/flagGreen2.png -------------------------------------------------------------------------------- /examples/resources/items/flagRed_down.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/items/flagRed_down.png -------------------------------------------------------------------------------- /examples/resources/items/flagYellow1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/items/flagYellow1.png -------------------------------------------------------------------------------- /examples/resources/items/flagYellow2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/items/flagYellow2.png -------------------------------------------------------------------------------- /examples/resources/particles/fireball.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/particles/fireball.png -------------------------------------------------------------------------------- /examples/resources/tiles/boxExplosive.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/tiles/boxExplosive.png -------------------------------------------------------------------------------- /examples/resources/tiles/brickBrown.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/tiles/brickBrown.png -------------------------------------------------------------------------------- /examples/resources/tiles/doorOpen_mid.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/tiles/doorOpen_mid.png -------------------------------------------------------------------------------- /examples/resources/tiles/doorOpen_top.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/tiles/doorOpen_top.png -------------------------------------------------------------------------------- /examples/resources/tiles/fenceBroken.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/tiles/fenceBroken.png -------------------------------------------------------------------------------- /examples/resources/tiles/lavaTop_high.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/tiles/lavaTop_high.png -------------------------------------------------------------------------------- /examples/resources/tiles/lavaTop_low.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/tiles/lavaTop_low.png -------------------------------------------------------------------------------- /examples/resources/tiles/leverRight.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/tiles/leverRight.png -------------------------------------------------------------------------------- /examples/resources/tiles/lockYellow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/tiles/lockYellow.png -------------------------------------------------------------------------------- /examples/resources/tiles/mushroomRed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/tiles/mushroomRed.png -------------------------------------------------------------------------------- /examples/resources/tiles/plantPurple.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/tiles/plantPurple.png -------------------------------------------------------------------------------- /examples/resources/tiles/switchBlue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/tiles/switchBlue.png -------------------------------------------------------------------------------- /examples/resources/tiles/switchGreen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/tiles/switchGreen.png -------------------------------------------------------------------------------- /examples/resources/tiles/switchYellow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/tiles/switchYellow.png -------------------------------------------------------------------------------- /examples/resources/tiles/waterTop_low.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/tiles/waterTop_low.png -------------------------------------------------------------------------------- /docs/build/html/_static/comment-bright.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/docs/build/html/_static/comment-bright.png -------------------------------------------------------------------------------- /examples/resources/enemies/sawHalf_dead.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/enemies/sawHalf_dead.png -------------------------------------------------------------------------------- /examples/resources/enemies/sawHalf_move.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/enemies/sawHalf_move.png -------------------------------------------------------------------------------- /examples/resources/enemies/slimePurple.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/enemies/slimePurple.png -------------------------------------------------------------------------------- /examples/resources/enemies/snail_shell.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/enemies/snail_shell.png -------------------------------------------------------------------------------- /examples/resources/ground/Dirt/dirtHalf.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/ground/Dirt/dirtHalf.png -------------------------------------------------------------------------------- /examples/resources/ground/Dirt/dirtLeft.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/ground/Dirt/dirtLeft.png -------------------------------------------------------------------------------- /examples/resources/ground/Dirt/dirtMid.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/ground/Dirt/dirtMid.png -------------------------------------------------------------------------------- /examples/resources/ground/Planet/planet.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/ground/Planet/planet.png -------------------------------------------------------------------------------- /examples/resources/ground/Sand/sandHalf.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/ground/Sand/sandHalf.png -------------------------------------------------------------------------------- /examples/resources/ground/Sand/sandLeft.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/ground/Sand/sandLeft.png -------------------------------------------------------------------------------- /examples/resources/ground/Sand/sandMid.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/ground/Sand/sandMid.png -------------------------------------------------------------------------------- /examples/resources/ground/Snow/snowHalf.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/ground/Snow/snowHalf.png -------------------------------------------------------------------------------- /examples/resources/ground/Snow/snowLeft.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/ground/Snow/snowLeft.png -------------------------------------------------------------------------------- /examples/resources/ground/Snow/snowMid.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/ground/Snow/snowMid.png -------------------------------------------------------------------------------- /examples/resources/hud/hudJewel_yellow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/hud/hudJewel_yellow.png -------------------------------------------------------------------------------- /examples/resources/hud/hudKey_red_empty.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/hud/hudKey_red_empty.png -------------------------------------------------------------------------------- /examples/resources/hud/hudPlayer_beige.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/hud/hudPlayer_beige.png -------------------------------------------------------------------------------- /examples/resources/hud/hudPlayer_green.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/hud/hudPlayer_green.png -------------------------------------------------------------------------------- /examples/resources/hud/hudPlayer_yellow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/hud/hudPlayer_yellow.png -------------------------------------------------------------------------------- /examples/resources/items/flagBlue_down.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/items/flagBlue_down.png -------------------------------------------------------------------------------- /examples/resources/items/flagGreen_down.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/items/flagGreen_down.png -------------------------------------------------------------------------------- /examples/resources/particles/brickBrown.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/particles/brickBrown.png -------------------------------------------------------------------------------- /examples/resources/particles/brickGrey.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/particles/brickGrey.png -------------------------------------------------------------------------------- /examples/resources/tiles/boxCoin_boxed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/tiles/boxCoin_boxed.png -------------------------------------------------------------------------------- /examples/resources/tiles/boxItem_boxed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/tiles/boxItem_boxed.png -------------------------------------------------------------------------------- /examples/resources/tiles/doorClosed_mid.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/tiles/doorClosed_mid.png -------------------------------------------------------------------------------- /examples/resources/tiles/doorClosed_top.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/tiles/doorClosed_top.png -------------------------------------------------------------------------------- /examples/resources/tiles/mushroomBrown.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/tiles/mushroomBrown.png -------------------------------------------------------------------------------- /examples/resources/tiles/waterTop_high.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/tiles/waterTop_high.png -------------------------------------------------------------------------------- /examples/resources/tiles/weightAttached.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/tiles/weightAttached.png -------------------------------------------------------------------------------- /examples/resources/backgrounds/blue_desert.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/backgrounds/blue_desert.png -------------------------------------------------------------------------------- /examples/resources/backgrounds/blue_grass.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/backgrounds/blue_grass.png -------------------------------------------------------------------------------- /examples/resources/backgrounds/blue_land.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/backgrounds/blue_land.png -------------------------------------------------------------------------------- /examples/resources/backgrounds/blue_shroom.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/backgrounds/blue_shroom.png -------------------------------------------------------------------------------- /examples/resources/enemies/barnacle_attack.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/enemies/barnacle_attack.png -------------------------------------------------------------------------------- /examples/resources/enemies/barnacle_dead.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/enemies/barnacle_dead.png -------------------------------------------------------------------------------- /examples/resources/enemies/fishBlue_dead.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/enemies/fishBlue_dead.png -------------------------------------------------------------------------------- /examples/resources/enemies/fishBlue_fall.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/enemies/fishBlue_fall.png -------------------------------------------------------------------------------- /examples/resources/enemies/fishGreen_dead.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/enemies/fishGreen_dead.png -------------------------------------------------------------------------------- /examples/resources/enemies/fishGreen_move.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/enemies/fishGreen_move.png -------------------------------------------------------------------------------- /examples/resources/enemies/fishPink_dead.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/enemies/fishPink_dead.png -------------------------------------------------------------------------------- /examples/resources/enemies/fishPink_move.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/enemies/fishPink_move.png -------------------------------------------------------------------------------- /examples/resources/enemies/slimeBlock_dead.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/enemies/slimeBlock_dead.png -------------------------------------------------------------------------------- /examples/resources/enemies/slimeBlock_move.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/enemies/slimeBlock_move.png -------------------------------------------------------------------------------- /examples/resources/enemies/slimeBlue_dead.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/enemies/slimeBlue_dead.png -------------------------------------------------------------------------------- /examples/resources/enemies/slimeBlue_hit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/enemies/slimeBlue_hit.png -------------------------------------------------------------------------------- /examples/resources/enemies/slimeBlue_move.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/enemies/slimeBlue_move.png -------------------------------------------------------------------------------- /examples/resources/enemies/slimeGreen_dead.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/enemies/slimeGreen_dead.png -------------------------------------------------------------------------------- /examples/resources/enemies/slimeGreen_hit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/enemies/slimeGreen_hit.png -------------------------------------------------------------------------------- /examples/resources/enemies/slimeGreen_move.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/enemies/slimeGreen_move.png -------------------------------------------------------------------------------- /examples/resources/enemies/slimePurple_hit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/enemies/slimePurple_hit.png -------------------------------------------------------------------------------- /examples/resources/enemies/wormGreen_dead.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/enemies/wormGreen_dead.png -------------------------------------------------------------------------------- /examples/resources/enemies/wormGreen_move.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/enemies/wormGreen_move.png -------------------------------------------------------------------------------- /examples/resources/enemies/wormPink_dead.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/enemies/wormPink_dead.png -------------------------------------------------------------------------------- /examples/resources/enemies/wormPink_move.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/enemies/wormPink_move.png -------------------------------------------------------------------------------- /examples/resources/ground/Dirt/dirtCenter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/ground/Dirt/dirtCenter.png -------------------------------------------------------------------------------- /examples/resources/ground/Dirt/dirtRight.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/ground/Dirt/dirtRight.png -------------------------------------------------------------------------------- /examples/resources/ground/Grass/grassHalf.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/ground/Grass/grassHalf.png -------------------------------------------------------------------------------- /examples/resources/ground/Grass/grassLeft.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/ground/Grass/grassLeft.png -------------------------------------------------------------------------------- /examples/resources/ground/Grass/grassMid.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/ground/Grass/grassMid.png -------------------------------------------------------------------------------- /examples/resources/ground/Grass/grassRight.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/ground/Grass/grassRight.png -------------------------------------------------------------------------------- /examples/resources/ground/Planet/planetMid.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/ground/Planet/planetMid.png -------------------------------------------------------------------------------- /examples/resources/ground/Sand/sandCenter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/ground/Sand/sandCenter.png -------------------------------------------------------------------------------- /examples/resources/ground/Sand/sandRight.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/ground/Sand/sandRight.png -------------------------------------------------------------------------------- /examples/resources/ground/Snow/snowCenter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/ground/Snow/snowCenter.png -------------------------------------------------------------------------------- /examples/resources/ground/Snow/snowRight.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/ground/Snow/snowRight.png -------------------------------------------------------------------------------- /examples/resources/ground/Stone/stoneHalf.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/ground/Stone/stoneHalf.png -------------------------------------------------------------------------------- /examples/resources/ground/Stone/stoneLeft.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/ground/Stone/stoneLeft.png -------------------------------------------------------------------------------- /examples/resources/ground/Stone/stoneMid.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/ground/Stone/stoneMid.png -------------------------------------------------------------------------------- /examples/resources/ground/Stone/stoneRight.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/ground/Stone/stoneRight.png -------------------------------------------------------------------------------- /examples/resources/hud/hudJewel_blue_empty.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/hud/hudJewel_blue_empty.png -------------------------------------------------------------------------------- /examples/resources/hud/hudJewel_red_empty.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/hud/hudJewel_red_empty.png -------------------------------------------------------------------------------- /examples/resources/hud/hudKey_blue_empty.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/hud/hudKey_blue_empty.png -------------------------------------------------------------------------------- /examples/resources/hud/hudKey_green_empty.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/hud/hudKey_green_empty.png -------------------------------------------------------------------------------- /examples/resources/hud/hudKey_yellow_empty.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/hud/hudKey_yellow_empty.png -------------------------------------------------------------------------------- /examples/resources/items/flagYellow_down.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/items/flagYellow_down.png -------------------------------------------------------------------------------- /examples/resources/tiles/boxCoin_disabled.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/tiles/boxCoin_disabled.png -------------------------------------------------------------------------------- /examples/resources/tiles/boxCrate_double.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/tiles/boxCrate_double.png -------------------------------------------------------------------------------- /examples/resources/tiles/boxCrate_single.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/tiles/boxCrate_single.png -------------------------------------------------------------------------------- /examples/resources/tiles/boxCrate_warning.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/tiles/boxCrate_warning.png -------------------------------------------------------------------------------- /examples/resources/tiles/boxExplosive_used.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/tiles/boxExplosive_used.png -------------------------------------------------------------------------------- /examples/resources/tiles/boxItem_disabled.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/tiles/boxItem_disabled.png -------------------------------------------------------------------------------- /examples/resources/tiles/switchRed_pressed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/tiles/switchRed_pressed.png -------------------------------------------------------------------------------- /examples/resources/backgrounds/colored_grass.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/backgrounds/colored_grass.png -------------------------------------------------------------------------------- /examples/resources/backgrounds/colored_land.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/backgrounds/colored_land.png -------------------------------------------------------------------------------- /examples/resources/enemies/slimePurple_dead.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/enemies/slimePurple_dead.png -------------------------------------------------------------------------------- /examples/resources/enemies/slimePurple_move.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/enemies/slimePurple_move.png -------------------------------------------------------------------------------- /examples/resources/ground/Dirt/dirtHalf_left.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/ground/Dirt/dirtHalf_left.png -------------------------------------------------------------------------------- /examples/resources/ground/Dirt/dirtHalf_mid.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/ground/Dirt/dirtHalf_mid.png -------------------------------------------------------------------------------- /examples/resources/ground/Dirt/dirtHill_left.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/ground/Dirt/dirtHill_left.png -------------------------------------------------------------------------------- /examples/resources/ground/Grass/grassCenter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/ground/Grass/grassCenter.png -------------------------------------------------------------------------------- /examples/resources/ground/Planet/planetHalf.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/ground/Planet/planetHalf.png -------------------------------------------------------------------------------- /examples/resources/ground/Planet/planetLeft.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/ground/Planet/planetLeft.png -------------------------------------------------------------------------------- /examples/resources/ground/Planet/planetRight.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/ground/Planet/planetRight.png -------------------------------------------------------------------------------- /examples/resources/ground/Sand/sandHalf_left.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/ground/Sand/sandHalf_left.png -------------------------------------------------------------------------------- /examples/resources/ground/Sand/sandHalf_mid.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/ground/Sand/sandHalf_mid.png -------------------------------------------------------------------------------- /examples/resources/ground/Sand/sandHill_left.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/ground/Sand/sandHill_left.png -------------------------------------------------------------------------------- /examples/resources/ground/Snow/snowHalf_left.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/ground/Snow/snowHalf_left.png -------------------------------------------------------------------------------- /examples/resources/ground/Snow/snowHalf_mid.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/ground/Snow/snowHalf_mid.png -------------------------------------------------------------------------------- /examples/resources/ground/Snow/snowHill_left.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/ground/Snow/snowHill_left.png -------------------------------------------------------------------------------- /examples/resources/ground/Stone/stoneCenter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/ground/Stone/stoneCenter.png -------------------------------------------------------------------------------- /examples/resources/hud/hudJewel_green_empty.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/hud/hudJewel_green_empty.png -------------------------------------------------------------------------------- /examples/resources/hud/hudJewel_yellow_empty.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/hud/hudJewel_yellow_empty.png -------------------------------------------------------------------------------- /examples/resources/tiles/switchBlue_pressed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/tiles/switchBlue_pressed.png -------------------------------------------------------------------------------- /examples/resources/tiles/switchGreen_pressed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/tiles/switchGreen_pressed.png -------------------------------------------------------------------------------- /setup.py: -------------------------------------------------------------------------------- 1 | from distutils.core import setup 2 | 3 | setup(name='pygame2', 4 | version='0.0.0', 5 | packages=['pygame2'], 6 | ) 7 | -------------------------------------------------------------------------------- /examples/resources/backgrounds/colored_desert.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/backgrounds/colored_desert.png -------------------------------------------------------------------------------- /examples/resources/backgrounds/colored_shroom.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/backgrounds/colored_shroom.png -------------------------------------------------------------------------------- /examples/resources/ground/Dirt/dirtCliff_left.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/ground/Dirt/dirtCliff_left.png -------------------------------------------------------------------------------- /examples/resources/ground/Dirt/dirtCliff_right.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/ground/Dirt/dirtCliff_right.png -------------------------------------------------------------------------------- /examples/resources/ground/Dirt/dirtCorner_left.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/ground/Dirt/dirtCorner_left.png -------------------------------------------------------------------------------- /examples/resources/ground/Dirt/dirtCorner_right.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/ground/Dirt/dirtCorner_right.png -------------------------------------------------------------------------------- /examples/resources/ground/Dirt/dirtHalf_right.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/ground/Dirt/dirtHalf_right.png -------------------------------------------------------------------------------- /examples/resources/ground/Dirt/dirtHill_right.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/ground/Dirt/dirtHill_right.png -------------------------------------------------------------------------------- /examples/resources/ground/Grass/grassCliff_left.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/ground/Grass/grassCliff_left.png -------------------------------------------------------------------------------- /examples/resources/ground/Grass/grassHalf_left.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/ground/Grass/grassHalf_left.png -------------------------------------------------------------------------------- /examples/resources/ground/Grass/grassHalf_mid.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/ground/Grass/grassHalf_mid.png -------------------------------------------------------------------------------- /examples/resources/ground/Grass/grassHalf_right.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/ground/Grass/grassHalf_right.png -------------------------------------------------------------------------------- /examples/resources/ground/Grass/grassHill_left.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/ground/Grass/grassHill_left.png -------------------------------------------------------------------------------- /examples/resources/ground/Grass/grassHill_right.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/ground/Grass/grassHill_right.png -------------------------------------------------------------------------------- /examples/resources/ground/Planet/planetCenter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/ground/Planet/planetCenter.png -------------------------------------------------------------------------------- /examples/resources/ground/Planet/planetHalf_mid.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/ground/Planet/planetHalf_mid.png -------------------------------------------------------------------------------- /examples/resources/ground/Sand/sandCliff_left.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/ground/Sand/sandCliff_left.png -------------------------------------------------------------------------------- /examples/resources/ground/Sand/sandCliff_right.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/ground/Sand/sandCliff_right.png -------------------------------------------------------------------------------- /examples/resources/ground/Sand/sandCorner_leftg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/ground/Sand/sandCorner_leftg.png -------------------------------------------------------------------------------- /examples/resources/ground/Sand/sandCorner_right.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/ground/Sand/sandCorner_right.png -------------------------------------------------------------------------------- /examples/resources/ground/Sand/sandHalf_right.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/ground/Sand/sandHalf_right.png -------------------------------------------------------------------------------- /examples/resources/ground/Sand/sandHill_right.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/ground/Sand/sandHill_right.png -------------------------------------------------------------------------------- /examples/resources/ground/Snow/snowCliff_left.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/ground/Snow/snowCliff_left.png -------------------------------------------------------------------------------- /examples/resources/ground/Snow/snowCliff_right.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/ground/Snow/snowCliff_right.png -------------------------------------------------------------------------------- /examples/resources/ground/Snow/snowCorner_left.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/ground/Snow/snowCorner_left.png -------------------------------------------------------------------------------- /examples/resources/ground/Snow/snowCorner_right.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/ground/Snow/snowCorner_right.png -------------------------------------------------------------------------------- /examples/resources/ground/Snow/snowHalf_right.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/ground/Snow/snowHalf_right.png -------------------------------------------------------------------------------- /examples/resources/ground/Snow/snowHill_right.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/ground/Snow/snowHill_right.png -------------------------------------------------------------------------------- /examples/resources/ground/Stone/stoneCliff_left.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/ground/Stone/stoneCliff_left.png -------------------------------------------------------------------------------- /examples/resources/ground/Stone/stoneHalf_left.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/ground/Stone/stoneHalf_left.png -------------------------------------------------------------------------------- /examples/resources/ground/Stone/stoneHalf_mid.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/ground/Stone/stoneHalf_mid.png -------------------------------------------------------------------------------- /examples/resources/ground/Stone/stoneHalf_right.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/ground/Stone/stoneHalf_right.png -------------------------------------------------------------------------------- /examples/resources/ground/Stone/stoneHill_left.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/ground/Stone/stoneHill_left.png -------------------------------------------------------------------------------- /examples/resources/ground/Stone/stoneHill_right.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/ground/Stone/stoneHill_right.png -------------------------------------------------------------------------------- /examples/resources/players/Beige/alienBeige_hit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/players/Beige/alienBeige_hit.png -------------------------------------------------------------------------------- /examples/resources/players/Blue/alienBlue_duck.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/players/Blue/alienBlue_duck.png -------------------------------------------------------------------------------- /examples/resources/players/Blue/alienBlue_front.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/players/Blue/alienBlue_front.png -------------------------------------------------------------------------------- /examples/resources/players/Blue/alienBlue_hit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/players/Blue/alienBlue_hit.png -------------------------------------------------------------------------------- /examples/resources/players/Blue/alienBlue_jump.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/players/Blue/alienBlue_jump.png -------------------------------------------------------------------------------- /examples/resources/players/Blue/alienBlue_stand.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/players/Blue/alienBlue_stand.png -------------------------------------------------------------------------------- /examples/resources/players/Blue/alienBlue_swim1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/players/Blue/alienBlue_swim1.png -------------------------------------------------------------------------------- /examples/resources/players/Blue/alienBlue_swim2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/players/Blue/alienBlue_swim2.png -------------------------------------------------------------------------------- /examples/resources/players/Blue/alienBlue_walk1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/players/Blue/alienBlue_walk1.png -------------------------------------------------------------------------------- /examples/resources/players/Blue/alienBlue_walk2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/players/Blue/alienBlue_walk2.png -------------------------------------------------------------------------------- /examples/resources/players/Green/alienGreen_hit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/players/Green/alienGreen_hit.png -------------------------------------------------------------------------------- /examples/resources/players/Pink/alienPink_duck.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/players/Pink/alienPink_duck.png -------------------------------------------------------------------------------- /examples/resources/players/Pink/alienPink_front.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/players/Pink/alienPink_front.png -------------------------------------------------------------------------------- /examples/resources/players/Pink/alienPink_hit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/players/Pink/alienPink_hit.png -------------------------------------------------------------------------------- /examples/resources/players/Pink/alienPink_jump.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/players/Pink/alienPink_jump.png -------------------------------------------------------------------------------- /examples/resources/players/Pink/alienPink_stand.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/players/Pink/alienPink_stand.png -------------------------------------------------------------------------------- /examples/resources/players/Pink/alienPink_swim1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/players/Pink/alienPink_swim1.png -------------------------------------------------------------------------------- /examples/resources/players/Pink/alienPink_swim2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/players/Pink/alienPink_swim2.png -------------------------------------------------------------------------------- /examples/resources/players/Pink/alienPink_walk1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/players/Pink/alienPink_walk1.png -------------------------------------------------------------------------------- /examples/resources/players/Pink/alienPink_walk2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/players/Pink/alienPink_walk2.png -------------------------------------------------------------------------------- /examples/resources/tiles/boxCoin_disabled_boxed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/tiles/boxCoin_disabled_boxed.png -------------------------------------------------------------------------------- /examples/resources/tiles/boxExplosive_disabled.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/tiles/boxExplosive_disabled.png -------------------------------------------------------------------------------- /examples/resources/tiles/boxItem_disabled_boxed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/tiles/boxItem_disabled_boxed.png -------------------------------------------------------------------------------- /examples/resources/tiles/switchYellow_pressed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/tiles/switchYellow_pressed.png -------------------------------------------------------------------------------- /examples/resources/ground/Dirt/dirtCenter_rounded.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/ground/Dirt/dirtCenter_rounded.png -------------------------------------------------------------------------------- /examples/resources/ground/Dirt/dirtCliffAlt_left.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/ground/Dirt/dirtCliffAlt_left.png -------------------------------------------------------------------------------- /examples/resources/ground/Dirt/dirtCliffAlt_right.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/ground/Dirt/dirtCliffAlt_right.png -------------------------------------------------------------------------------- /examples/resources/ground/Grass/grassCenter_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/ground/Grass/grassCenter_round.png -------------------------------------------------------------------------------- /examples/resources/ground/Grass/grassCliff_right.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/ground/Grass/grassCliff_right.png -------------------------------------------------------------------------------- /examples/resources/ground/Grass/grassCorner_left.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/ground/Grass/grassCorner_left.png -------------------------------------------------------------------------------- /examples/resources/ground/Grass/grassCorner_right.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/ground/Grass/grassCorner_right.png -------------------------------------------------------------------------------- /examples/resources/ground/Planet/planetCliff_left.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/ground/Planet/planetCliff_left.png -------------------------------------------------------------------------------- /examples/resources/ground/Planet/planetHalf_left.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/ground/Planet/planetHalf_left.png -------------------------------------------------------------------------------- /examples/resources/ground/Planet/planetHalf_right.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/ground/Planet/planetHalf_right.png -------------------------------------------------------------------------------- /examples/resources/ground/Planet/planetHill_left.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/ground/Planet/planetHill_left.png -------------------------------------------------------------------------------- /examples/resources/ground/Planet/planetHill_right.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/ground/Planet/planetHill_right.png -------------------------------------------------------------------------------- /examples/resources/ground/Sand/sandCenter_rounded.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/ground/Sand/sandCenter_rounded.png -------------------------------------------------------------------------------- /examples/resources/ground/Sand/sandCliffAlt_left.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/ground/Sand/sandCliffAlt_left.png -------------------------------------------------------------------------------- /examples/resources/ground/Sand/sandCliffAlt_right.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/ground/Sand/sandCliffAlt_right.png -------------------------------------------------------------------------------- /examples/resources/ground/Snow/snowCenter_rounded.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/ground/Snow/snowCenter_rounded.png -------------------------------------------------------------------------------- /examples/resources/ground/Snow/snowCliffAlt_left.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/ground/Snow/snowCliffAlt_left.png -------------------------------------------------------------------------------- /examples/resources/ground/Snow/snowCliffAlt_right.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/ground/Snow/snowCliffAlt_right.png -------------------------------------------------------------------------------- /examples/resources/ground/Stone/stoneCliff_right.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/ground/Stone/stoneCliff_right.png -------------------------------------------------------------------------------- /examples/resources/ground/Stone/stoneCorner_left.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/ground/Stone/stoneCorner_left.png -------------------------------------------------------------------------------- /examples/resources/ground/Stone/stoneCorner_right.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/ground/Stone/stoneCorner_right.png -------------------------------------------------------------------------------- /examples/resources/players/Beige/alienBeige_duck.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/players/Beige/alienBeige_duck.png -------------------------------------------------------------------------------- /examples/resources/players/Beige/alienBeige_front.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/players/Beige/alienBeige_front.png -------------------------------------------------------------------------------- /examples/resources/players/Beige/alienBeige_jump.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/players/Beige/alienBeige_jump.png -------------------------------------------------------------------------------- /examples/resources/players/Beige/alienBeige_stand.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/players/Beige/alienBeige_stand.png -------------------------------------------------------------------------------- /examples/resources/players/Beige/alienBeige_swim1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/players/Beige/alienBeige_swim1.png -------------------------------------------------------------------------------- /examples/resources/players/Beige/alienBeige_swim2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/players/Beige/alienBeige_swim2.png -------------------------------------------------------------------------------- /examples/resources/players/Beige/alienBeige_walk1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/players/Beige/alienBeige_walk1.png -------------------------------------------------------------------------------- /examples/resources/players/Beige/alienBeige_walk2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/players/Beige/alienBeige_walk2.png -------------------------------------------------------------------------------- /examples/resources/players/Blue/alienBlue_climb1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/players/Blue/alienBlue_climb1.png -------------------------------------------------------------------------------- /examples/resources/players/Blue/alienBlue_climb2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/players/Blue/alienBlue_climb2.png -------------------------------------------------------------------------------- /examples/resources/players/Green/alienGreen_duck.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/players/Green/alienGreen_duck.png -------------------------------------------------------------------------------- /examples/resources/players/Green/alienGreen_front.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/players/Green/alienGreen_front.png -------------------------------------------------------------------------------- /examples/resources/players/Green/alienGreen_jump.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/players/Green/alienGreen_jump.png -------------------------------------------------------------------------------- /examples/resources/players/Green/alienGreen_stand.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/players/Green/alienGreen_stand.png -------------------------------------------------------------------------------- /examples/resources/players/Green/alienGreen_swim1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/players/Green/alienGreen_swim1.png -------------------------------------------------------------------------------- /examples/resources/players/Green/alienGreen_swim2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/players/Green/alienGreen_swim2.png -------------------------------------------------------------------------------- /examples/resources/players/Green/alienGreen_walk1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/players/Green/alienGreen_walk1.png -------------------------------------------------------------------------------- /examples/resources/players/Green/alienGreen_walk2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/players/Green/alienGreen_walk2.png -------------------------------------------------------------------------------- /examples/resources/players/Pink/alienPink_climb1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/players/Pink/alienPink_climb1.png -------------------------------------------------------------------------------- /examples/resources/players/Pink/alienPink_climb2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/players/Pink/alienPink_climb2.png -------------------------------------------------------------------------------- /examples/resources/players/Yellow/alienYellow_hit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/players/Yellow/alienYellow_hit.png -------------------------------------------------------------------------------- /examples/resources/ground/Grass/grassCliffAlt_left.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/ground/Grass/grassCliffAlt_left.png -------------------------------------------------------------------------------- /examples/resources/ground/Grass/grassCliffAlt_right.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/ground/Grass/grassCliffAlt_right.png -------------------------------------------------------------------------------- /examples/resources/ground/Planet/planetCliffAlt_left.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/ground/Planet/planetCliffAlt_left.png -------------------------------------------------------------------------------- /examples/resources/ground/Planet/planetCliff_right.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/ground/Planet/planetCliff_right.png -------------------------------------------------------------------------------- /examples/resources/ground/Planet/planetCorner_left.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/ground/Planet/planetCorner_left.png -------------------------------------------------------------------------------- /examples/resources/ground/Planet/planetCorner_right.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/ground/Planet/planetCorner_right.png -------------------------------------------------------------------------------- /examples/resources/ground/Stone/stoneCenter_rounded.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/ground/Stone/stoneCenter_rounded.png -------------------------------------------------------------------------------- /examples/resources/ground/Stone/stoneCliffAlt_left.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/ground/Stone/stoneCliffAlt_left.png -------------------------------------------------------------------------------- /examples/resources/ground/Stone/stoneCliffAlt_right.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/ground/Stone/stoneCliffAlt_right.png -------------------------------------------------------------------------------- /examples/resources/players/Beige/alienBeige_climb1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/players/Beige/alienBeige_climb1.png -------------------------------------------------------------------------------- /examples/resources/players/Beige/alienBeige_climb2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/players/Beige/alienBeige_climb2.png -------------------------------------------------------------------------------- /examples/resources/players/Green/alienGreen_climb1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/players/Green/alienGreen_climb1.png -------------------------------------------------------------------------------- /examples/resources/players/Green/alienGreen_climb2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/players/Green/alienGreen_climb2.png -------------------------------------------------------------------------------- /examples/resources/players/Yellow/alienYellow_climb1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/players/Yellow/alienYellow_climb1.png -------------------------------------------------------------------------------- /examples/resources/players/Yellow/alienYellow_climb2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/players/Yellow/alienYellow_climb2.png -------------------------------------------------------------------------------- /examples/resources/players/Yellow/alienYellow_duck.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/players/Yellow/alienYellow_duck.png -------------------------------------------------------------------------------- /examples/resources/players/Yellow/alienYellow_front.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/players/Yellow/alienYellow_front.png -------------------------------------------------------------------------------- /examples/resources/players/Yellow/alienYellow_jump.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/players/Yellow/alienYellow_jump.png -------------------------------------------------------------------------------- /examples/resources/players/Yellow/alienYellow_stand.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/players/Yellow/alienYellow_stand.png -------------------------------------------------------------------------------- /examples/resources/players/Yellow/alienYellow_swim1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/players/Yellow/alienYellow_swim1.png -------------------------------------------------------------------------------- /examples/resources/players/Yellow/alienYellow_swim2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/players/Yellow/alienYellow_swim2.png -------------------------------------------------------------------------------- /examples/resources/players/Yellow/alienYellow_walk1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/players/Yellow/alienYellow_walk1.png -------------------------------------------------------------------------------- /examples/resources/players/Yellow/alienYellow_walk2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/players/Yellow/alienYellow_walk2.png -------------------------------------------------------------------------------- /pygame2/input/mouse.py: -------------------------------------------------------------------------------- 1 | from pygame2.event import EventDispatcher 2 | 3 | __all__ = ('MouseBase', ) 4 | 5 | 6 | class MouseBase(EventDispatcher): 7 | pass -------------------------------------------------------------------------------- /pygame2/input/touch.py: -------------------------------------------------------------------------------- 1 | from pygame2.event import EventDispatcher 2 | 3 | __all__ = ('TouchBase', ) 4 | 5 | 6 | class TouchBase(EventDispatcher): 7 | pass -------------------------------------------------------------------------------- /examples/resources/ground/Planet/planetCenter_rounded.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/ground/Planet/planetCenter_rounded.png -------------------------------------------------------------------------------- /examples/resources/ground/Planet/planetCliffAlt_right.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygame2/pygame2/HEAD/examples/resources/ground/Planet/planetCliffAlt_right.png -------------------------------------------------------------------------------- /pygame2/input/keyboard.py: -------------------------------------------------------------------------------- 1 | from pygame2.event import EventDispatcher 2 | 3 | __all__ = ('KeyboardBase', ) 4 | 5 | 6 | class KeyboardBase(EventDispatcher): 7 | pass -------------------------------------------------------------------------------- /pygame2/core/platform/platform_pysdl2.py: -------------------------------------------------------------------------------- 1 | """ 2 | PySDL2 based platform 3 | """ 4 | from pygame2.window import WindowBase 5 | 6 | 7 | class Window(WindowBase): 8 | pass 9 | -------------------------------------------------------------------------------- /docs/source/pygame2.rect.rst: -------------------------------------------------------------------------------- 1 | pygame2.rect module 2 | =================== 3 | 4 | .. automodule:: pygame2.rect 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/source/pygame2.color.rst: -------------------------------------------------------------------------------- 1 | pygame2.color module 2 | ==================== 3 | 4 | .. automodule:: pygame2.color 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/build/html/_sources/pygame2.rect.txt: -------------------------------------------------------------------------------- 1 | pygame2.rect module 2 | =================== 3 | 4 | .. automodule:: pygame2.rect 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /pygame2/graphics/fragment_shader.glsl: -------------------------------------------------------------------------------- 1 | #version 120 2 | varying vec2 f_texcoord; 3 | uniform sampler2D mytexture; 4 | 5 | void main(void) { 6 | gl_FragColor = texture2D(mytexture, f_texcoord); 7 | } 8 | -------------------------------------------------------------------------------- /tox.ini: -------------------------------------------------------------------------------- 1 | [tox] 2 | envlist = pygame2-{py27} 3 | recreate = True 4 | skip_missing_interpreters = True 5 | 6 | [testenv:pygame2-py27] 7 | basepython = python2.7 8 | commands = nosetests 9 | deps = -rrequirements.txt 10 | -------------------------------------------------------------------------------- /setup.cfg: -------------------------------------------------------------------------------- 1 | [nosetests] 2 | detailed-errors=1 3 | with-coverage=1 4 | cover-tests=1 5 | cover-inclusive=1 6 | cover-branches=1 7 | cover-erase=1 8 | cover-html-dir=docs/coverage 9 | cover-html=1 10 | cover-package=pygame2 11 | -------------------------------------------------------------------------------- /pygame2/core/input/input_xinput.py: -------------------------------------------------------------------------------- 1 | """Input layer targeting Windows xinput for gamepad access 2 | In practical use, this really is just for xbox one and 360 gamepads on windows 3 | 4 | all other devices must use 'legacy/depreciated' directinput. 5 | """ 6 | -------------------------------------------------------------------------------- /tests/test_key.py: -------------------------------------------------------------------------------- 1 | """ 2 | event_tests.py 3 | 4 | """ 5 | from unittest import TestCase 6 | from mock import patch, call 7 | from logging import getLogger 8 | 9 | logger = getLogger() 10 | 11 | 12 | class KeyTests(TestCase): 13 | pass 14 | 15 | -------------------------------------------------------------------------------- /docs/build/html/.buildinfo: -------------------------------------------------------------------------------- 1 | # Sphinx build info version 1 2 | # This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done. 3 | config: 743e8be333ca317747cb5d1e2562d5c3 4 | tags: 645f666f9bcd5a90fca523b33c5a78b7 5 | -------------------------------------------------------------------------------- /pygame2/resources.py: -------------------------------------------------------------------------------- 1 | """ 2 | utility type things to make loading of advanced, but commonly 3 | encountered file formats possible. 4 | 5 | some ideas: 6 | - texture atlas / sprite sheet 7 | """ 8 | 9 | 10 | def load_packed_textures(json_file): 11 | pass 12 | -------------------------------------------------------------------------------- /docs/source/pygame2.core.graphics.rst: -------------------------------------------------------------------------------- 1 | pygame2.core.graphics package 2 | ============================= 3 | 4 | Module contents 5 | --------------- 6 | 7 | .. automodule:: pygame2.core.graphics 8 | :members: 9 | :undoc-members: 10 | :show-inheritance: 11 | -------------------------------------------------------------------------------- /pygame2/core/graphics/__init__.py: -------------------------------------------------------------------------------- 1 | """ 2 | The OpenGL programmable pipeline offers new ways to express graphics 3 | using shaders and programs. Pygame2 ships with a basic program and 4 | shaders suitable for 2d games. 5 | """ 6 | # TODO: move graphics specific things here 7 | -------------------------------------------------------------------------------- /pygame2/input/gamepad.py: -------------------------------------------------------------------------------- 1 | from pygame2.event import EventDispatcher 2 | 3 | __all__ = ('GamepadBase', ) 4 | 5 | 6 | class GamepadBase(EventDispatcher): 7 | """ High level abstraction for gamepad-like devices, 8 | including joysticks. 9 | """ 10 | pass -------------------------------------------------------------------------------- /pygame2/graphics/vertex_shader.glsl: -------------------------------------------------------------------------------- 1 | #version 120 2 | attribute vec2 coord2d; 3 | attribute vec2 texcoord; 4 | varying vec2 f_texcoord; 5 | uniform mat4 mvp; 6 | 7 | void main(void) { 8 | gl_Position = vec4(coord2d, 0.0, 1.0); 9 | f_texcoord = texcoord; 10 | } 11 | -------------------------------------------------------------------------------- /docs/source/pygame2.rst: -------------------------------------------------------------------------------- 1 | pygame2 package 2 | =============== 3 | 4 | Submodules 5 | ---------- 6 | 7 | .. toctree:: 8 | 9 | pygame2.color 10 | pygame2.rect 11 | 12 | Module contents 13 | --------------- 14 | 15 | .. automodule:: pygame2 16 | :members: 17 | :undoc-members: 18 | :show-inheritance: 19 | -------------------------------------------------------------------------------- /docs/build/html/_sources/pygame2.txt: -------------------------------------------------------------------------------- 1 | pygame2 package 2 | =============== 3 | 4 | Submodules 5 | ---------- 6 | 7 | .. toctree:: 8 | 9 | pygame2.color 10 | pygame2.rect 11 | 12 | Module contents 13 | --------------- 14 | 15 | .. automodule:: pygame2 16 | :members: 17 | :undoc-members: 18 | :show-inheritance: 19 | -------------------------------------------------------------------------------- /pygame2/devtools/__main__.py: -------------------------------------------------------------------------------- 1 | 2 | 3 | def main(): 4 | from argparse import ArgumentParser 5 | from pygame2.devtools.cli import create_command_line_interface 6 | parser = ArgumentParser(prog="pygame2") 7 | cli = create_command_line_interface(parser) 8 | cli.execute() 9 | 10 | 11 | if __name__ == "__main__": 12 | main() 13 | -------------------------------------------------------------------------------- /pygame2/core/input/input_pyglet.py: -------------------------------------------------------------------------------- 1 | """ pyglet input events 2 | 3 | JUST A STUB - Keyboard and mouse events are handled by pyglet's window 4 | """ 5 | from pygame2.input.keyboard import KeyboardBase 6 | from pygame2.input.mouse import MouseBase 7 | 8 | 9 | class Keyboard(KeyboardBase): 10 | pass 11 | 12 | 13 | class Mouse(MouseBase): 14 | pass 15 | -------------------------------------------------------------------------------- /pygame2/core/audio/audio_fmod.py: -------------------------------------------------------------------------------- 1 | """ 2 | FMOD audio library is free to indie developers! 3 | 4 | When distributing pygame2, we wont distribute FMOD, 5 | but instead offer it as an easy option for developers 6 | to use. This will let users make the choice and do 7 | the work for legal compliance. 8 | 9 | FMOD probably would be our preferred audio backend. 10 | """ 11 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ![Travis CI Latest Build Result](https://travis-ci.org/wkmanire/pygame.svg?branch=develop) 2 | 3 | This is a new project. There have been others like it. We hope that we 4 | can be the first successful pygame2 project. A description of our main goals 5 | and motivations will follow shortly. 6 | 7 | The rect module is now complete and could potentially be used with the original 8 | pygame (for the brave). 9 | -------------------------------------------------------------------------------- /docs/source/pygame2.core.rst: -------------------------------------------------------------------------------- 1 | pygame2.core package 2 | ==================== 3 | 4 | Subpackages 5 | ----------- 6 | 7 | .. toctree:: 8 | 9 | pygame2.core.audio 10 | pygame2.core.graphics 11 | pygame2.core.image 12 | pygame2.core.input 13 | pygame2.core.platform 14 | 15 | Module contents 16 | --------------- 17 | 18 | .. automodule:: pygame2.core 19 | :members: 20 | :undoc-members: 21 | :show-inheritance: 22 | -------------------------------------------------------------------------------- /docs/source/pygame2.graphics.rst: -------------------------------------------------------------------------------- 1 | pygame2.graphics package 2 | ======================== 3 | 4 | Submodules 5 | ---------- 6 | 7 | pygame2.graphics.texture module 8 | ------------------------------- 9 | 10 | .. automodule:: pygame2.graphics.texture 11 | :members: 12 | :undoc-members: 13 | :show-inheritance: 14 | 15 | 16 | Module contents 17 | --------------- 18 | 19 | .. automodule:: pygame2.graphics 20 | :members: 21 | :undoc-members: 22 | :show-inheritance: 23 | -------------------------------------------------------------------------------- /docs/source/pygame2.core.audio.rst: -------------------------------------------------------------------------------- 1 | pygame2.core.audio package 2 | ========================== 3 | 4 | Submodules 5 | ---------- 6 | 7 | pygame2.core.audio.audio_fmod module 8 | ------------------------------------ 9 | 10 | .. automodule:: pygame2.core.audio.audio_fmod 11 | :members: 12 | :undoc-members: 13 | :show-inheritance: 14 | 15 | 16 | Module contents 17 | --------------- 18 | 19 | .. automodule:: pygame2.core.audio 20 | :members: 21 | :undoc-members: 22 | :show-inheritance: 23 | -------------------------------------------------------------------------------- /pygame2/node.py: -------------------------------------------------------------------------------- 1 | class Node: 2 | """GameTree Node 3 | """ 4 | 5 | def __init__(self): 6 | self._children = set() 7 | self._order = list() 8 | 9 | def __contains__(self, item): 10 | return item in self._children 11 | 12 | def add(self, child): 13 | pass 14 | 15 | def remove(self, child): 16 | pass 17 | 18 | @property 19 | def children(self): 20 | pass 21 | 22 | 23 | class SpriteNode(Node): 24 | """Essentially, anything drawable 25 | """ 26 | pass 27 | -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | cov-core==1.15.0 2 | coverage==3.7.1 3 | docutils==0.12 4 | Jinja2==2.7.3 5 | MarkupSafe==0.23 6 | mock==1.0.1 7 | nose-cov==1.6 8 | nose==1.3.4 9 | Pygments==2.0.2 10 | Sphinx==1.2.3 11 | 12 | # below are deps required to use our backends 13 | # pysdl2 14 | # -e hg+http://bitbucket.org/pygame/pygame#egg=pygame 15 | # -e git+https://github.com/bitcraft/pyglet.git#egg=pyglet 16 | pyglet 17 | pysdl2 18 | pillow==2.7.0 19 | 20 | # below are experimental deps while i find the best opengl 21 | # bindings. these may or may not change. 22 | pyopengl 23 | numpy 24 | -------------------------------------------------------------------------------- /pygame2/core/audio/__init__.py: -------------------------------------------------------------------------------- 1 | from pygame2.core import core_modules 2 | 3 | __all__ = ('load', ) 4 | 5 | 6 | # declare audio providers 7 | core_modules['audio'] = ('audio_pysdl2', ) 8 | 9 | 10 | def load(filename): 11 | """ 12 | 13 | :param filename: filename of audio file to load 14 | :return: pygame2.audio.Sound object 15 | """ 16 | from pygame2.core import core_providers 17 | 18 | snd = None 19 | for provider in core_providers['audio']: 20 | try: 21 | snd = provider.SoundLoader.load(filename) 22 | break 23 | except: 24 | raise 25 | 26 | return snd 27 | -------------------------------------------------------------------------------- /docs/source/pygame2.core.input.rst: -------------------------------------------------------------------------------- 1 | pygame2.core.input package 2 | ========================== 3 | 4 | Submodules 5 | ---------- 6 | 7 | pygame2.core.input.input_pyglet module 8 | -------------------------------------- 9 | 10 | .. automodule:: pygame2.core.input.input_pyglet 11 | :members: 12 | :undoc-members: 13 | :show-inheritance: 14 | 15 | pygame2.core.input.input_xinput module 16 | -------------------------------------- 17 | 18 | .. automodule:: pygame2.core.input.input_xinput 19 | :members: 20 | :undoc-members: 21 | :show-inheritance: 22 | 23 | 24 | Module contents 25 | --------------- 26 | 27 | .. automodule:: pygame2.core.input 28 | :members: 29 | :undoc-members: 30 | :show-inheritance: 31 | -------------------------------------------------------------------------------- /docs/source/pygame2.core.platform.rst: -------------------------------------------------------------------------------- 1 | pygame2.core.platform package 2 | ============================= 3 | 4 | Submodules 5 | ---------- 6 | 7 | pygame2.core.platform.platform_pyglet module 8 | -------------------------------------------- 9 | 10 | .. automodule:: pygame2.core.platform.platform_pyglet 11 | :members: 12 | :undoc-members: 13 | :show-inheritance: 14 | 15 | pygame2.core.platform.platform_pysdl2 module 16 | -------------------------------------------- 17 | 18 | .. automodule:: pygame2.core.platform.platform_pysdl2 19 | :members: 20 | :undoc-members: 21 | :show-inheritance: 22 | 23 | 24 | Module contents 25 | --------------- 26 | 27 | .. automodule:: pygame2.core.platform 28 | :members: 29 | :undoc-members: 30 | :show-inheritance: 31 | -------------------------------------------------------------------------------- /docs/source/pygame2.core.image.rst: -------------------------------------------------------------------------------- 1 | pygame2.core.image package 2 | ========================== 3 | 4 | Submodules 5 | ---------- 6 | 7 | pygame2.core.image.image_pillow module 8 | -------------------------------------- 9 | 10 | .. automodule:: pygame2.core.image.image_pillow 11 | :members: 12 | :undoc-members: 13 | :show-inheritance: 14 | 15 | pygame2.core.image.image_pyglet module 16 | -------------------------------------- 17 | 18 | .. automodule:: pygame2.core.image.image_pyglet 19 | :members: 20 | :undoc-members: 21 | :show-inheritance: 22 | 23 | pygame2.core.image.image_pysdl2 module 24 | -------------------------------------- 25 | 26 | .. automodule:: pygame2.core.image.image_pysdl2 27 | :members: 28 | :undoc-members: 29 | :show-inheritance: 30 | 31 | 32 | Module contents 33 | --------------- 34 | 35 | .. automodule:: pygame2.core.image 36 | :members: 37 | :undoc-members: 38 | :show-inheritance: 39 | -------------------------------------------------------------------------------- /pygame2/core/__init__.py: -------------------------------------------------------------------------------- 1 | """ 2 | do magic here to load the best available loaders for the pygame2 core 3 | """ 4 | core_modules = dict() 5 | core_providers = dict() 6 | 7 | import logging 8 | 9 | from . import audio 10 | from . import image 11 | from . import platform 12 | 13 | 14 | logger = logging.getLogger('pygame2.core') 15 | 16 | 17 | def load_modules(): 18 | import importlib 19 | 20 | def iterate_providers(): 21 | for provider in providers: 22 | path = 'pygame2.core.{}.{}'.format(name, provider) 23 | # TODO: change warn to debug 24 | try: 25 | yield importlib.import_module(path) 26 | logger.warn("imported: %s", path) 27 | except ImportError: 28 | logger.warn('cannot import %s', path) 29 | pass 30 | 31 | for name in list(core_modules.keys()): 32 | providers = core_modules[name] 33 | core_providers[name] = list(iterate_providers()) 34 | 35 | 36 | load_modules() 37 | -------------------------------------------------------------------------------- /docs/source/pygame2.input.rst: -------------------------------------------------------------------------------- 1 | pygame2.input package 2 | ===================== 3 | 4 | Submodules 5 | ---------- 6 | 7 | pygame2.input.gamepad module 8 | ---------------------------- 9 | 10 | .. automodule:: pygame2.input.gamepad 11 | :members: 12 | :undoc-members: 13 | :show-inheritance: 14 | 15 | pygame2.input.keyboard module 16 | ----------------------------- 17 | 18 | .. automodule:: pygame2.input.keyboard 19 | :members: 20 | :undoc-members: 21 | :show-inheritance: 22 | 23 | pygame2.input.mouse module 24 | -------------------------- 25 | 26 | .. automodule:: pygame2.input.mouse 27 | :members: 28 | :undoc-members: 29 | :show-inheritance: 30 | 31 | pygame2.input.touch module 32 | -------------------------- 33 | 34 | .. automodule:: pygame2.input.touch 35 | :members: 36 | :undoc-members: 37 | :show-inheritance: 38 | 39 | 40 | Module contents 41 | --------------- 42 | 43 | .. automodule:: pygame2.input 44 | :members: 45 | :undoc-members: 46 | :show-inheritance: 47 | -------------------------------------------------------------------------------- /pygame2/input/__init__.py: -------------------------------------------------------------------------------- 1 | from pygame2.event import EventDispatcher 2 | 3 | from . import gamepad 4 | from . import keyboard 5 | from . import mouse 6 | from . import touch 7 | 8 | __all__ = ( 9 | 'gamepad', 10 | 'keyboard', 11 | 'mouse', 12 | 'touch', 13 | 'Control', 14 | 'RelativeAxis', 15 | 'AbsoluteAxis', 16 | 'Button') 17 | 18 | 19 | class Control(EventDispatcher): 20 | """ Single value input provided by a device 21 | """ 22 | 23 | def __init__(self, name): 24 | super().__init__() 25 | self.name = name 26 | self._value = None 27 | 28 | @property 29 | def value(self): 30 | return self._value 31 | 32 | @value.setter 33 | def value(self, value): 34 | if not value == self._value: 35 | self._value = value 36 | self.broadcast('on_change') 37 | 38 | 39 | class RelativeAxis(Control): 40 | pass 41 | 42 | 43 | class AbsoluteAxis(Control): 44 | pass 45 | 46 | 47 | class Button(Control): 48 | pass 49 | -------------------------------------------------------------------------------- /docs/build/html/_sources/index.txt: -------------------------------------------------------------------------------- 1 | .. pygame documentation master file, created by 2 | sphinx-quickstart on Sat Sep 20 01:48:40 2014. 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 pygame2's documentation! 7 | =================================== 8 | 9 | Contents: 10 | 11 | .. toctree:: 12 | :maxdepth: 4 13 | 14 | pygame2 15 | 16 | This is a new project. There have been others like it. We hope that we 17 | can be the first successful pygame2 project. You may be curious as to 18 | why there is documentation available for a project that hasn't even 19 | reached its first minor version number? We want to make sure we 20 | establish a good development process early on so that we don't 21 | scramble to "get it right" if and when the time comes that pygame2 22 | catches on. We'll have documentation, test coverage and continuous 23 | integration from day one. 24 | 25 | TODO 26 | ==== 27 | 28 | * Everything 29 | 30 | 31 | Indices and tables 32 | ================== 33 | 34 | * :ref:`genindex` 35 | * :ref:`modindex` 36 | * :ref:`search` 37 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: python 2 | python: 3 | - '3.4' 4 | #- 'pypy3' 5 | before_install: 6 | - if [ -z "$TRAVIS_TAG" ]; then export DISPLAY=:99.0; fi 7 | - if [ -z "$TRAVIS_TAG" ]; then sh -e /etc/init.d/xvfb start; fi 8 | install: 9 | # - if [ -z "$TRAVIS_TAG" ]; then sudo apt-get update -qq; fi 10 | # - if [ -z "$TRAVIS_TAG" ]; then sudo apt-get build-dep python-pygame; fi 11 | - if [ -z "$TRAVIS_TAG" ]; then pip install .; fi 12 | - if [ -z "$TRAVIS_TAG" ]; then pip install -r requirements.txt; fi 13 | notifications: 14 | irc: chat.freenode.net#pygame2 15 | email: 16 | recipients: 17 | - leif.theden@gmail.com 18 | - alecks.g@gmail.com 19 | on_success: always 20 | on_failure: always 21 | script: if [ -z "$TRAVIS_TAG" ]; then nosetests; fi 22 | after_success: 23 | - git remote rm origin 24 | - git remote add origin https://wkmanire:${GITHUBTOKEN}@github.com/wkmanire/pygame.git 25 | - build/release.sh $((TRAVIS_BUILD_NUMBER)) 26 | env: 27 | global: 28 | secure: jrblAdTsoRwoBqjVqTXaS27fyJiUq5RdPFTnM/FCl85u/PVQrQ93wRsgliBCdTWTXa1KfOojz+6OIpLi5IzY2ndwQr2myepcpd94qVUustQmExVNVBYwMpCghvAB5Vz95ExaMq+oRbBpgUdNQQa2Hpo4OT+BTqUPWi1o2+LJvjc= 29 | -------------------------------------------------------------------------------- /docs/source/index.rst: -------------------------------------------------------------------------------- 1 | .. pygame documentation master file, created by 2 | sphinx-quickstart on Sat Sep 20 01:48:40 2014. 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 pygame2's documentation! 7 | =================================== 8 | 9 | Contents: 10 | 11 | .. toctree:: 12 | :maxdepth: 4 13 | 14 | pygame2 15 | 16 | This is a new project. There have been others like it. We hope that we 17 | can be the first successful pygame2 project. You may be curious as to 18 | why there is documentation available for a project that hasn't even 19 | reached its first minor version number? We want to make sure we 20 | establish a good development process early on so that we don't 21 | scramble to "get it right" if and when the time comes that pygame2 22 | catches on. We'll have documentation, test coverage and continuous 23 | integration from day one. 24 | 25 | .. automodule:: pygame2 26 | 27 | 28 | TODO 29 | ==== 30 | 31 | * Everything 32 | 33 | 34 | Indices and tables 35 | ================== 36 | 37 | * :ref:`genindex` 38 | * :ref:`modindex` 39 | * :ref:`search` 40 | -------------------------------------------------------------------------------- /tests/test_image.py: -------------------------------------------------------------------------------- 1 | """ 2 | Pygame.image Tests 3 | """ 4 | 5 | from unittest import TestCase 6 | from logging import getLogger 7 | import os 8 | 9 | import pygame2 10 | 11 | 12 | logger = getLogger() 13 | supported_formats = ['P', 14 | 'RGB', 15 | 'RGBX', 16 | 'RGBA', 17 | 'ARGB', 18 | 'RGBA_PREMULT', 19 | 'ARGB_PREMULT'] 20 | 21 | default_generic_filename = 'pygame2' 22 | default_filename = default_generic_filename + '.png' 23 | 24 | 25 | class ImageTests(TestCase): 26 | @classmethod 27 | def setUpClass(cls): 28 | script_path = os.path.realpath(__file__) 29 | test_dir_path = os.path.dirname(script_path) 30 | cls.image_path = os.path.join(test_dir_path, 'pygame2') 31 | 32 | def get_image_path(self, extension): 33 | return self.image_path + extension 34 | 35 | def assertIsValidSurface(self, surface): 36 | self.assertIsInstance(surface, pygame2.surface.Surface) 37 | self.assertGreater(surface.get_width(), 0) 38 | self.assertGreater(surface.get_height(), 0) 39 | 40 | # def test_frombuffer(self): 41 | # self.fail() 42 | -------------------------------------------------------------------------------- /pygame2/screen.py: -------------------------------------------------------------------------------- 1 | """ 2 | Abstract Hierarchy of Window Concepts: 3 | 4 | 'display', basically this is the gpu 5 | 'screen', could be the is a logical screen on one monitor or more 6 | 'window', as is 7 | 'canvas', drawing context for graphics. 8 | """ 9 | 10 | 11 | class Screen: 12 | """A virtual monitor that supports fullscreen windows. 13 | 14 | Screens typically map onto a physical display such as a 15 | monitor, television or projector. Selecting a screen for a window 16 | has no effect unless the window is made fullscreen, in which case 17 | the window will fill only that particular virtual screen. 18 | 19 | The :attr:`width` and :attr:`height` attributes of a screen give the 20 | current resolution of the screen. The :attr:`x` and :attr:`y` attributes 21 | give the global location of the top-left corner of the screen. This is 22 | useful for determining if screens arranged above or next to one another. 23 | 24 | Use :func:`~Display.get_screens` or :func:`~Display.get_default_screen` 25 | to obtain an instance of this class. 26 | 27 | :guide:`screens` 28 | """ 29 | def __init__(self): 30 | pass 31 | 32 | def create_window(self, *args, **kwargs): 33 | raise NotImplementedError 34 | -------------------------------------------------------------------------------- /pygame2/__init__.py: -------------------------------------------------------------------------------- 1 | from .rect import Rect 2 | from .surface import Surface 3 | 4 | # "required" modules 5 | from . import animation 6 | from . import app 7 | from . import audio 8 | from . import clock 9 | from . import core 10 | from . import display 11 | from . import event 12 | from . import graphics 13 | from . import group 14 | from . import renderer 15 | from . import screen 16 | from . import sprite 17 | from . import surface 18 | 19 | 20 | # This section below disables error checking for better performance 21 | import OpenGL 22 | 23 | OpenGL.ERROR_CHECKING = False 24 | 25 | 26 | # TODO: MAKE SURE THIS STUFF ISN'T CALLED A BUNCH OF TIMES 27 | def get_args(): 28 | from argparse import ArgumentParser 29 | import logging 30 | 31 | parser = ArgumentParser(prog="pygame2", description="pygame2 init") 32 | parser.add_argument( 33 | "--log-level", 34 | choices=["DEBUG", "INFO", "WARNING", "ERROR", "CRITICAL"], 35 | default="WARNING", help="Verbosity of logging output") 36 | 37 | args = parser.parse_args() 38 | 39 | # logger = logging.getLogger("pygame2.__init__") 40 | logging.basicConfig( 41 | level=getattr(logging, args.log_level), 42 | format="%(name)s:%(filename)s:%(lineno)d:%(levelname)s: %(message)s") 43 | 44 | # get_args() 45 | -------------------------------------------------------------------------------- /pygame2/core/input/__init__.py: -------------------------------------------------------------------------------- 1 | """ 2 | this module will define input devices not handled by 3 | the window. in practical terms this is most usb 4 | devices including gamepads, joysticks, etc 5 | 6 | keyboard and mouse events will most likely come from 7 | the core platform, but that is not guaranteed across 8 | platforms. 9 | """ 10 | from pygame2.core import core_modules 11 | 12 | core_modules['input'] = ('input_pyglet', ) 13 | 14 | 15 | def list_sources(**kwargs): 16 | """ list input sources available to use 17 | 18 | :param kwargs: 19 | :return: list of inputs supported 20 | """ 21 | from pygame2.core import core_providers 22 | 23 | keyboard = None 24 | for provider in core_providers['input']: 25 | try: 26 | keyboard = provider.Keyboard(**kwargs) 27 | break 28 | except: 29 | raise 30 | 31 | return keyboard 32 | 33 | 34 | def get_keyboard(**kwargs): 35 | """ 36 | :return: Pygame2 window (depends on event queue) 37 | """ 38 | from pygame2.core import core_providers 39 | 40 | keyboard = None 41 | for provider in core_providers['input']: 42 | try: 43 | keyboard = provider.Keyboard(**kwargs) 44 | break 45 | except: 46 | raise 47 | 48 | return keyboard 49 | -------------------------------------------------------------------------------- /pygame2/display.py: -------------------------------------------------------------------------------- 1 | """ 2 | Abstract Hierarchy of Window Concepts: 3 | 4 | 'display', basically this is the gpu 5 | 'screen', could be the is a logical screen on one monitor or more 6 | 'window', as is 7 | 'canvas', drawing context for graphics. 8 | """ 9 | 10 | 11 | class Display: 12 | """ Display device containing one for more screens 13 | """ 14 | def get_screens(self): 15 | """Get the available screens. 16 | 17 | A typical multi-monitor workstation comprises one :class:`Display` 18 | with multiple :class:`Screen` s. This method returns a list of 19 | screens which can be enumerated to select one for full-screen display. 20 | 21 | For the purposes of creating an OpenGL config, the default screen 22 | will suffice. 23 | 24 | :rtype: list of :class:`Screen` 25 | """ 26 | raise NotImplementedError('abstract') 27 | 28 | def get_default_screen(self): 29 | """Get the default screen as specified by the user's operating system 30 | preferences. 31 | 32 | :rtype: :class:`Screen` 33 | """ 34 | return self.get_screens()[0] 35 | 36 | def get_windows(self): 37 | """Get the windows currently attached to this display. 38 | 39 | :rtype: sequence of :class:`~pygame2.window.Window` 40 | """ 41 | raise NotImplementedError 42 | -------------------------------------------------------------------------------- /pygame2/core/image/image_pysdl2.py: -------------------------------------------------------------------------------- 1 | """ 2 | USE PILLOW 3 | """ 4 | from . import ImageLoaderBase 5 | 6 | 7 | class ImageLoader(ImageLoaderBase): 8 | """ fairly useless as it requires the 9 | pygame display to be initialized 10 | """ 11 | 12 | @staticmethod 13 | def load(filename, namehint=None): 14 | # fn, ext = os.path.splitext(filename) 15 | # im = pygame.image.load(filename, ext) 16 | # 17 | # fmt = '' 18 | # if im.get_bytesize() == 3: 19 | # fmt = 'rgb' 20 | # elif im.get_bytesize() == 4: 21 | # fmt = 'rgba' 22 | # else: 23 | # im = im.convert(32) 24 | # fmt = 'rgba' 25 | # data = pygame.image.tostring(im, fmt.upper()) 26 | # return ImageData(im.get_width(), im.get_height(), fmt, data, 27 | # source=filename) 28 | raise Exception 29 | 30 | @staticmethod 31 | def save(surface, filename): 32 | raise NotImplementedError 33 | 34 | @staticmethod 35 | def get_extended(): 36 | raise NotImplementedError 37 | 38 | @staticmethod 39 | def tostring(surface, format, flipped=False): 40 | raise NotImplementedError 41 | 42 | @staticmethod 43 | def fromstring(string, size, format, flipped=False): 44 | raise NotImplementedError 45 | 46 | @staticmethod 47 | def frombuffer(string, size, format, flipped=False): 48 | raise NotImplementedError 49 | 50 | @staticmethod 51 | def tobuffer(surface, size, format, flipped=False): 52 | raise NotImplementedError 53 | -------------------------------------------------------------------------------- /tests/docs/coverage/jquery.isonscreen.js: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2010 2 | * @author Laurence Wheway 3 | * Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php) 4 | * and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses. 5 | * 6 | * @version 1.2.0 7 | */ 8 | (function($) { 9 | jQuery.extend({ 10 | isOnScreen: function(box, container) { 11 | //ensure numbers come in as intgers (not strings) and remove 'px' is it's there 12 | for(var i in box){box[i] = parseFloat(box[i])}; 13 | for(var i in container){container[i] = parseFloat(container[i])}; 14 | 15 | if(!container){ 16 | container = { 17 | left: $(window).scrollLeft(), 18 | top: $(window).scrollTop(), 19 | width: $(window).width(), 20 | height: $(window).height() 21 | } 22 | } 23 | 24 | if( box.left+box.width-container.left > 0 && 25 | box.left < container.width+container.left && 26 | box.top+box.height-container.top > 0 && 27 | box.top < container.height+container.top 28 | ) return true; 29 | return false; 30 | } 31 | }) 32 | 33 | 34 | jQuery.fn.isOnScreen = function (container) { 35 | for(var i in container){container[i] = parseFloat(container[i])}; 36 | 37 | if(!container){ 38 | container = { 39 | left: $(window).scrollLeft(), 40 | top: $(window).scrollTop(), 41 | width: $(window).width(), 42 | height: $(window).height() 43 | } 44 | } 45 | 46 | if( $(this).offset().left+$(this).width()-container.left > 0 && 47 | $(this).offset().left < container.width+container.left && 48 | $(this).offset().top+$(this).height()-container.top > 0 && 49 | $(this).offset().top < container.height+container.top 50 | ) return true; 51 | return false; 52 | } 53 | })(jQuery); 54 | -------------------------------------------------------------------------------- /tests/test_time.py: -------------------------------------------------------------------------------- 1 | from unittest import TestCase 2 | 3 | 4 | class TimeTests(TestCase): 5 | pass 6 | 7 | # def setUp(self): 8 | # # self.assertTrue(pygame2.init()) 9 | # self.clock = Clock() 10 | # 11 | # def test_get_ticks(self): 12 | # # ticks = self.clock.get_ticks() 13 | # # self.assertTrue(ticks > 0) 14 | # pass 15 | # 16 | # def test_wait(self): 17 | # ms = time.wait(10) 18 | # self.assertTrue(ms > 0) 19 | # 20 | # def test_delay(self): 21 | # ms = self.delay(10) 22 | # self.assertTrue(ms > 0) 23 | # 24 | # def test_set_timer(self): 25 | # pass 26 | # 27 | # def test_Clock_tick(self): 28 | # ms1 = self.clock.tick(10) 29 | # self.assertTrue(ms1 > 0) 30 | # ms2 = self.clock.tick() 31 | # self.assertTrue(ms2 - ms1 > 0) 32 | # ms = self.clock.tick(10) 33 | # self.assertTrue(ms > 0) 34 | # 35 | # def test_Clock_tick_busy_loop(self): 36 | # ms1 = self.clock.tick_busy_loop(10) 37 | # self.assertTrue(ms1 > 0) 38 | # ms2 = self.clock.tick_busy_loop(10) 39 | # self.assertTrue(ms2 - ms1 > 0) 40 | # ms = self.clock.tick(100) 41 | # self.assertTrue(ms > 0) 42 | # 43 | # def test_Clock_get_time(self): 44 | # self.clock.tick(100) 45 | # self.clock.tick(100) 46 | # ms = self.clock.get_time() 47 | # self.assertTrue(ms > 0) 48 | # 49 | # def test_Clock_get_rawtime(self): 50 | # pass 51 | # 52 | # # self.clock.tick(100) 53 | # 54 | # # self.clock.tick(100) 55 | # # ms = self.clock.get_rawtime() 56 | # # self.assertTrue(ms > 0) 57 | # 58 | # def test_Clock_get_fps(self): 59 | # for i in range(0, 10): 60 | # self.clock.tick(100) 61 | # fps = self.clock.get_fps() 62 | # self.assertTrue(fps > 0) 63 | -------------------------------------------------------------------------------- /pygame2/core/image/image_pyglet.py: -------------------------------------------------------------------------------- 1 | """ 2 | Image loading from pyglet. 3 | 4 | 5 | USE PILLOW 6 | 7 | 8 | Pyglet has many pure-python based image loading functions, 9 | but tends to be slower than pygame or Pillow 10 | """ 11 | 12 | import pyglet 13 | 14 | from . import ImageLoaderBase, ImageData 15 | 16 | 17 | __all__ = ('ImageLoader', ) 18 | 19 | 20 | class ImageLoader(ImageLoaderBase): 21 | @staticmethod 22 | def load(filename, namehint=None): 23 | raise NotImplementedError 24 | 25 | if namehint is None: 26 | im = pyglet.image.load(filename) 27 | else: 28 | im = pyglet.image.load(namehint, file=filename) 29 | 30 | return ImageData(im.width, im.height, im.format, im.get_image_data()) 31 | 32 | @staticmethod 33 | def save(surface, filename): 34 | # with open(filename, 'wb') as fh: 35 | # surface.get_imagedata().save(filename=filename, file=fh) 36 | raise NotImplementedError 37 | 38 | @staticmethod 39 | def get_extended(): 40 | raise NotImplementedError 41 | 42 | @staticmethod 43 | def tostring(surface, format, flipped=False): 44 | # im = surface.get_imagedata() 45 | # pitch = -im.pitch if flipped else im.pitch 46 | # data = im.get_data(format, pitch) 47 | # return data 48 | raise NotImplementedError 49 | 50 | @staticmethod 51 | def fromstring(string, size, format, flipped=False): 52 | # pitch = size[0] * len(string) 53 | # if flipped: 54 | # pitch = -pitch 55 | # im = pyglet.image.ImageData(size[0], size[1], format, string, pitch) 56 | # return pygame2.surface.Surface.from_imagedata(im) 57 | raise NotImplementedError 58 | 59 | @staticmethod 60 | def frombuffer(string, size, format): 61 | raise NotImplementedError 62 | 63 | def tobuffer(surface, size, fmt, flipped=False): 64 | raise NotImplementedError 65 | -------------------------------------------------------------------------------- /tests/test_surface.py: -------------------------------------------------------------------------------- 1 | """ 2 | Surface Tests 3 | 4 | """ 5 | 6 | from unittest import TestCase, skip 7 | from mock import MagicMock 8 | from logging import getLogger 9 | 10 | from pygame2.surface import Surface 11 | from pygame2.rect import Rect 12 | 13 | logger = getLogger() 14 | 15 | 16 | class SurfaceTests(TestCase): 17 | def setUp(self): 18 | self.size = (32, 32) 19 | self.s = Surface(self.size) 20 | 21 | def test_fill(self): 22 | """ Just test and make sure no exceptions are raised 23 | """ 24 | self.s.fill((0, 0, 0)) 25 | self.s.fill((0, 0, 0, 0)) 26 | 27 | def test_get_rect(self): 28 | rect = Rect((0, 0), self.size) 29 | self.assertEqual(rect, self.s.get_rect()) 30 | 31 | @skip('needs refactor') 32 | def test_get_size(self): 33 | size = self.s.get_size() 34 | self.assertEqual(self.size, size) 35 | 36 | @skip('needs refactor') 37 | def test_get_width(self): 38 | width = self.s.get_width() 39 | self.assertEqual(self.size[0], width) 40 | 41 | @skip('needs refactor') 42 | def test_get_height(self): 43 | height = self.s.get_height() 44 | self.assertEqual(self.size[1], height) 45 | 46 | def test_lock(self): 47 | """ Just test and make sure no exceptions are raised 48 | """ 49 | self.s.lock() 50 | self.s.unlock() 51 | 52 | def test_unlock(self): 53 | """ Just test and make sure no exceptions are raised 54 | """ 55 | self.s.lock() 56 | self.s.unlock() 57 | 58 | def test_from_imagedata(self): 59 | """sets the size and image data member of the surface""" 60 | imagedata = MagicMock() 61 | imagedata.width = 10 62 | imagedata.height = 15 63 | s = self.s.from_imagedata(imagedata) 64 | self.assertEqual(s.get_rect().size, (10, 15)) 65 | self.assertIs(imagedata, s.get_imagedata()) 66 | 67 | def test_get_lock(self): 68 | self.assertIs(self.s._lock, self.s.get_lock()) 69 | -------------------------------------------------------------------------------- /pygame2/audio.py: -------------------------------------------------------------------------------- 1 | """ 2 | Where pygame made sounds and music different, pygame2 3 | unifies them. there is no confusing arbitrary difference 4 | between 'sounds', and 'music'. 5 | 6 | instead, the difference is a much more palpable 7 | 'stored in memory' or 'streamed'. 8 | 9 | API for determining each is in progress 10 | """ 11 | from pygame2.event import EventDispatcher 12 | 13 | 14 | class SoundBase(EventDispatcher): 15 | """Base for objects that play sounds/music 16 | """ 17 | _source = None 18 | _volume = 1.0 19 | _state = None 20 | _loop = None 21 | _position = None 22 | _length = None 23 | 24 | @property 25 | def source(self): 26 | return self._source 27 | 28 | @property 29 | def volume(self): 30 | return self._volume 31 | 32 | @volume.setter 33 | def volume(self, value): 34 | if not self._volume == value: 35 | self._volume = value 36 | 37 | @property 38 | def state(self): 39 | return self._state 40 | 41 | @state.setter 42 | def state(self, value): 43 | pass 44 | 45 | @property 46 | def position(self): 47 | return self._position 48 | 49 | @position.setter 50 | def position(self, value): 51 | raise NotImplementedError('abstract') 52 | 53 | @property 54 | def length(self): 55 | raise NotImplementedError('abstract') 56 | 57 | def load(self): 58 | """Load the file into memory.""" 59 | raise NotImplementedError('abstract') 60 | 61 | def unload(self): 62 | """Unload the file from memory.""" 63 | raise NotImplementedError('abstract') 64 | 65 | def play(self): 66 | """Play the file.""" 67 | self.state = 'play' 68 | self.broadcast('on_play') 69 | 70 | def stop(self): 71 | """Stop playback.""" 72 | self.state = 'stop' 73 | self.broadcast('on_stop') 74 | 75 | def seek(self, position): 76 | """Go to the (in seconds).""" 77 | raise NotImplementedError('abstract') 78 | -------------------------------------------------------------------------------- /pygame2/core/image/image_pillow.py: -------------------------------------------------------------------------------- 1 | """ 2 | Image loading based on Pillow 3 | 4 | THIS IS OUR DEFAULT LOADER 5 | 6 | Please do not use PIL 7 | """ 8 | from PIL import Image 9 | 10 | from . import ImageLoaderBase, ImageData 11 | 12 | 13 | __all__ = ('ImageLoader', ) 14 | 15 | 16 | class ImageLoader(ImageLoaderBase): 17 | @staticmethod 18 | def load(filename, namehint=None): 19 | """ Load an image 20 | 21 | This will open and decode an image and store the contents in memory. 22 | Currently, only RGBA mode images are supported as GPU Textures. 23 | 24 | :param filename: 25 | :param namehint: 26 | :return: 27 | """ 28 | image = Image.open(filename) 29 | 30 | # Convert bitmap and palette images to component 31 | if image.mode in ('1', 'P'): 32 | image = image.convert() 33 | 34 | if image.mode not in ('L', 'LA', 'RGB', 'RGBA'): 35 | raise Exception('Unsupported mode "%s"' % image.mode) 36 | 37 | # TODO: make in-memory format configurable 38 | image = image.convert("RGBA") 39 | 40 | # tostring is deprecated, replaced by tobytes in Pillow (PIL fork) 41 | # (1.1.7) PIL still uses it 42 | image_xform = getattr(image, "tobytes", getattr(image, "tostring")) 43 | width, height = image.size 44 | 45 | return ImageData(width, height, image.mode, 46 | image_xform('raw', 'RGBA', 0, -1)) 47 | 48 | @staticmethod 49 | def save(surface, filename): 50 | raise NotImplementedError 51 | 52 | @staticmethod 53 | def get_extended(): 54 | raise NotImplementedError 55 | 56 | @staticmethod 57 | def tostring(surface, fmt, flipped=False): 58 | raise NotImplementedError 59 | 60 | @staticmethod 61 | def fromstring(string, size, fmt, flipped=False): 62 | raise NotImplementedError 63 | 64 | @staticmethod 65 | def frombuffer(string, size, fmt, flipped=False): 66 | raise NotImplementedError 67 | 68 | @staticmethod 69 | def tobuffer(surface, size, fmt, flipped=False): 70 | raise NotImplementedError 71 | -------------------------------------------------------------------------------- /pygame2/core/platform/__init__.py: -------------------------------------------------------------------------------- 1 | """ 2 | Application windows and some input events are closely tied together, 3 | so they have been lumped together in a generic 'platform' 4 | interface. A platform consists of the following: 5 | Window or windows 6 | Platform Event Loop 7 | Input Interfaces 8 | 9 | the platform event loop must be able to open and manage windows, 10 | get keyboard and mouse input, and provide a way to get time. 11 | 12 | generally, the window will be the primary receiver of keyboard 13 | and mouse events, so we capture them here, instead of the input 14 | module. 15 | 16 | Where possible, if a platform provides functions that do not depend 17 | on the functions listed above, then that functionality will be 18 | split up and made into a separate module. 19 | 20 | Abstract Hierarchy of Window Concepts: 21 | 22 | 'display', basically this is the gpu 23 | 'screen', could be the is a logical screen on one monitor or more 24 | 'window', as is 25 | 'canvas', drawing context for graphics. 26 | """ 27 | from pygame2.core import core_modules 28 | 29 | 30 | __all__ = ( 31 | 'get_event_loop', 32 | 'get_platform_event_queue', 33 | 'create_window') 34 | 35 | core_modules['platform'] = ('platform_pyglet', ) 36 | 37 | 38 | def get_event_loop(): 39 | pass 40 | 41 | 42 | def get_platform_event_queue(): 43 | """ 44 | :return: Pygame2 event queue (depends on platform) 45 | """ 46 | from pygame2.core import core_providers 47 | 48 | queue = None 49 | for provider in core_providers['platform']: 50 | try: 51 | queue = provider.PlatformEventQueue() 52 | break 53 | except: 54 | raise 55 | 56 | return queue 57 | 58 | 59 | def get_display(index=-1): 60 | """ Get a display. 61 | 62 | :param index: 63 | :return: 64 | """ 65 | pass 66 | 67 | 68 | def create_window(**kwargs): 69 | """ 70 | :return: Pygame2 window (depends on event queue) 71 | """ 72 | from pygame2.core import core_providers 73 | 74 | win = None 75 | for provider in core_providers['platform']: 76 | try: 77 | win = provider.Window(**kwargs) 78 | break 79 | except: 80 | raise 81 | 82 | return win 83 | -------------------------------------------------------------------------------- /pygame2/docs/coverage/jquery.isonscreen.js: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2010 2 | * @author Laurence Wheway 3 | * Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php) 4 | * and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses. 5 | * 6 | * @version 1.2.0 7 | */ 8 | (function ($) { 9 | jQuery.extend({ 10 | isOnScreen: function (box, container) { 11 | //ensure numbers come in as intgers (not strings) and remove 'px' is it's there 12 | for (var i in box) { 13 | box[i] = parseFloat(box[i]) 14 | } 15 | ; 16 | for (var i in container) { 17 | container[i] = parseFloat(container[i]) 18 | } 19 | ; 20 | 21 | if (!container) { 22 | container = { 23 | left: $(window).scrollLeft(), 24 | top: $(window).scrollTop(), 25 | width: $(window).width(), 26 | height: $(window).height() 27 | } 28 | } 29 | 30 | if (box.left + box.width - container.left > 0 && 31 | box.left < container.width + container.left && 32 | box.top + box.height - container.top > 0 && 33 | box.top < container.height + container.top 34 | ) return true; 35 | return false; 36 | } 37 | }) 38 | 39 | 40 | jQuery.fn.isOnScreen = function (container) { 41 | for (var i in container) { 42 | container[i] = parseFloat(container[i]) 43 | } 44 | ; 45 | 46 | if (!container) { 47 | container = { 48 | left: $(window).scrollLeft(), 49 | top: $(window).scrollTop(), 50 | width: $(window).width(), 51 | height: $(window).height() 52 | } 53 | } 54 | 55 | if ($(this).offset().left + $(this).width() - container.left > 0 && 56 | $(this).offset().left < container.width + container.left && 57 | $(this).offset().top + $(this).height() - container.top > 0 && 58 | $(this).offset().top < container.height + container.top 59 | ) return true; 60 | return false; 61 | } 62 | })(jQuery); 63 | -------------------------------------------------------------------------------- /pygame2/graphics/texture.py: -------------------------------------------------------------------------------- 1 | from OpenGL.GL import * 2 | 3 | mipmaps = 0 4 | 5 | # TODO: MIPMAPS. there is some code to support is, but isn't complete 6 | 7 | 8 | class Texture: 9 | def __init__(self, width, height, data): 10 | self.target = GL_TEXTURE_2D 11 | 12 | id = glGenTextures(1) 13 | self.id = id 14 | 15 | # TODO: check for NPOT limitations 16 | 17 | self.bind() 18 | 19 | if mipmaps: 20 | # required for automatic mipmaps on legacy ATI systems 21 | glEnable(GL_TEXTURE_2D) 22 | else: 23 | # required on some platforms to deal with images without mipmaps 24 | glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_BASE_LEVEL, 0) 25 | glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LEVEL, 0) 26 | 27 | glPixelStorei(GL_PACK_ALIGNMENT, 1) 28 | glPixelStorei(GL_UNPACK_ALIGNMENT, 1) 29 | 30 | # no texture storage api until 4.3 31 | glTexImage2D( 32 | GL_TEXTURE_2D, # target 33 | 0, # level, 0 = no minimap 34 | GL_RGBA, # internalformat 35 | width, # width 36 | height, # height 37 | 0, # border, always 0 in OpenGL ES 38 | GL_RGBA, # format 39 | GL_UNSIGNED_BYTE, # type 40 | data # pixel data 41 | ) 42 | 43 | if mipmaps: 44 | # generate mipmaps automatically 45 | glGenerateMipmap(GL_TEXTURE_2D) 46 | glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT) 47 | glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT) 48 | glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR) 49 | glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, 50 | GL_LINEAR_MIPMAP_LINEAR) 51 | 52 | # required for automatic mipmaps on legacy ATI systems 53 | glDisable(GL_TEXTURE_2D) 54 | 55 | self.unbind() 56 | 57 | def __del__(self): 58 | self.delete() 59 | 60 | def bind(self): 61 | glBindTexture(GL_TEXTURE_2D, self.id) 62 | 63 | def unbind(self): 64 | glBindTexture(GL_TEXTURE_2D, 0) 65 | 66 | def delete(self): 67 | glDeleteTextures([self.id]) 68 | self.id = None 69 | -------------------------------------------------------------------------------- /tests/integration/image.py: -------------------------------------------------------------------------------- 1 | # These are integration tests, not a unit tests 2 | # ########################################################### 3 | # def _test_load_file(self, filename): 4 | # surface = pygame2.image.load(filename) 5 | # self.assertIsValidSurface(surface) 6 | # with open(filename, 'rb') as fh: 7 | # surface = pygame2.image.load(fh, filename) 8 | # self.assertIsValidSurface(surface) 9 | # 10 | # def test_load_jpg(self): 11 | # self._test_load_file(default_generic_filename + '.jpg') 12 | # 13 | # def test_load_png(self): 14 | # self._test_load_file(default_generic_filename + '.png') 15 | # 16 | # def test_load_gif(self): 17 | # self._test_load_file(default_generic_filename + '.gif') 18 | # 19 | # def test_load_bmp(self): 20 | # self._test_load_file(default_generic_filename + '.bmp') 21 | # 22 | # def _test_save_file(self, extension): 23 | # test_filename = 'test_save' + extension 24 | # fmt = 'ARGB' 25 | # original = pygame2.image.load(default_filename) 26 | # pygame2.image.save(original, test_filename) 27 | # surface = pygame2.image.load(test_filename) 28 | # os.unlink(test_filename) 29 | # self.assertEqual(pygame2.image.tostring(original, fmt), 30 | # pygame2.image.tostring(surface, fmt)) 31 | # 32 | # def test_save_png(self): 33 | # self._test_save_file('.png') 34 | # 35 | # def test_save_bmp(self): 36 | # self._test_save_file('.bmp') 37 | # 38 | # def test_save_gif(self): 39 | # self._test_save_file('.gif') 40 | # 41 | # def test_save_jpg(self): 42 | # self._test_save_file('.jpg') 43 | # 44 | # def test_get_extended(self): 45 | # self.fail() 46 | # 47 | # def test_tostring_all_formats(self): 48 | # surface = pygame2.core.image.image.load(self.get_image_path('.png')) 49 | # for fmt in supported_formats: 50 | # pygame2.core.image.image.tostring(surface, fmt) 51 | # 52 | # def test_tostring_fromstring(self): 53 | # fmt = 'ARGB' 54 | # original = pygame2.core.image.image.load(self.get_image_path('.png')) 55 | # size = original.get_size() 56 | # data = pygame2.core.image.image.tostring(original, fmt) 57 | # surface2 = pygame2.core.image.image.fromstring(data, size, fmt) 58 | # self.assertEqual(data, pygame2.core.image.image.tostring(surface2, fmt)) 59 | # self.assertEqual(pygame2.core.image.image.tostring(original, fmt), 60 | # pygame2.core.image.image.tostring(surface2, fmt)) 61 | # # ########################################################### 62 | -------------------------------------------------------------------------------- /pygame2/app.py: -------------------------------------------------------------------------------- 1 | """pygame2 app 2 | 3 | * contains event loop 4 | * dispatches events 5 | * reads input 6 | * manages audio 7 | * has clock/scheduler 8 | * handles screen/window/display updating 9 | * loads shaders, opengl programs, etc 10 | """ 11 | import time 12 | 13 | import pygame2 14 | from pygame2.event import EventDispatcher 15 | 16 | __all__ = ('App', ) 17 | 18 | 19 | class App(EventDispatcher): 20 | 21 | __events__ = ('on_enter', 'on_close', 'on_exit') 22 | 23 | def __init__(self): 24 | super().__init__() 25 | self.clock = pygame2.clock.Clock() 26 | self.running = False 27 | self.windows = list() 28 | 29 | def start(self): 30 | if self.running: 31 | print('App.start called twice') 32 | raise RuntimeError 33 | 34 | self.running = True 35 | self.broadcast('on_enter') 36 | 37 | def run(self): 38 | """ 39 | send start event 40 | manage event loop 41 | """ 42 | self.start() 43 | 44 | # get our events from the platform 45 | platform_queue = pygame2.core.platform.get_platform_event_queue() 46 | platform_queue.start() 47 | 48 | # TODO: address the run method when adding support for multiple windows 49 | try: 50 | window = self.windows[0] 51 | except IndexError: 52 | print('create a window before calling App.run') 53 | raise RuntimeError 54 | 55 | window.subscribe('on_close', self.stop) 56 | 57 | while self.running: 58 | self.clock.tick() 59 | 60 | platform_queue.get() 61 | 62 | window.switch_to() 63 | 64 | # TODO: aggrigate pyglet/window events into our monolithic queue 65 | 66 | # pyglet windows maintain their own queue of events 67 | # this method tells the window to dispatch any events in its queue 68 | window.dispatch_pending_events() 69 | window.broadcast('on_draw') 70 | window.flip() 71 | 72 | # TODO: make sure we can sleep correctly on all platforms 73 | # sleep_time = self.clock.get_idle_time() 74 | time.sleep(.015) 75 | 76 | self.broadcast('on_exit') 77 | 78 | def stop(self): 79 | self.running = False 80 | 81 | def create_window(self, *args, **kwargs): 82 | window = pygame2.core.platform.create_window(**kwargs) 83 | self.windows.append(window) 84 | return window 85 | 86 | -------------------------------------------------------------------------------- /pygame2/surface.py: -------------------------------------------------------------------------------- 1 | """ 2 | pygame2 image abstractions 3 | 4 | ImageData => data that represents image in variety of formats 5 | able to be converted into other formats 6 | Surface => contains ImageData, able to be 'drawn' onto screen 7 | will include some warnings if manually manipulated 8 | Sprite => contains Surface, able to be manipulated easily 9 | able to live in groups and batches 10 | Animation => contains Several surfaces, operated like Sprite 11 | 12 | future: 13 | As images are loaded from disk, they will be converted to a 14 | common pixel format, and grouped into large textures. 15 | 16 | It will be up to the programmer to give pygame2 hints which 17 | images should be shared on a texture, and it will give a 18 | performance penalty if commonly-used-together textures are 19 | often not drawn together. 20 | """ 21 | 22 | from pygame2.rect import Rect 23 | from threading import Lock 24 | 25 | 26 | __all__ = ('SubSurfaceData', 'Surface') 27 | 28 | 29 | class SubSurfaceData: 30 | pass 31 | 32 | 33 | class Surface: 34 | def __init__(self, size, flags=0, depth=0, masks=None): 35 | w, h = (int(i) for i in size) 36 | self._width = w 37 | self._height = h 38 | self._imagedata = None 39 | self._lock = Lock() 40 | 41 | def upload_to_gpu(self): 42 | pass 43 | 44 | @classmethod 45 | def from_imagedata(cls, imagedata): 46 | s = Surface((imagedata.width, imagedata.height)) 47 | s._imagedata = imagedata 48 | return s 49 | 50 | def get_imagedata(self): 51 | return self._imagedata 52 | 53 | def get_lock(self): 54 | return self._lock 55 | 56 | def lock(self): 57 | self._lock.acquire() 58 | 59 | def unlock(self): 60 | self._lock.release() 61 | 62 | def fill(self, color, rect=None, special_flags=0): 63 | pass 64 | 65 | def get_rect(self, **kwargs): 66 | return Rect(0, 0, self._width, self._height) 67 | 68 | def get_size(self): 69 | return self._imagedata.width, self._imagedata.height 70 | 71 | def get_width(self): 72 | return self._imagedata.width 73 | 74 | def get_height(self): 75 | return self._imagedata.height 76 | 77 | def get_region(self, area): 78 | """ 79 | Get a region of the Surface's ImageData 80 | 81 | :param area: pygame2.Rect 82 | :rtype: pyglet.ImageDataRegion 83 | """ 84 | return self._imagedata.get_region(*area) 85 | 86 | -------------------------------------------------------------------------------- /tests/test_sprite.py: -------------------------------------------------------------------------------- 1 | """ 2 | all tests are borked until the opengl issues are sorted out 3 | """ 4 | 5 | import unittest 6 | from unittest import skip 7 | from mock import Mock, patch 8 | 9 | from pygame2 import sprite, renderer 10 | import OpenGL 11 | 12 | 13 | class SpriteTests(unittest.TestCase): 14 | @skip("draw api not ready") 15 | def test_add_group(self): 16 | s = sprite.Sprite() 17 | g = renderer.SpriteRenderer() 18 | g.add(s) 19 | self.assertIn(s, g) 20 | 21 | @skip("draw api not ready") 22 | def test_remove_group(self): 23 | s = sprite.Sprite() 24 | g = renderer.SpriteRenderer() 25 | g.add(s) 26 | g.remove(s) 27 | self.assertNotIn(s, g) 28 | 29 | @skip("draw api not ready") 30 | def test_kill_removes_from_groups(self): 31 | g0 = renderer.SpriteRenderer() 32 | g1 = renderer.SpriteRenderer() 33 | s = sprite.Sprite() 34 | g0.add(s) 35 | g1.add(s) 36 | s.kill() 37 | self.assertNotIn(s, g0) 38 | self.assertNotIn(s, g1) 39 | 40 | 41 | class GroupTests(unittest.TestCase): 42 | @skip("draw api not ready") 43 | def setUp(self): 44 | program = Mock() 45 | texture = Mock() 46 | self.g = renderer.SpriteRenderer(program, texture) 47 | 48 | @skip("draw api not ready") 49 | def test_sprites(self): 50 | self.assertEqual(len(self.g.sprites()), 0) 51 | 52 | # def test_copy(self): 53 | # self.fail() 54 | 55 | @skip("draw api not ready") 56 | def test_add(self): 57 | s = Mock() 58 | self.g.add(s) 59 | self.assertEqual(len(self.g.sprites()), 1) 60 | 61 | @skip("TODO: make a good exception for this error 'SpriteNotInGroup'?") 62 | def test_remove_raises(self): 63 | with self.assertRaises(KeyError): 64 | s = sprite.Sprite() 65 | self.g.remove(s) 66 | 67 | @skip("draw api not ready") 68 | def test_remove(self): 69 | s = sprite.Sprite() 70 | self.g.add(s) 71 | self.g.remove(s) 72 | self.assertEqual(len(self.g.sprites()), 0) 73 | 74 | @skip("draw api not ready") 75 | def test_has(self): 76 | s = sprite.Sprite() 77 | self.g.add(s) 78 | self.assertIn(s, self.g) 79 | 80 | @skip("draw api not ready") 81 | def test_update(self): 82 | s = Mock() 83 | self.g.add(s) 84 | 85 | @skip("draw api not ready") 86 | def test_draw(self): 87 | self.fail() 88 | 89 | @skip("draw api not ready") 90 | def test_clear(self): 91 | s0 = sprite.Sprite() 92 | self.g.add(s0) 93 | self.g.clear() 94 | self.assertEquals(len(self.g), 0) 95 | -------------------------------------------------------------------------------- /examples/logo-spin.py: -------------------------------------------------------------------------------- 1 | """ 2 | this is a testbed for the opengl operations of pygame2 3 | 4 | the general goal is to create new useful functions for pygame2 5 | this testbed is meant to code first, then refactor useful code 6 | into pygame2. 7 | """ 8 | from functools import partial 9 | import os 10 | import pygame2 11 | 12 | 13 | def load_texture(renderer, filename): 14 | path = os.path.join('resources', filename) 15 | return renderer.create_texture(pygame2.core.image.load(path)) 16 | 17 | 18 | def offset(sprites): 19 | for i, sprite in enumerate(sprites): 20 | yield sprite.animate(rotation=i * (360 / 8), transition='in_out_quad') 21 | 22 | 23 | def grow(sprites): 24 | for sprite in sprites: 25 | yield sprite.rect.animate(width=3, height=1.5, duration=3, 26 | transition='in_out_quint') 27 | 28 | 29 | def shrink(sprites): 30 | for sprite in sprites: 31 | yield sprite.rect.animate(width=1, height=1, duration=1.35) 32 | 33 | 34 | def reset_rotation(sprites): 35 | for sprite in sprites: 36 | ani = sprite.animate(rotation=720, duration=1.5) 37 | ani.subscribe('on_finish', partial(setattr, sprite, 'rotation', 0)) 38 | yield ani 39 | 40 | 41 | def main(): 42 | window_size = 800, 800 43 | animations = list() 44 | 45 | app = pygame2.app.App() 46 | window = app.create_window(size=window_size) 47 | renderer = window.create_renderer() 48 | 49 | def on_draw(*args, **kwargs): 50 | for sprite in renderer.sprites(): 51 | sprite.update_transform() 52 | window.clear() 53 | renderer.draw() 54 | 55 | window.subscribe('on_draw', on_draw) 56 | 57 | loader = partial(load_texture, renderer) 58 | texture0 = loader('pygame2-nologo.png') 59 | texture1 = loader('pygame2.png') 60 | 61 | for i in range(8): 62 | texture = texture0 if i % 2 == 0 else texture1 63 | sprite = renderer.create_sprite(texture=texture) 64 | sprite.rect = pygame2.Rect(-.5, -.5, 1, 1) 65 | 66 | def play_animation(func, dt): 67 | for ani in func(renderer.sprites()): 68 | ani.subscribe('on_finish', partial(animations.remove, ani)) 69 | animations.append(ani) 70 | 71 | def update(dt): 72 | for ani in animations: 73 | ani.update(dt) 74 | 75 | def boo_ya_ka_sha(*args): 76 | sched = app.clock.schedule 77 | sched(partial(play_animation, offset), 0) 78 | sched(partial(play_animation, grow), 1) 79 | sched(partial(play_animation, shrink), 5) 80 | sched(partial(play_animation, reset_rotation), 5) 81 | 82 | boo_ya_ka_sha() 83 | app.clock.schedule(boo_ya_ka_sha, 8, repeat=True) 84 | app.clock.schedule(update, 1 / 40., repeat=True) 85 | 86 | # this will start the application and will exit when window is closed 87 | app.run() 88 | 89 | 90 | if __name__ == '__main__': 91 | main() 92 | -------------------------------------------------------------------------------- /tests/test_window.py: -------------------------------------------------------------------------------- 1 | """ 2 | """ 3 | from unittest import TestCase, skip 4 | from mock import patch, call 5 | from logging import getLogger 6 | 7 | from pygame2 import window 8 | 9 | logger = getLogger() 10 | 11 | 12 | class DisplayTests(TestCase): 13 | def setUp(self): 14 | self.window = window.WindowBase() 15 | 16 | @skip("TODO: this test should target the pygame window provider only") 17 | @patch("pygame2.window.pyglet") 18 | def test_set_mode_initializes_display_singleton(self, mock_pyglet): 19 | """set_mode initializes the display singleton and pyglet main window""" 20 | res = (640, 480) 21 | surface = self.window.set_mode(res) 22 | self.assertIs(self.window.Window._instance, surface) 23 | self.assertEqual(self.window.Window._instance.get_resolution(), res) 24 | 25 | # make sure there can only be one instance of the display 26 | one = window.WindowBase(None) 27 | two = window.WindowBase(None) 28 | three = window.WindowBase(None) 29 | self.assertIs(one, two) 30 | self.assertIs(two, three) 31 | self.assertIs(one, three) 32 | self.assertTrue(mock_pyglet.window.Window.called) 33 | # self.assertIs(self.window.Window(None)._instance.window, 34 | # mock_pyglet.window.Window.return_value) 35 | 36 | def test_set_caption(self): 37 | """can set the pyglet window caption on the 38 | singleton window instance""" 39 | title = "Zort: The Explorer" 40 | self.window.caption = title 41 | 42 | def test_get_caption(self): 43 | """can get the caption from the pyglet window""" 44 | self.window.caption = "foobar" 45 | self.assertEqual(self.window.caption, "foobar") 46 | 47 | def test_toggle_fullscreen(self): 48 | self.assertFalse(self.window.fullscreen) 49 | self.window.fullscreen = True 50 | self.assertTrue(self.window.fullscreen) 51 | self.window.fullscreen = False 52 | self.assertFalse(self.window.fullscreen) 53 | # expected = [call(True), call(False)] 54 | # window = mock_pyglet.window.Window.return_value 55 | # actual = self.window.set_fullscreen.call_args_list 56 | # self.assertEqual(expected, actual) 57 | 58 | @skip('Should only test the host layer') 59 | def test_flip(self): 60 | self.assertIsNone(self.window.flip()) 61 | 62 | @skip("TODO: window.quit()? should we lose this method?") 63 | @patch("pygame2.window.pyglet") 64 | def test_quit(self, mock_pyglet): 65 | self.window.set_mode((0, 0)) 66 | self.assertIsNone(self.window.quit()) 67 | self.assertIsNone(self.window.Window._instance) 68 | 69 | @skip("TODO: should target pyglet") 70 | @patch("pygame2.window.pyglet") 71 | def test_get_surface(self, mock_pyglet): 72 | self.assertIsNone(self.window.get_surface()) 73 | screen = self.window.set_mode((0, 0)) 74 | self.assertIs(screen, self.window.get_surface()) 75 | -------------------------------------------------------------------------------- /tests/docs/coverage/pygame2_tests.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | Coverage for pygame2.tests: 100% 9 | 10 | 11 | 12 | 13 | 14 | 15 | 18 | 19 | 20 | 21 | 38 | 39 |
40 | 41 |

Hot-keys on this page

42 |
43 |

44 | r 45 | m 46 | x 47 | p   toggle line displays 48 |

49 |

50 | j 51 | k   next/prev highlighted chunk 52 |

53 |

54 | 0   (zero) top of page 55 |

56 |

57 | 1   (one) first highlighted chunk 58 |

59 |
60 |
61 | 62 |
63 | 64 | 65 | 68 | 71 | 72 |
66 | 67 | 69 | 70 |
73 |
74 | 75 | 82 | 83 | 84 | 85 | -------------------------------------------------------------------------------- /pygame2/docs/coverage/pygame2_tests.html: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | Coverage for pygame2.tests: 100% 10 | 11 | 12 | 13 | 14 | 15 | 16 | 19 | 20 | 21 | 22 | 40 | 41 |
42 | 43 | 44 |

Hot-keys on this page

45 | 46 |
47 |

48 | r 49 | m 50 | x 51 | p   toggle line displays 52 |

53 | 54 |

55 | j 56 | k   next/prev highlighted chunk 57 |

58 | 59 |

60 | 0   (zero) top of page 61 |

62 | 63 |

64 | 1   (one) first highlighted chunk 65 |

66 |
67 |
68 | 69 |
70 | 71 | 72 | 75 | 78 | 79 |
73 | 74 | 76 | 77 |
80 |
81 | 82 | 91 | 92 | 93 | 94 | -------------------------------------------------------------------------------- /pygame2/docs/coverage/pygame2_window.html: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | Coverage for pygame2.window: 100% 10 | 11 | 12 | 13 | 14 | 15 | 16 | 19 | 20 | 21 | 22 | 40 | 41 |
42 | 43 | 44 |

Hot-keys on this page

45 | 46 |
47 |

48 | r 49 | m 50 | x 51 | p   toggle line displays 52 |

53 | 54 |

55 | j 56 | k   next/prev highlighted chunk 57 |

58 | 59 |

60 | 0   (zero) top of page 61 |

62 | 63 |

64 | 1   (one) first highlighted chunk 65 |

66 |
67 |
68 | 69 |
70 | 71 | 72 | 76 | 83 | 84 |
73 |

1

74 | 75 |
77 |

import sdl2  80 |

81 | 82 |
85 |
86 | 87 | 96 | 97 | 98 | 99 | -------------------------------------------------------------------------------- /tests/docs/coverage/jquery.hotkeys.js: -------------------------------------------------------------------------------- 1 | /* 2 | * jQuery Hotkeys Plugin 3 | * Copyright 2010, John Resig 4 | * Dual licensed under the MIT or GPL Version 2 licenses. 5 | * 6 | * Based upon the plugin by Tzury Bar Yochay: 7 | * http://github.com/tzuryby/hotkeys 8 | * 9 | * Original idea by: 10 | * Binny V A, http://www.openjs.com/scripts/events/keyboard_shortcuts/ 11 | */ 12 | 13 | (function(jQuery){ 14 | 15 | jQuery.hotkeys = { 16 | version: "0.8", 17 | 18 | specialKeys: { 19 | 8: "backspace", 9: "tab", 13: "return", 16: "shift", 17: "ctrl", 18: "alt", 19: "pause", 20 | 20: "capslock", 27: "esc", 32: "space", 33: "pageup", 34: "pagedown", 35: "end", 36: "home", 21 | 37: "left", 38: "up", 39: "right", 40: "down", 45: "insert", 46: "del", 22 | 96: "0", 97: "1", 98: "2", 99: "3", 100: "4", 101: "5", 102: "6", 103: "7", 23 | 104: "8", 105: "9", 106: "*", 107: "+", 109: "-", 110: ".", 111 : "/", 24 | 112: "f1", 113: "f2", 114: "f3", 115: "f4", 116: "f5", 117: "f6", 118: "f7", 119: "f8", 25 | 120: "f9", 121: "f10", 122: "f11", 123: "f12", 144: "numlock", 145: "scroll", 191: "/", 224: "meta" 26 | }, 27 | 28 | shiftNums: { 29 | "`": "~", "1": "!", "2": "@", "3": "#", "4": "$", "5": "%", "6": "^", "7": "&", 30 | "8": "*", "9": "(", "0": ")", "-": "_", "=": "+", ";": ": ", "'": "\"", ",": "<", 31 | ".": ">", "/": "?", "\\": "|" 32 | } 33 | }; 34 | 35 | function keyHandler( handleObj ) { 36 | // Only care when a possible input has been specified 37 | if ( typeof handleObj.data !== "string" ) { 38 | return; 39 | } 40 | 41 | var origHandler = handleObj.handler, 42 | keys = handleObj.data.toLowerCase().split(" "); 43 | 44 | handleObj.handler = function( event ) { 45 | // Don't fire in text-accepting inputs that we didn't directly bind to 46 | if ( this !== event.target && (/textarea|select/i.test( event.target.nodeName ) || 47 | event.target.type === "text") ) { 48 | return; 49 | } 50 | 51 | // Keypress represents characters, not special keys 52 | var special = event.type !== "keypress" && jQuery.hotkeys.specialKeys[ event.which ], 53 | character = String.fromCharCode( event.which ).toLowerCase(), 54 | key, modif = "", possible = {}; 55 | 56 | // check combinations (alt|ctrl|shift+anything) 57 | if ( event.altKey && special !== "alt" ) { 58 | modif += "alt+"; 59 | } 60 | 61 | if ( event.ctrlKey && special !== "ctrl" ) { 62 | modif += "ctrl+"; 63 | } 64 | 65 | // TODO: Need to make sure this works consistently across platforms 66 | if ( event.metaKey && !event.ctrlKey && special !== "meta" ) { 67 | modif += "meta+"; 68 | } 69 | 70 | if ( event.shiftKey && special !== "shift" ) { 71 | modif += "shift+"; 72 | } 73 | 74 | if ( special ) { 75 | possible[ modif + special ] = true; 76 | 77 | } else { 78 | possible[ modif + character ] = true; 79 | possible[ modif + jQuery.hotkeys.shiftNums[ character ] ] = true; 80 | 81 | // "$" can be triggered as "Shift+4" or "Shift+$" or just "$" 82 | if ( modif === "shift+" ) { 83 | possible[ jQuery.hotkeys.shiftNums[ character ] ] = true; 84 | } 85 | } 86 | 87 | for ( var i = 0, l = keys.length; i < l; i++ ) { 88 | if ( possible[ keys[i] ] ) { 89 | return origHandler.apply( this, arguments ); 90 | } 91 | } 92 | }; 93 | } 94 | 95 | jQuery.each([ "keydown", "keyup", "keypress" ], function() { 96 | jQuery.event.special[ this ] = { add: keyHandler }; 97 | }); 98 | 99 | })( jQuery ); 100 | -------------------------------------------------------------------------------- /docs/build/html/_modules/index.html: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | Overview: module code — pygame2 0.0.1 documentation 10 | 11 | 12 | 13 | 14 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 41 | 42 |
43 |
44 |
45 |
46 | 47 |

All modules for which code is available

48 | 52 | 53 |
54 |
55 |
56 |
57 |
58 | 70 | 71 |
72 |
73 |
74 |
75 | 87 | 91 | 92 | -------------------------------------------------------------------------------- /pygame2/window.py: -------------------------------------------------------------------------------- 1 | """ 2 | Abstract Hierarchy of Window Concepts: 3 | 4 | 'display', basically this is the gpu 5 | 'screen', could be the is a logical screen on one monitor or more 6 | 'window', as is 7 | 'canvas', drawing context for graphics. 8 | """ 9 | import pygame2 10 | from pygame2.event import EventDispatcher 11 | from OpenGL.GL import * 12 | 13 | __all__ = ('WindowBase', ) 14 | 15 | 16 | class WindowBase(EventDispatcher): 17 | """Platform independent window 18 | """ 19 | _resolution = None 20 | _fullscreen = False 21 | _caption = None 22 | _resizable = False 23 | _borderless = False 24 | _minimized = False 25 | _maximized = False 26 | _visible = True 27 | _vsync = True 28 | _screen = None 29 | 30 | # stored to remember size when toggling fullscreen 31 | _window_rect = None 32 | 33 | # if true, then the window will be be redrawn at next opportunity. 34 | # to limit drawing, you can set to false to prevent draws until it 35 | # is needed, then set to true 36 | requires_draw = True 37 | 38 | _default_size = 640, 480 39 | 40 | def __init__(self, **kwargs): 41 | super().__init__() 42 | self.program_id = None 43 | 44 | # scan keyword arguments and set values in our instance 45 | # to match, but only if they are defined by WindowBase 46 | for name, value in kwargs.items(): 47 | if hasattr(self, name): 48 | setattr(self, name, value) 49 | 50 | if self._resolution is None: 51 | self._resolution = WindowBase._default_size 52 | 53 | # TODO: keep a list of active windows somewhere 54 | 55 | # self.switch_to() 56 | # if self._visible: 57 | # self.activate 58 | 59 | def get_resolution(self): 60 | return self._resolution 61 | 62 | def get_size(self): 63 | return self._resolution 64 | 65 | @property 66 | def fullscreen(self): 67 | return self._fullscreen 68 | 69 | @fullscreen.setter 70 | def fullscreen(self, value): 71 | if not value == self._fullscreen: 72 | self._fullscreen = value 73 | 74 | @property 75 | def height(self): 76 | return self._resolution[1] 77 | 78 | @property 79 | def width(self): 80 | return self._resolution[0] 81 | 82 | @property 83 | def caption(self): 84 | return self._caption 85 | 86 | @caption.setter 87 | def caption(self, value): 88 | if not value == self._caption: 89 | self._caption = value 90 | 91 | def activate(self): 92 | """Force window to get/steal focus. 93 | 94 | Actual behavior depends on OS 95 | """ 96 | raise NotImplementedError 97 | 98 | def get_rect(self): 99 | return pygame2.Rect((0, 0), self._resolution) 100 | 101 | def create_renderer(self): 102 | """ Return a new renderer (sprite group) that draws to this window 103 | """ 104 | # TODO check this when multiple window support is added 105 | if self.program_id is None: 106 | self.program_id = pygame2.graphics.create_program() 107 | renderer = pygame2.renderer.SpriteRenderer(self.program_id) 108 | return renderer 109 | 110 | def flip(self): 111 | """flip, etc""" 112 | raise NotImplementedError 113 | 114 | def switch_to(self): 115 | """Make window current OpenGL rendering context 116 | """ 117 | raise NotImplementedError 118 | 119 | def clear(self): 120 | glClearColor(.98, .98, .98, 1.) 121 | glClear(GL_COLOR_BUFFER_BIT) 122 | -------------------------------------------------------------------------------- /examples/demos/platformer/platformer.py: -------------------------------------------------------------------------------- 1 | """ 2 | this is a testbed for the opengl operations of pygame2 3 | 4 | the general goal is to create new useful functions for pygame2 5 | this testbed is meant to code first, then refactor useful code 6 | into pygame2. 7 | """ 8 | from functools import partial 9 | import os 10 | import pygame2 11 | 12 | 13 | def load_texture(renderer, *args): 14 | path = os.path.join('..', '..', 'resources', *args) 15 | return renderer.create_texture(pygame2.core.image.load(path)) 16 | 17 | 18 | def main(): 19 | window_size = 800, 800 20 | desired_fps = 1 / 60. 21 | animations = list() 22 | 23 | app = pygame2.app.App() 24 | window = app.create_window(size=window_size) 25 | 26 | axis_animations = dict() 27 | 28 | def on_key_press(*args, **kwargs): 29 | print(args, kwargs) 30 | key, junk = kwargs['args'] 31 | # possibly only for windows 32 | 33 | # up 34 | ani = None 35 | axis = None 36 | duration = .6 37 | if key == 65362: 38 | ani = player_sprite.rect.animate(y=player_sprite.rect.y + .1, 39 | duration=duration) 40 | axis = 'y' 41 | # right 42 | elif key == 65363: 43 | ani = player_sprite.rect.animate(x=player_sprite.rect.x + .1, 44 | duration=duration) 45 | axis = 'x' 46 | # down 47 | elif key == 65364: 48 | ani = player_sprite.rect.animate(y=player_sprite.rect.y - .1, 49 | duration=duration) 50 | axis = 'y' 51 | # left 52 | elif key == 65361: 53 | ani = player_sprite.rect.animate(x=player_sprite.rect.x - .1, 54 | duration=duration) 55 | axis = 'x' 56 | 57 | # space 58 | elif key == 32: 59 | ani = player_sprite.animate(rotation=-360, duration=.55, 60 | transition='out_quint') 61 | ani.subscribe('on_finish', partial(setattr, player_sprite, 'rotation', 0)) 62 | axis = 'z' 63 | 64 | if ani: 65 | old = axis_animations.get(axis, None) 66 | if old is not None: 67 | try: 68 | old.abort() 69 | except RuntimeError: # if already aborted 70 | pass 71 | axis_animations[axis] = ani 72 | ani.subscribe('on_finish', partial(animations.remove, ani)) 73 | animations.append(ani) 74 | 75 | def update(dt): 76 | for ani in animations: 77 | ani.update(dt) 78 | 79 | def on_draw(*args, **kwargs): 80 | for sprite in renderer.sprites(): 81 | sprite.update_transform() 82 | window.clear() 83 | renderer.draw() 84 | 85 | window.subscribe('on_draw', on_draw) 86 | window.subscribe('on_key_press', on_key_press) 87 | 88 | renderer = window.create_renderer() 89 | loader = partial(load_texture, renderer) 90 | 91 | texture = loader('backgrounds', 'colored_grass.png') 92 | background_sprite = renderer.create_sprite(texture=texture) 93 | background_sprite.rect = pygame2.Rect(-1, -1, 2, 2) 94 | 95 | texture = loader('players', 'Green', 'alienGreen_walk1.png') 96 | player_sprite = renderer.create_sprite(texture=texture) 97 | player_sprite.rect = pygame2.Rect(0, 0, .25, .5) 98 | 99 | app.clock.schedule(update, desired_fps, repeat=True) 100 | 101 | # this will start the application and will exit when window is closed 102 | app.run() 103 | 104 | 105 | if __name__ == '__main__': 106 | main() 107 | -------------------------------------------------------------------------------- /pygame2/devtools/cli.py: -------------------------------------------------------------------------------- 1 | 2 | from os import makedirs, utime 3 | from os.path import join, exists 4 | 5 | 6 | def touch(fname): 7 | if exists(fname): 8 | utime(fname, None) 9 | else: 10 | print("Creating %s" % fname) 11 | open(fname, 'a').close() 12 | 13 | 14 | def create_command_line_interface(arg_parser): 15 | cli = CommandLineInterface(arg_parser) 16 | cli.add_command(InitCommand()) 17 | return cli 18 | 19 | 20 | class CommandLineInterface(object): 21 | 22 | def __init__(self, arg_parser): 23 | self.arg_parser = arg_parser 24 | self.commands = list() 25 | 26 | def add_command(self, command): 27 | self.commands.append(command) 28 | command.add_command(self.arg_parser) 29 | 30 | def execute(self): 31 | args = self.arg_parser.parse_args() 32 | for command in self.commands: 33 | if command.should_execute(args): 34 | command.execute(args) 35 | break 36 | 37 | 38 | class Command(object): 39 | 40 | def add_command(self, arg_parser): # pragma: no cover 41 | pass 42 | 43 | def execute(self, args): # pragma: no cover 44 | pass 45 | 46 | def should_execute(self, args): # pragma: no cover 47 | pass 48 | 49 | 50 | class InitCommand(Command): 51 | 52 | INIT_HELP_TEXT = "Create a new pygame2 game skeleton project." 53 | PROJECT_NAME_HELP_TEXT = "The name of your new project. It should use Pascal case. ex. RemoteLawnmowerUltra." 54 | 55 | DIRS = [("{{PROJECT_NAME}}", "{{project_name}}"), 56 | ("{{PROJECT_NAME}}", "tests"), 57 | ("{{PROJECT_NAME}}", "assets", "images"), 58 | ("{{PROJECT_NAME}}", "assets", "sounds"), 59 | ("{{PROJECT_NAME}}", "assets", "music"), 60 | ("{{PROJECT_NAME}}", "assets", "data"), 61 | ("{{PROJECT_NAME}}", "assets", "misc")] 62 | 63 | FILES = [("{{PROJECT_NAME}}", "README.md"), 64 | ("{{PROJECT_NAME}}", "LICENSE"), 65 | ("{{PROJECT_NAME}}", "ATTRIBUTIONS"), 66 | ("{{PROJECT_NAME}}", "requirements.txt"), 67 | ("{{PROJECT_NAME}}", "setup.py"), 68 | ("{{PROJECT_NAME}}", "setup.cfg"), 69 | ("{{PROJECT_NAME}}", "tests", "test_{{project_name}}.py"), 70 | ("{{PROJECT_NAME}}", "{{project_name}}", "__init__.py"), 71 | ("{{PROJECT_NAME}}", "{{project_name}}", "__main__.py"), 72 | ("{{PROJECT_NAME}}", "{{project_name}}", "cli.py") ] 73 | 74 | def add_command(self, arg_parser): 75 | subparsers = arg_parser.add_subparsers(help="init", dest="init") 76 | subparser = subparsers.add_parser("init", help=self.INIT_HELP_TEXT) 77 | subparser.add_argument("project_name", help=self.PROJECT_NAME_HELP_TEXT) 78 | 79 | def should_execute(self, args): 80 | return args.init 81 | 82 | def execute(self, args): 83 | print("Generating pygame project %s" % args.project_name) 84 | self.create_directories(args) 85 | self.create_files(args) 86 | 87 | def create_directories(self, args): 88 | for d in self.DIRS: 89 | templated = self.replace_tokens(d, args) 90 | path = join(*templated) 91 | print("Creating %s" % path) 92 | makedirs(path) 93 | 94 | def create_files(self, args): 95 | for f in self.FILES: 96 | templated = self.replace_tokens(f, args) 97 | touch(join(*templated)) 98 | 99 | def replace_tokens(self, segments, args): 100 | output = list() 101 | for s in segments: 102 | s = s.replace("{{PROJECT_NAME}}", args.project_name) 103 | s = s.replace("{{project_name}}", args.project_name.lower()) 104 | output.append(s) 105 | return tuple(output) 106 | -------------------------------------------------------------------------------- /docs/build/html/search.html: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | Search — pygame2 0.0.1 documentation 10 | 11 | 12 | 13 | 14 | 23 | 24 | 25 | 26 | 27 | 28 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 49 | 50 |
51 |
52 |
53 |
54 | 55 |

Search

56 |
57 | 58 |

59 | Please activate JavaScript to enable the search 60 | functionality. 61 |

62 |
63 |

64 | From here you can search these documents. Enter your search 65 | words into the box below and click "search". Note that the search 66 | function will automatically search for all of the words. Pages 67 | containing fewer words won't appear in the result list. 68 |

69 |
70 | 71 | 72 | 73 |
74 | 75 |
76 | 77 |
78 | 79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 | 100 | 104 | 105 | -------------------------------------------------------------------------------- /pygame2/core/platform/platform_pyglet.py: -------------------------------------------------------------------------------- 1 | """ 2 | Pyglet based platform 3 | 4 | Pyglet is a cross-platform multimedia library built with python 5 | and ctypes. It is a good target for Windows, Mac, and Linux, 6 | but may be slower on pypy. 7 | 8 | pyglet is almost a pure event oriented framework, so the way pygame2 9 | handles it will seem awkward: 10 | - set event handlers for each input 11 | - catch events and queue them 12 | 13 | if we are to remove this queue/dequeue steps, then we'll have to 14 | fork pyglet and use pyglet's excellent ctypes-based OS interfaces and 15 | then handle the queue directly. 16 | """ 17 | from functools import partial 18 | 19 | import pyglet 20 | import pyglet.app 21 | 22 | from pygame2.event import PlatformEventQueueBase 23 | from pygame2.window import WindowBase 24 | 25 | 26 | __all__ = ('PlatformEventQueue', 'Window') 27 | 28 | 29 | def patch_pyglet_events(dispatcher, pyglet_dispatcher): 30 | """Collect all events from the window class, bind them, then 31 | set up a dispatcher for them. 32 | """ 33 | # TDOD: figure some way to reconcile pygame2's no argument dispatch 34 | # and pyglets multiple argument/kwarg dispatch 35 | def dispatch(name, *args, **kwargs): 36 | kwargs['args'] = args 37 | dispatcher.broadcast(name, **kwargs) 38 | 39 | for event_name in pyglet_dispatcher.event_types: 40 | if not hasattr(dispatcher, event_name): 41 | try: 42 | dispatcher.register(event_name) 43 | except dispatcher.DuplicateEventName: 44 | continue 45 | func = partial(dispatch, event_name) 46 | setattr(pyglet_dispatcher, event_name, func) 47 | 48 | 49 | class PlatformEventQueue(PlatformEventQueueBase): 50 | """ Pyglet based event queue 51 | """ 52 | 53 | def start(self): 54 | self.platform_event_loop = pyglet.app.platform_event_loop 55 | self.platform_event_loop.start() 56 | 57 | def get(self, event_filter=None): 58 | timeout = .01 59 | self.platform_event_loop.notify() 60 | self.platform_event_loop.step(timeout) 61 | # sleep isn't implemented on os x, yet 62 | # self.platform_event_loop.sleep(30) 63 | 64 | def post(self, event): 65 | pass 66 | 67 | def stop(self): 68 | pass 69 | 70 | def poll(self): 71 | pass 72 | 73 | def clear(self, event_filter=None): 74 | pass 75 | 76 | def peek(self, types=None): 77 | pass 78 | 79 | 80 | class Window(WindowBase): 81 | def activate(self): 82 | pass 83 | 84 | def __init__(self, **kwargs): 85 | super().__init__(**kwargs) 86 | 87 | width, height = kwargs.get('size', (0, 0)) 88 | 89 | kw = { 90 | 'width': width, 91 | 'height': height, 92 | 'caption': self._caption, 93 | 'resizable': self._resizable, 94 | 'fullscreen': self._fullscreen, 95 | 'visible': self._visible, 96 | 'vsync': self._vsync, 97 | } 98 | 99 | self._window = pyglet.window.Window(**kw) 100 | 101 | # connect pyglet dispatcher to pygame2 dispatcher 102 | # an unpleasant side effect is that arguments passed 103 | # to pyglet events are lost. this will change. 104 | patch_pyglet_events(self, self._window) 105 | 106 | # temp setup 107 | self._window.switch_to() 108 | self._window.dispatch_pending_events() 109 | self._window.dispatch_events() 110 | 111 | def flip(self): 112 | self._window.flip() 113 | 114 | def switch_to(self): 115 | self._window.switch_to() 116 | 117 | def dispatch_pending_events(self): 118 | """ Pyglet provides an event queue for each window 119 | 120 | TODO: remove this once event queue is finalized 121 | 122 | :return: None 123 | """ 124 | self._window.dispatch_pending_events() 125 | -------------------------------------------------------------------------------- /notes.md: -------------------------------------------------------------------------------- 1 | random musings 2 | ============== 3 | 4 | the purpose of this file is just to jot down thoughts related to the goals and 5 | scope of the pygame2 project. none of this is to be taken as a hard truth or 6 | strong commitment, rather just a place to brainstorm ideas. 7 | 8 | 9 | developer experience 10 | ==================== 11 | 12 | pygame2 should preserve the raw thrills of pygame, while offering a clear path 13 | to actually do something useful with it. what i mean, specifically, is 14 | preserving the ability to 'build a game engine', or make your first jrpg. 15 | 16 | it should be usable as a prototyping kit, like a box of legos, but it also 17 | needs strong tools to make a game/app that will work like modern apps do. 18 | 19 | pygame vetrans will think fondly of the wall that everyone hits once they 20 | realize that pygame apps do not scale. pygame2 should scale. 100's of 21 | on-screen sprites should work. we don't want to bother with calling convert 22 | on images we load... 23 | 24 | pygame2 should let you cut your teeth on some low level details, but when you 25 | want the low level stuff to be taken care of, pygame2 should ship with 26 | sensible tools like event dispatchers, resource loaders, and input abstractions. 27 | 28 | the general idea that pygame2 should be useful to use, and useful 29 | to teach with demands a lot of reusable abstractions. 30 | 31 | here is a sample pygame2 newbie: 32 | * wants to 'see' events from the queue and directly manage them 33 | * wants to directly control when and where things are on the screen 34 | * wants to directly call functions on sprites/sprite-objects 35 | * probably wants to use a vanilla list or set to mange sprites 36 | * doesn't want 'game engine magic' 37 | * wants to handle things with 'for loops' 38 | 39 | here is a sample pygame2 veteran: 40 | * lets pygame2.app.App do all of the boring work 41 | * uses decorator and event framework 42 | * organizes things into batches/groups 43 | * lets 'game engine magic' do heavy lifting 44 | * uses callbacks, scheduler, and generators 45 | 46 | As an aside, the pygame2 veteran will also want to do some things 47 | a newbie would want, such as directly controlling the event queue, 48 | so by catering to both groups, the library is more usable. 49 | 50 | 51 | modern features 52 | =============== 53 | 54 | pygame2 should be able to use 2d physics engines and open source editors. 55 | it will ship with pyopengl as a first class citizen, along with useful places 56 | to extend pygame2 with custom shaders and opengl code. 57 | 58 | 59 | texture atlases 60 | =============== 61 | 62 | pyglet features a handy utility that will combine individual textures into an 63 | atlas, then use the result for sprite batched rendering. the benefits are 64 | quick, rapid prototyping of textures, but increased load times and lack of 65 | fine control of the resulting atlases. For example, you may have your scenery 66 | rendered at once, but the textures may be distributed in different atlases. 67 | 68 | a better solution would be have control of what textures are combined together. 69 | in this example, the ideal result would be rendering all the scenery while using 70 | just one texture. 71 | 72 | so, a proposal, is to have our sprites be aware of texture atlases and have one 73 | single, commonly understood format to load an atlas. this may be XML, it may be 74 | JSON, or even plain text. we will choose some format to support, and allow the 75 | developer to use his own tools to create the atlas. 76 | 77 | automatic atlasing will not be a planned feature, but perhaps in the future, 78 | we can investigate it. one idea to support automatic atlasing would be to 79 | generate a cached version of the atlas and save it to disk. the pygame2 80 | framework will search for chaced atlases on startup, and do some checksums to 81 | verify that the cache isn't stale, and will load the cache instead of the real 82 | files. the resulting cache can be distributed with the published game in place 83 | of the original assets. in the event that the cache is out of date, it can be 84 | removed by the user, and it will be generated again once the game starts. 85 | -------------------------------------------------------------------------------- /docs/build/html/_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 .cm { color: #408090; font-style: italic } /* Comment.Multiline */ 8 | .highlight .cp { color: #007020 } /* Comment.Preproc */ 9 | .highlight .c1 { color: #408090; font-style: italic } /* Comment.Single */ 10 | .highlight .cs { color: #408090; background-color: #fff0f0 } /* Comment.Special */ 11 | .highlight .gd { color: #A00000 } /* Generic.Deleted */ 12 | .highlight .ge { font-style: italic } /* Generic.Emph */ 13 | .highlight .gr { color: #FF0000 } /* Generic.Error */ 14 | .highlight .gh { color: #000080; font-weight: bold } /* Generic.Heading */ 15 | .highlight .gi { color: #00A000 } /* Generic.Inserted */ 16 | .highlight .go { color: #333333 } /* Generic.Output */ 17 | .highlight .gp { color: #c65d09; font-weight: bold } /* Generic.Prompt */ 18 | .highlight .gs { font-weight: bold } /* Generic.Strong */ 19 | .highlight .gu { color: #800080; font-weight: bold } /* Generic.Subheading */ 20 | .highlight .gt { color: #0044DD } /* Generic.Traceback */ 21 | .highlight .kc { color: #007020; font-weight: bold } /* Keyword.Constant */ 22 | .highlight .kd { color: #007020; font-weight: bold } /* Keyword.Declaration */ 23 | .highlight .kn { color: #007020; font-weight: bold } /* Keyword.Namespace */ 24 | .highlight .kp { color: #007020 } /* Keyword.Pseudo */ 25 | .highlight .kr { color: #007020; font-weight: bold } /* Keyword.Reserved */ 26 | .highlight .kt { color: #902000 } /* Keyword.Type */ 27 | .highlight .m { color: #208050 } /* Literal.Number */ 28 | .highlight .s { color: #4070a0 } /* Literal.String */ 29 | .highlight .na { color: #4070a0 } /* Name.Attribute */ 30 | .highlight .nb { color: #007020 } /* Name.Builtin */ 31 | .highlight .nc { color: #0e84b5; font-weight: bold } /* Name.Class */ 32 | .highlight .no { color: #60add5 } /* Name.Constant */ 33 | .highlight .nd { color: #555555; font-weight: bold } /* Name.Decorator */ 34 | .highlight .ni { color: #d55537; font-weight: bold } /* Name.Entity */ 35 | .highlight .ne { color: #007020 } /* Name.Exception */ 36 | .highlight .nf { color: #06287e } /* Name.Function */ 37 | .highlight .nl { color: #002070; font-weight: bold } /* Name.Label */ 38 | .highlight .nn { color: #0e84b5; font-weight: bold } /* Name.Namespace */ 39 | .highlight .nt { color: #062873; font-weight: bold } /* Name.Tag */ 40 | .highlight .nv { color: #bb60d5 } /* Name.Variable */ 41 | .highlight .ow { color: #007020; font-weight: bold } /* Operator.Word */ 42 | .highlight .w { color: #bbbbbb } /* Text.Whitespace */ 43 | .highlight .mf { color: #208050 } /* Literal.Number.Float */ 44 | .highlight .mh { color: #208050 } /* Literal.Number.Hex */ 45 | .highlight .mi { color: #208050 } /* Literal.Number.Integer */ 46 | .highlight .mo { color: #208050 } /* Literal.Number.Oct */ 47 | .highlight .sb { color: #4070a0 } /* Literal.String.Backtick */ 48 | .highlight .sc { color: #4070a0 } /* Literal.String.Char */ 49 | .highlight .sd { color: #4070a0; font-style: italic } /* Literal.String.Doc */ 50 | .highlight .s2 { color: #4070a0 } /* Literal.String.Double */ 51 | .highlight .se { color: #4070a0; font-weight: bold } /* Literal.String.Escape */ 52 | .highlight .sh { color: #4070a0 } /* Literal.String.Heredoc */ 53 | .highlight .si { color: #70a0d0; font-style: italic } /* Literal.String.Interpol */ 54 | .highlight .sx { color: #c65d09 } /* Literal.String.Other */ 55 | .highlight .sr { color: #235388 } /* Literal.String.Regex */ 56 | .highlight .s1 { color: #4070a0 } /* Literal.String.Single */ 57 | .highlight .ss { color: #517918 } /* Literal.String.Symbol */ 58 | .highlight .bp { color: #007020 } /* Name.Builtin.Pseudo */ 59 | .highlight .vc { color: #bb60d5 } /* Name.Variable.Class */ 60 | .highlight .vg { color: #bb60d5 } /* Name.Variable.Global */ 61 | .highlight .vi { color: #bb60d5 } /* Name.Variable.Instance */ 62 | .highlight .il { color: #208050 } /* Literal.Number.Integer.Long */ --------------------------------------------------------------------------------