Created
October 3, 2014 15:06
-
-
Save peterneorr/812354db30156b4abf6c to your computer and use it in GitHub Desktop.
Tron game to Demonstrate Pygame for Delta High programming club
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PyGameDemo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<project version="4"> | |
<component name="Encoding" useUTFGuessing="true" native2AsciiForPropertiesFiles="false" /> | |
</project> | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<project version="4"> | |
<component name="ProjectRootManager" version="2" project-jdk-name="Python 2.7.3 (C:/Python27/python.exe)" project-jdk-type="Python SDK" /> | |
</project> | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<project version="4"> | |
<component name="ProjectModuleManager"> | |
<modules> | |
<module fileurl="file://$PROJECT_DIR$/.idea/PyGameDemo.iml" filepath="$PROJECT_DIR$/.idea/PyGameDemo.iml" /> | |
</modules> | |
</component> | |
</project> | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<component name="DependencyValidationManager"> | |
<state> | |
<option name="SKIP_IMPORT_STATEMENTS" value="false" /> | |
</state> | |
</component> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<module type="PYTHON_MODULE" version="4"> | |
<component name="NewModuleRootManager"> | |
<content url="file://$MODULE_DIR$" /> | |
<orderEntry type="inheritedJdk" /> | |
<orderEntry type="sourceFolder" forTests="false" /> | |
</component> | |
</module> | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<project version="4"> | |
<component name="VcsDirectoryMappings"> | |
<mapping directory="" vcs="" /> | |
</component> | |
</project> | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<project version="4"> | |
<component name="ChangeListManager"> | |
<list default="true" id="61a54731-abcb-423d-9fde-8a2bb6620511" name="Default" comment="" /> | |
<ignored path="PyGameDemo.iws" /> | |
<ignored path=".idea/workspace.xml" /> | |
<option name="TRACKING_ENABLED" value="true" /> | |
<option name="SHOW_DIALOG" value="false" /> | |
<option name="HIGHLIGHT_CONFLICTS" value="true" /> | |
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" /> | |
<option name="LAST_RESOLUTION" value="IGNORE" /> | |
</component> | |
<component name="ChangesViewManager" flattened_view="true" show_ignored="false" /> | |
<component name="CreatePatchCommitExecutor"> | |
<option name="PATCH_PATH" value="" /> | |
</component> | |
<component name="DaemonCodeAnalyzer"> | |
<disable_hints /> | |
</component> | |
<component name="ExecutionTargetManager" SELECTED_TARGET="default_target" /> | |
<component name="FavoritesManager"> | |
<favorites_list name="PyGameDemo" /> | |
</component> | |
<component name="FileEditorManager"> | |
<leaf> | |
<file leaf-file-name="tron.py" pinned="false" current="true" current-in-tab="true"> | |
<entry file="file://$PROJECT_DIR$/tron.py"> | |
<provider selected="true" editor-type-id="text-editor"> | |
<state vertical-scroll-proportion="0.91629463" vertical-offset="3454" max-vertical-offset="4450"> | |
<caret line="171" column="6" selection-start-line="171" selection-start-column="6" selection-end-line="171" selection-end-column="6" /> | |
<folding> | |
<element signature="e#0#10#0" expanded="true" /> | |
</folding> | |
</state> | |
</provider> | |
</entry> | |
</file> | |
<file leaf-file-name="player.py" pinned="false" current="false" current-in-tab="false"> | |
<entry file="file://$PROJECT_DIR$/player.py"> | |
<provider selected="true" editor-type-id="text-editor"> | |
<state vertical-scroll-proportion="0.0" vertical-offset="200" max-vertical-offset="900"> | |
<caret line="8" column="13" selection-start-line="8" selection-start-column="13" selection-end-line="8" selection-end-column="13" /> | |
<folding /> | |
</state> | |
</provider> | |
</entry> | |
</file> | |
<file leaf-file-name="__init__.py" pinned="false" current="false" current-in-tab="false"> | |
<entry file="file://$PROJECT_DIR$/__init__.py"> | |
<provider selected="true" editor-type-id="text-editor"> | |
<state vertical-scroll-proportion="0.0" vertical-offset="0" max-vertical-offset="150"> | |
<caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" /> | |
<folding /> | |
</state> | |
</provider> | |
</entry> | |
</file> | |
</leaf> | |
</component> | |
<component name="FindManager"> | |
<FindUsagesManager> | |
<setting name="OPEN_NEW_TAB" value="false" /> | |
</FindUsagesManager> | |
</component> | |
<component name="IdeDocumentHistory"> | |
<option name="changedFiles"> | |
<list> | |
<option value="$PROJECT_DIR$/chimp.py" /> | |
<option value="$PROJECT_DIR$/demo.py" /> | |
<option value="$PROJECT_DIR$/demo2.py" /> | |
<option value="$PROJECT_DIR$/demo1.py" /> | |
<option value="$PROJECT_DIR$/player.py" /> | |
<option value="$PROJECT_DIR$/tron.py" /> | |
</list> | |
</option> | |
</component> | |
<component name="ProjectFrameBounds"> | |
<option name="x" value="-9" /> | |
<option name="y" value="-9" /> | |
<option name="width" value="1938" /> | |
<option name="height" value="1050" /> | |
</component> | |
<component name="ProjectLevelVcsManager" settingsEditedManually="false"> | |
<OptionsSetting value="true" id="Add" /> | |
<OptionsSetting value="true" id="Remove" /> | |
<OptionsSetting value="true" id="Checkout" /> | |
<OptionsSetting value="true" id="Update" /> | |
<OptionsSetting value="true" id="Status" /> | |
<OptionsSetting value="true" id="Edit" /> | |
<ConfirmationsSetting value="0" id="Add" /> | |
<ConfirmationsSetting value="0" id="Remove" /> | |
</component> | |
<component name="ProjectReloadState"> | |
<option name="STATE" value="0" /> | |
</component> | |
<component name="ProjectView"> | |
<navigator currentView="ProjectPane" proportions="" version="1"> | |
<flattenPackages /> | |
<showMembers /> | |
<showModules /> | |
<showLibraryContents /> | |
<hideEmptyPackages /> | |
<abbreviatePackageNames /> | |
<autoscrollToSource /> | |
<autoscrollFromSource /> | |
<sortByType /> | |
</navigator> | |
<panes> | |
<pane id="ProjectPane"> | |
<subPane> | |
<PATH> | |
<PATH_ELEMENT> | |
<option name="myItemId" value="PyGameDemo" /> | |
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" /> | |
</PATH_ELEMENT> | |
</PATH> | |
<PATH> | |
<PATH_ELEMENT> | |
<option name="myItemId" value="PyGameDemo" /> | |
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" /> | |
</PATH_ELEMENT> | |
<PATH_ELEMENT> | |
<option name="myItemId" value="PyGameDemo" /> | |
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" /> | |
</PATH_ELEMENT> | |
</PATH> | |
</subPane> | |
</pane> | |
<pane id="Scope" /> | |
</panes> | |
</component> | |
<component name="PropertiesComponent"> | |
<property name="recentsLimit" value="5" /> | |
<property name="options.lastSelected" value="editor.preferences.appearance" /> | |
<property name="options.splitter.main.proportions" value="0.3" /> | |
<property name="options.splitter.details.proportions" value="0.2" /> | |
<property name="options.searchVisible" value="true" /> | |
<property name="FullScreen" value="false" /> | |
<property name="LayoutCode.rearrangeEntriesPython" value="false" /> | |
</component> | |
<component name="PyConsoleOptionsProvider"> | |
<option name="myPythonConsoleState"> | |
<console-settings /> | |
</option> | |
</component> | |
<component name="RecentsManager"> | |
<key name="CopyFile.RECENT_KEYS"> | |
<recent name="C:\Users\neor246\PycharmProjects\PyGameDemo" /> | |
</key> | |
</component> | |
<component name="RunManager" selected="Python.tron"> | |
<configuration default="false" name="chimp" type="PythonConfigurationType" factoryName="Python" temporary="true"> | |
<option name="INTERPRETER_OPTIONS" value="" /> | |
<option name="PARENT_ENVS" value="true" /> | |
<envs> | |
<env name="PYTHONUNBUFFERED" value="1" /> | |
</envs> | |
<option name="SDK_HOME" value="" /> | |
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" /> | |
<option name="IS_MODULE_SDK" value="true" /> | |
<option name="ADD_CONTENT_ROOTS" value="true" /> | |
<option name="ADD_SOURCE_ROOTS" value="true" /> | |
<module name="PyGameDemo" /> | |
<option name="SCRIPT_NAME" value="C:\Users\neor246\PycharmProjects\PyGameDemo\demo.py" /> | |
<option name="PARAMETERS" value="" /> | |
<RunnerSettings RunnerId="PythonRunner" /> | |
<ConfigurationWrapper RunnerId="PythonRunner" /> | |
<method /> | |
</configuration> | |
<configuration default="false" name="demo" type="PythonConfigurationType" factoryName="Python" temporary="true"> | |
<option name="INTERPRETER_OPTIONS" value="" /> | |
<option name="PARENT_ENVS" value="true" /> | |
<envs> | |
<env name="PYTHONUNBUFFERED" value="1" /> | |
</envs> | |
<option name="SDK_HOME" value="" /> | |
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" /> | |
<option name="IS_MODULE_SDK" value="true" /> | |
<option name="ADD_CONTENT_ROOTS" value="true" /> | |
<option name="ADD_SOURCE_ROOTS" value="true" /> | |
<module name="PyGameDemo" /> | |
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/demo.py" /> | |
<option name="PARAMETERS" value="" /> | |
<RunnerSettings RunnerId="PythonRunner" /> | |
<ConfigurationWrapper RunnerId="PythonRunner" /> | |
<method /> | |
</configuration> | |
<configuration default="false" name="demo1" type="PythonConfigurationType" factoryName="Python" temporary="true"> | |
<option name="INTERPRETER_OPTIONS" value="" /> | |
<option name="PARENT_ENVS" value="true" /> | |
<envs> | |
<env name="PYTHONUNBUFFERED" value="1" /> | |
</envs> | |
<option name="SDK_HOME" value="" /> | |
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" /> | |
<option name="IS_MODULE_SDK" value="true" /> | |
<option name="ADD_CONTENT_ROOTS" value="true" /> | |
<option name="ADD_SOURCE_ROOTS" value="true" /> | |
<module name="PyGameDemo" /> | |
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/demo1.py" /> | |
<option name="PARAMETERS" value="" /> | |
<RunnerSettings RunnerId="PythonRunner" /> | |
<ConfigurationWrapper RunnerId="PythonRunner" /> | |
<method /> | |
</configuration> | |
<configuration default="false" name="demo2" type="PythonConfigurationType" factoryName="Python" temporary="true"> | |
<option name="INTERPRETER_OPTIONS" value="" /> | |
<option name="PARENT_ENVS" value="true" /> | |
<envs> | |
<env name="PYTHONUNBUFFERED" value="1" /> | |
</envs> | |
<option name="SDK_HOME" value="" /> | |
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" /> | |
<option name="IS_MODULE_SDK" value="true" /> | |
<option name="ADD_CONTENT_ROOTS" value="true" /> | |
<option name="ADD_SOURCE_ROOTS" value="true" /> | |
<module name="PyGameDemo" /> | |
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/demo2.py" /> | |
<option name="PARAMETERS" value="" /> | |
<RunnerSettings RunnerId="PythonRunner" /> | |
<ConfigurationWrapper RunnerId="PythonRunner" /> | |
<method /> | |
</configuration> | |
<configuration default="true" type="tests" factoryName="py.test"> | |
<option name="INTERPRETER_OPTIONS" value="" /> | |
<option name="PARENT_ENVS" value="true" /> | |
<envs /> | |
<option name="SDK_HOME" value="" /> | |
<option name="WORKING_DIRECTORY" value="" /> | |
<option name="IS_MODULE_SDK" value="false" /> | |
<option name="ADD_CONTENT_ROOTS" value="true" /> | |
<option name="ADD_SOURCE_ROOTS" value="true" /> | |
<module name="PyGameDemo" /> | |
<option name="SCRIPT_NAME" value="" /> | |
<option name="CLASS_NAME" value="" /> | |
<option name="METHOD_NAME" value="" /> | |
<option name="FOLDER_NAME" value="" /> | |
<option name="TEST_TYPE" value="TEST_SCRIPT" /> | |
<option name="PATTERN" value="" /> | |
<option name="USE_PATTERN" value="false" /> | |
<option name="testToRun" value="" /> | |
<option name="keywords" value="" /> | |
<option name="params" value="" /> | |
<option name="USE_PARAM" value="false" /> | |
<option name="USE_KEYWORD" value="false" /> | |
<method /> | |
</configuration> | |
<configuration default="true" type="tests" factoryName="Nosetests"> | |
<option name="INTERPRETER_OPTIONS" value="" /> | |
<option name="PARENT_ENVS" value="true" /> | |
<envs /> | |
<option name="SDK_HOME" value="" /> | |
<option name="WORKING_DIRECTORY" value="" /> | |
<option name="IS_MODULE_SDK" value="false" /> | |
<option name="ADD_CONTENT_ROOTS" value="true" /> | |
<option name="ADD_SOURCE_ROOTS" value="true" /> | |
<module name="PyGameDemo" /> | |
<option name="SCRIPT_NAME" value="" /> | |
<option name="CLASS_NAME" value="" /> | |
<option name="METHOD_NAME" value="" /> | |
<option name="FOLDER_NAME" value="" /> | |
<option name="TEST_TYPE" value="TEST_SCRIPT" /> | |
<option name="PATTERN" value="" /> | |
<option name="USE_PATTERN" value="false" /> | |
<option name="PARAMS" value="" /> | |
<option name="USE_PARAM" value="false" /> | |
<method /> | |
</configuration> | |
<configuration default="true" type="PythonConfigurationType" factoryName="Python"> | |
<option name="INTERPRETER_OPTIONS" value="" /> | |
<option name="PARENT_ENVS" value="true" /> | |
<envs> | |
<env name="PYTHONUNBUFFERED" value="1" /> | |
</envs> | |
<option name="SDK_HOME" value="" /> | |
<option name="WORKING_DIRECTORY" value="" /> | |
<option name="IS_MODULE_SDK" value="false" /> | |
<option name="ADD_CONTENT_ROOTS" value="true" /> | |
<option name="ADD_SOURCE_ROOTS" value="true" /> | |
<module name="PyGameDemo" /> | |
<option name="SCRIPT_NAME" value="" /> | |
<option name="PARAMETERS" value="" /> | |
<method /> | |
</configuration> | |
<configuration default="true" type="tests" factoryName="Unittests"> | |
<option name="INTERPRETER_OPTIONS" value="" /> | |
<option name="PARENT_ENVS" value="true" /> | |
<envs /> | |
<option name="SDK_HOME" value="" /> | |
<option name="WORKING_DIRECTORY" value="" /> | |
<option name="IS_MODULE_SDK" value="false" /> | |
<option name="ADD_CONTENT_ROOTS" value="true" /> | |
<option name="ADD_SOURCE_ROOTS" value="true" /> | |
<module name="PyGameDemo" /> | |
<option name="SCRIPT_NAME" value="" /> | |
<option name="CLASS_NAME" value="" /> | |
<option name="METHOD_NAME" value="" /> | |
<option name="FOLDER_NAME" value="" /> | |
<option name="TEST_TYPE" value="TEST_SCRIPT" /> | |
<option name="PATTERN" value="" /> | |
<option name="USE_PATTERN" value="false" /> | |
<option name="PUREUNITTEST" value="true" /> | |
<option name="PARAMS" value="" /> | |
<option name="USE_PARAM" value="false" /> | |
<method /> | |
</configuration> | |
<configuration default="true" type="tests" factoryName="Doctests"> | |
<option name="INTERPRETER_OPTIONS" value="" /> | |
<option name="PARENT_ENVS" value="true" /> | |
<envs /> | |
<option name="SDK_HOME" value="" /> | |
<option name="WORKING_DIRECTORY" value="" /> | |
<option name="IS_MODULE_SDK" value="false" /> | |
<option name="ADD_CONTENT_ROOTS" value="true" /> | |
<option name="ADD_SOURCE_ROOTS" value="true" /> | |
<module name="PyGameDemo" /> | |
<option name="SCRIPT_NAME" value="" /> | |
<option name="CLASS_NAME" value="" /> | |
<option name="METHOD_NAME" value="" /> | |
<option name="FOLDER_NAME" value="" /> | |
<option name="TEST_TYPE" value="TEST_SCRIPT" /> | |
<option name="PATTERN" value="" /> | |
<option name="USE_PATTERN" value="false" /> | |
<method /> | |
</configuration> | |
<configuration default="true" type="tests" factoryName="Attests"> | |
<option name="INTERPRETER_OPTIONS" value="" /> | |
<option name="PARENT_ENVS" value="true" /> | |
<envs /> | |
<option name="SDK_HOME" value="" /> | |
<option name="WORKING_DIRECTORY" value="" /> | |
<option name="IS_MODULE_SDK" value="false" /> | |
<option name="ADD_CONTENT_ROOTS" value="true" /> | |
<option name="ADD_SOURCE_ROOTS" value="true" /> | |
<module name="PyGameDemo" /> | |
<option name="SCRIPT_NAME" value="" /> | |
<option name="CLASS_NAME" value="" /> | |
<option name="METHOD_NAME" value="" /> | |
<option name="FOLDER_NAME" value="" /> | |
<option name="TEST_TYPE" value="TEST_SCRIPT" /> | |
<option name="PATTERN" value="" /> | |
<option name="USE_PATTERN" value="false" /> | |
<method /> | |
</configuration> | |
<configuration default="false" name="tron" type="PythonConfigurationType" factoryName="Python"> | |
<option name="INTERPRETER_OPTIONS" value="" /> | |
<option name="PARENT_ENVS" value="true" /> | |
<envs> | |
<env name="PYTHONUNBUFFERED" value="1" /> | |
</envs> | |
<option name="SDK_HOME" value="" /> | |
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" /> | |
<option name="IS_MODULE_SDK" value="true" /> | |
<option name="ADD_CONTENT_ROOTS" value="true" /> | |
<option name="ADD_SOURCE_ROOTS" value="true" /> | |
<module name="PyGameDemo" /> | |
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/tron.py" /> | |
<option name="PARAMETERS" value="" /> | |
<RunnerSettings RunnerId="PyDebugRunner" /> | |
<RunnerSettings RunnerId="PythonRunner" /> | |
<ConfigurationWrapper RunnerId="PyDebugRunner" /> | |
<ConfigurationWrapper RunnerId="PythonRunner" /> | |
<method /> | |
</configuration> | |
<list size="5"> | |
<item index="0" class="java.lang.String" itemvalue="Python.tron" /> | |
<item index="1" class="java.lang.String" itemvalue="Python.chimp" /> | |
<item index="2" class="java.lang.String" itemvalue="Python.demo" /> | |
<item index="3" class="java.lang.String" itemvalue="Python.demo1" /> | |
<item index="4" class="java.lang.String" itemvalue="Python.demo2" /> | |
</list> | |
<recent_temporary> | |
<list size="4"> | |
<item index="0" class="java.lang.String" itemvalue="Python.demo1" /> | |
<item index="1" class="java.lang.String" itemvalue="Python.demo2" /> | |
<item index="2" class="java.lang.String" itemvalue="Python.demo" /> | |
<item index="3" class="java.lang.String" itemvalue="Python.chimp" /> | |
</list> | |
</recent_temporary> | |
</component> | |
<component name="ShelveChangesManager" show_recycled="false" /> | |
<component name="SvnConfiguration" myUseAcceleration="nothing"> | |
<configuration /> | |
</component> | |
<component name="TaskManager"> | |
<task active="true" id="Default" summary="Default task"> | |
<changelist id="61a54731-abcb-423d-9fde-8a2bb6620511" name="Default" comment="" /> | |
<created>1411591538185</created> | |
<updated>1411591538185</updated> | |
</task> | |
<servers /> | |
</component> | |
<component name="ToolWindowManager"> | |
<frame x="-9" y="-9" width="1938" height="1050" extended-state="6" /> | |
<editor active="false" /> | |
<layout> | |
<window_info id="Changes" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" /> | |
<window_info id="Terminal" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" /> | |
<window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" /> | |
<window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" /> | |
<window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.14739583" sideWeight="0.5" order="0" side_tool="false" content_ui="combo" /> | |
<window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.37176725" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" /> | |
<window_info id="Favorites" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="2" side_tool="true" content_ui="tabs" /> | |
<window_info id="Event Log" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="7" side_tool="true" content_ui="tabs" /> | |
<window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.3517835" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" /> | |
<window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" /> | |
<window_info id="Cvs" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" /> | |
<window_info id="Message" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" /> | |
<window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.32962137" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" /> | |
<window_info id="Ant Build" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" /> | |
<window_info id="Commander" active="false" anchor="right" auto_hide="false" internal_type="SLIDING" type="SLIDING" visible="false" weight="0.4" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" /> | |
<window_info id="Inspection" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.4" sideWeight="0.5" order="5" side_tool="false" content_ui="tabs" /> | |
<window_info id="Hierarchy" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="2" side_tool="false" content_ui="combo" /> | |
</layout> | |
<layout-to-restore> | |
<window_info id="Cvs" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" /> | |
<window_info id="Changes" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" /> | |
<window_info id="Message" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" /> | |
<window_info id="Terminal" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="8" side_tool="false" content_ui="tabs" /> | |
<window_info id="Ant Build" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" /> | |
<window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.32962137" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" /> | |
<window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.4" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" /> | |
<window_info id="Favorites" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="2" side_tool="true" content_ui="tabs" /> | |
<window_info id="Event Log" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="9" side_tool="true" content_ui="tabs" /> | |
<window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="10" side_tool="false" content_ui="tabs" /> | |
<window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" /> | |
<window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" /> | |
<window_info id="Commander" active="false" anchor="right" auto_hide="false" internal_type="SLIDING" type="SLIDING" visible="false" weight="0.4" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" /> | |
<window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.16845238" sideWeight="0.5" order="0" side_tool="false" content_ui="combo" /> | |
<window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.35523385" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" /> | |
<window_info id="Hierarchy" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="2" side_tool="false" content_ui="combo" /> | |
<window_info id="Inspection" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.4" sideWeight="0.5" order="5" side_tool="false" content_ui="tabs" /> | |
</layout-to-restore> | |
</component> | |
<component name="Vcs.Log.UiProperties"> | |
<option name="RECENTLY_FILTERED_USER_GROUPS"> | |
<collection /> | |
</option> | |
<option name="RECENTLY_FILTERED_BRANCH_GROUPS"> | |
<collection /> | |
</option> | |
</component> | |
<component name="VcsContentAnnotationSettings"> | |
<option name="myLimit" value="2678400000" /> | |
</component> | |
<component name="VcsManagerConfiguration"> | |
<option name="myTodoPanelSettings"> | |
<TodoPanelSettings /> | |
</option> | |
</component> | |
<component name="XDebuggerManager"> | |
<breakpoint-manager> | |
<breakpoints> | |
<line-breakpoint enabled="true" type="python-line"> | |
<url>file://$PROJECT_DIR$/tron.py</url> | |
<line>151</line> | |
<option name="timeStamp" value="10" /> | |
</line-breakpoint> | |
</breakpoints> | |
<option name="time" value="11" /> | |
</breakpoint-manager> | |
</component> | |
<component name="editorHistoryManager"> | |
<entry file="file://$PROJECT_DIR$/tron.py"> | |
<provider selected="true" editor-type-id="text-editor"> | |
<state vertical-scroll-proportion="0.0" vertical-offset="1946" max-vertical-offset="4300"> | |
<caret line="98" column="0" selection-start-line="98" selection-start-column="0" selection-end-line="98" selection-end-column="0" /> | |
<folding> | |
<element signature="e#0#10#0" expanded="true" /> | |
</folding> | |
</state> | |
</provider> | |
</entry> | |
<entry file="file://$PROJECT_DIR$/player.py"> | |
<provider selected="true" editor-type-id="text-editor"> | |
<state vertical-scroll-proportion="0.0" vertical-offset="200" max-vertical-offset="900"> | |
<caret line="8" column="13" selection-start-line="8" selection-start-column="13" selection-end-line="8" selection-end-column="13" /> | |
<folding /> | |
</state> | |
</provider> | |
</entry> | |
<entry file="file://$PROJECT_DIR$/__init__.py"> | |
<provider selected="true" editor-type-id="text-editor"> | |
<state vertical-scroll-proportion="0.0" vertical-offset="0" max-vertical-offset="150"> | |
<caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" /> | |
<folding /> | |
</state> | |
</provider> | |
</entry> | |
<entry file="file://C:/Python27/Lib/site-packages/pygame/__init__.py"> | |
<provider selected="true" editor-type-id="text-editor"> | |
<state vertical-scroll-proportion="-0.435" vertical-offset="261" max-vertical-offset="5270"> | |
<caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" /> | |
<folding /> | |
</state> | |
</provider> | |
</entry> | |
<entry file="file://$PROJECT_DIR$/__init__.py"> | |
<provider selected="true" editor-type-id="text-editor"> | |
<state vertical-scroll-proportion="0.0" vertical-offset="0" max-vertical-offset="815"> | |
<caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" /> | |
<folding /> | |
</state> | |
</provider> | |
</entry> | |
<entry file="file://$PROJECT_DIR$/player.py"> | |
<provider selected="true" editor-type-id="text-editor"> | |
<state vertical-scroll-proportion="0.0" vertical-offset="0" max-vertical-offset="900"> | |
<caret line="8" column="13" selection-start-line="8" selection-start-column="13" selection-end-line="8" selection-end-column="13" /> | |
<folding /> | |
</state> | |
</provider> | |
</entry> | |
<entry file="file://$PROJECT_DIR$/tron.py"> | |
<provider selected="true" editor-type-id="text-editor"> | |
<state vertical-scroll-proportion="0.91629463" vertical-offset="3454" max-vertical-offset="4450"> | |
<caret line="171" column="6" selection-start-line="171" selection-start-column="6" selection-end-line="171" selection-end-column="6" /> | |
<folding> | |
<element signature="e#0#10#0" expanded="true" /> | |
</folding> | |
</state> | |
</provider> | |
</entry> | |
</component> | |
</project> | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
__author__ = '[email protected]' | |
class Player: | |
"""This class Defines properties and behavior of a Tron player""" | |
x = 0 | |
y = 0 | |
direction = "stop" | |
score = 0 | |
def right(self): | |
self.x = self.x+1 | |
def left(self): | |
self.x = self.x-1 | |
def down(self): | |
self.y = self.y+1 | |
def up(self): | |
self.y = self.y-1 | |
def move(self): | |
if self.direction == "up": | |
self.up() | |
if self.direction == "down": | |
self.down() | |
if self.direction == "left": | |
self.left() | |
if self.direction == "right": | |
self.right() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
import pygame | |
from player import Player | |
# define some R,G,B colors | |
BLACK = (0, 0, 0) | |
WHITE = (255, 255, 255) | |
RED = (255, 0, 0) | |
GREEN = (0, 255, 0) | |
BLUE = (0, 0, 255) | |
# initialize pygame | |
pygame.init() | |
# frames per second setting | |
FPS = 30 | |
fpsClock = pygame.time.Clock() | |
# set up the window (width, height), flags, color depth | |
pxWidth = 800 | |
pxHeight = 600 | |
DISPLAYSURF = pygame.display.set_mode((pxWidth, pxHeight), 0, 32) | |
CELLSIZE = 15 | |
# number of cells across | |
cellWidth = pxWidth / CELLSIZE | |
#number of cells down | |
cellHeight = pxHeight / CELLSIZE | |
# define player 1 | |
player1 = Player() | |
player1.x = 9 | |
player1.y = 9 | |
player1.color = BLUE | |
player1.direction = "right" | |
#define player 2 | |
player2 = Player() | |
player2.x = cellWidth - 10 | |
player2.y = cellHeight - 10 | |
player2.color = RED | |
player2.direction = "left" | |
# a list of all cells on the gameboard | |
cells = [] | |
for i in range(cellWidth * cellHeight): | |
cells.append(0) | |
def reset(): | |
player1.x = 9 | |
player1.y = 9 | |
player1.direction = "right" | |
player2.x = cellWidth - 10 | |
player2.y = cellHeight - 10 | |
player2.direction = "left" | |
for i in range(cellWidth * cellHeight): | |
cells[i] = 0 | |
#draws a grid on the window | |
def draw_grid_lines(): | |
for x1 in range(0, cellWidth): | |
pygame.draw.line(DISPLAYSURF, BLACK, (CELLSIZE * x1, 0), (CELLSIZE * x1, pxHeight), 1) | |
for y1 in range(0, cellHeight): | |
pygame.draw.line(DISPLAYSURF, BLACK, (0, CELLSIZE * y1), (pxWidth, CELLSIZE * y1), 1) | |
def draw_box(color, x, y): | |
rect = pygame.Rect(x * CELLSIZE, y * CELLSIZE, CELLSIZE, CELLSIZE) | |
pygame.draw.rect(DISPLAYSURF, color, rect, 0) | |
def player_crashed(player): | |
if player.x < 0: | |
return True | |
if player.x >= cellWidth: | |
return True | |
if player.y < 0: | |
return True | |
if player.y >= cellHeight: | |
return True | |
index = calc_cell_index(player.x, player.y) | |
if cells[index] != 0: | |
return True | |
return False | |
def draw_tails(): | |
for y in range(cellHeight): | |
for x in range(cellWidth): | |
pos = y * cellWidth + x | |
if cells[pos] == 1: | |
draw_box(player1.color, x, y) | |
if cells[pos] == 2: | |
draw_box(player2.color, x, y) | |
def record_position(player, num): | |
pos = calc_cell_index(player.x, player.y) | |
cells[pos] = num | |
def calc_cell_index(x, y): | |
return y * cellWidth + x | |
def handle_keypress(key): | |
if key == pygame.K_UP: | |
player1.direction = "up" | |
if key == pygame.K_DOWN: | |
player1.direction = "down" | |
if key == pygame.K_LEFT: | |
player1.direction = "left" | |
if key == pygame.K_RIGHT: | |
player1.direction = "right" | |
def draw_scores(): | |
basicfont = pygame.font.SysFont(None, 48) | |
scoretext1 = "Player 1: {0}".format(player1.score) | |
text1 = basicfont.render(scoretext1, True, player1.color, (255, 255, 255)) | |
textrect1 = text1.get_rect() | |
textrect1.x = 0 | |
textrect1.y = 0 | |
DISPLAYSURF.blit(text1, textrect1) | |
scoretext2 = "Player 2: {0}".format(player2.score) | |
text2 = basicfont.render(scoretext2, True, player2.color, (255, 255, 255)) | |
textrect2 = text2.get_rect() | |
textrect2.x = DISPLAYSURF.get_rect().width - textrect2.width | |
textrect2.y = DISPLAYSURF.get_rect().height - textrect2.height | |
DISPLAYSURF.blit(text2, textrect2) | |
roundOver = False | |
reset() | |
pygame.display.set_caption('Drawing') | |
while True: | |
for event in pygame.event.get(): | |
if event.type == pygame.QUIT: | |
pygame.quit() | |
sys.exit() | |
if event.type == pygame.KEYDOWN: | |
handle_keypress(event.key) | |
if player_crashed(player1): | |
player2.score += 1 | |
roundOver = True | |
if player_crashed(player2): | |
player1.score += 1 | |
roundOver = True | |
if roundOver: | |
reset() | |
roundOver = False | |
else: | |
record_position(player1, 1) | |
record_position(player2, 2) | |
player1.move() | |
player2.move() | |
print "player 1 is now at ({0},{1})".format(player1.x, player1.y) | |
DISPLAYSURF.fill(WHITE) | |
draw_grid_lines() | |
draw_tails() | |
draw_scores() | |
pygame.display.update() | |
#wait just a little bit before updating the display again | |
fpsClock.tick(FPS) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment