all repos — Legends-RPG @ 4ca4333135ff23d7500596a1e99a579145de6627

A fantasy mini-RPG built with Python and Pygame.

Created game skeleton
Justin Armstrong justinmeister@gmail.com
Thu, 27 Feb 2014 22:42:39 -0800
commit

4ca4333135ff23d7500596a1e99a579145de6627

parent

3b73d461f5e7e0fdc3ca397e45f6ac14e23ca548

A .idea/.name

@@ -0,0 +1,1 @@

+The Lost Crown
A .idea/The Lost Crown.iml

@@ -0,0 +1,9 @@

+<?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> +
A .idea/encodings.xml

@@ -0,0 +1,5 @@

+<?xml version="1.0" encoding="UTF-8"?> +<project version="4"> + <component name="Encoding" useUTFGuessing="true" native2AsciiForPropertiesFiles="false" /> +</project> +
A .idea/misc.xml

@@ -0,0 +1,46 @@

+<?xml version="1.0" encoding="UTF-8"?> +<project version="4"> + <component name="ProjectInspectionProfilesVisibleTreeState"> + <entry key="Project Default"> + <profile-state> + <expanded-state> + <State> + <id /> + </State> + <State> + <id>Python</id> + </State> + </expanded-state> + <selected-state> + <State> + <id>Buildout</id> + </State> + </selected-state> + </profile-state> + </entry> + </component> + <component name="ProjectRootManager" version="2" project-jdk-name="Python 2.7.5 (/usr/local/bin/python2.7)" project-jdk-type="Python SDK" /> + <component name="PyConsoleOptionsProvider"> + <option name="myPythonConsoleState"> + <console-settings /> + </option> + </component> + <component name="SvnConfiguration" maxAnnotateRevisions="500" myUseAcceleration="nothing" myAutoUpdateAfterCommit="false" cleanupOnStartRun="false" SSL_PROTOCOLS="sslv3"> + <option name="USER" value="" /> + <option name="PASSWORD" value="" /> + <option name="mySSHConnectionTimeout" value="30000" /> + <option name="mySSHReadTimeout" value="30000" /> + <option name="LAST_MERGED_REVISION" /> + <option name="MERGE_DRY_RUN" value="false" /> + <option name="MERGE_DIFF_USE_ANCESTRY" value="true" /> + <option name="UPDATE_LOCK_ON_DEMAND" value="false" /> + <option name="IGNORE_SPACES_IN_MERGE" value="false" /> + <option name="CHECK_NESTED_FOR_QUICK_MERGE" value="false" /> + <option name="IGNORE_SPACES_IN_ANNOTATE" value="true" /> + <option name="SHOW_MERGE_SOURCES_IN_ANNOTATE" value="true" /> + <option name="FORCE_UPDATE" value="false" /> + <option name="IGNORE_EXTERNALS" value="false" /> + <myIsUseDefaultProxy>false</myIsUseDefaultProxy> + </component> +</project> +
A .idea/modules.xml

@@ -0,0 +1,9 @@

+<?xml version="1.0" encoding="UTF-8"?> +<project version="4"> + <component name="ProjectModuleManager"> + <modules> + <module fileurl="file://$PROJECT_DIR$/.idea/The Lost Crown.iml" filepath="$PROJECT_DIR$/.idea/The Lost Crown.iml" /> + </modules> + </component> +</project> +
A .idea/scopes/scope_settings.xml

@@ -0,0 +1,5 @@

+<component name="DependencyValidationManager"> + <state> + <option name="SKIP_IMPORT_STATEMENTS" value="false" /> + </state> +</component>
A .idea/vcs.xml

@@ -0,0 +1,7 @@

+<?xml version="1.0" encoding="UTF-8"?> +<project version="4"> + <component name="VcsDirectoryMappings"> + <mapping directory="" vcs="" /> + </component> +</project> +
A .idea/workspace.xml

@@ -0,0 +1,478 @@

+<?xml version="1.0" encoding="UTF-8"?> +<project version="4"> + <component name="ChangeListManager"> + <list default="true" id="94120964-a69b-4504-beac-d9331a54b67a" name="Default" comment="" /> + <ignored path="The Lost Crown.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="The Lost Crown" /> + </component> + <component name="FileEditorManager"> + <leaf> + <file leaf-file-name="setup.py" pinned="false" current="false" current-in-tab="false"> + <entry file="file://$PROJECT_DIR$/data/setup.py"> + <provider selected="true" editor-type-id="text-editor"> + <state line="24" column="42" selection-start="687" selection-end="687" vertical-scroll-proportion="0.0" vertical-offset="0" max-vertical-offset="465"> + <folding> + <element signature="e#116#125#0" expanded="true" /> + </folding> + </state> + </provider> + </entry> + </file> + <file leaf-file-name="tools.py" pinned="false" current="false" current-in-tab="false"> + <entry file="file://$PROJECT_DIR$/data/tools.py"> + <provider selected="true" editor-type-id="text-editor"> + <state line="133" column="18" selection-start="4166" selection-end="4166" vertical-scroll-proportion="0.0" vertical-offset="900" max-vertical-offset="2190"> + <folding> + <element signature="e#32#41#0" expanded="true" /> + </folding> + </state> + </provider> + </entry> + </file> + <file leaf-file-name="main.py" pinned="false" current="false" current-in-tab="false"> + <entry file="file://$PROJECT_DIR$/data/main.py"> + <provider selected="true" editor-type-id="text-editor"> + <state line="12" column="17" selection-start="316" selection-end="316" vertical-scroll-proportion="0.0" vertical-offset="0" max-vertical-offset="240"> + <folding /> + </state> + </provider> + </entry> + </file> + <file leaf-file-name="town.py" pinned="false" current="true" current-in-tab="true"> + <entry file="file://$PROJECT_DIR$/data/states/town.py"> + <provider selected="true" editor-type-id="text-editor"> + <state line="17" column="40" selection-start="496" selection-end="496" vertical-scroll-proportion="0.3531856" vertical-offset="0" max-vertical-offset="722"> + <folding> + <element signature="e#32#59#0" expanded="true" /> + </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$/The_Lost_Crown.py" /> + <option value="$PROJECT_DIR$/data/main.py" /> + <option value="$PROJECT_DIR$/data/constants.py" /> + <option value="$PROJECT_DIR$/data/setup.py" /> + <option value="$PROJECT_DIR$/data/tools.py" /> + <option value="$PROJECT_DIR$/data/__init__.py" /> + <option value="$PROJECT_DIR$/data/states/__init__.py" /> + <option value="$PROJECT_DIR$/data/components/__init__.py" /> + <option value="$PROJECT_DIR$/resources/fonts/__init__.py" /> + <option value="$PROJECT_DIR$/resources/graphics/__init__.py" /> + <option value="$PROJECT_DIR$/resources/music/__init__.py" /> + <option value="$PROJECT_DIR$/resources/sound/__init__.py" /> + <option value="$PROJECT_DIR$/data/states/town.py" /> + </list> + </option> + </component> + <component name="ProjectFrameBounds"> + <option name="x" value="678" /> + <option name="y" value="22" /> + <option name="width" value="765" /> + <option name="height" value="819" /> + </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" splitterProportion="0.5"> + <flattenPackages /> + <showMembers /> + <showModules /> + <showLibraryContents /> + <hideEmptyPackages /> + <abbreviatePackageNames /> + <autoscrollToSource /> + <autoscrollFromSource /> + <sortByType /> + </navigator> + <panes> + <pane id="ProjectPane"> + <subPane> + <PATH> + <PATH_ELEMENT> + <option name="myItemId" value="The Lost Crown" /> + <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" /> + </PATH_ELEMENT> + </PATH> + <PATH> + <PATH_ELEMENT> + <option name="myItemId" value="The Lost Crown" /> + <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" /> + </PATH_ELEMENT> + <PATH_ELEMENT> + <option name="myItemId" value="The Lost Crown" /> + <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" /> + </PATH_ELEMENT> + </PATH> + <PATH> + <PATH_ELEMENT> + <option name="myItemId" value="The Lost Crown" /> + <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" /> + </PATH_ELEMENT> + <PATH_ELEMENT> + <option name="myItemId" value="The Lost Crown" /> + <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" /> + </PATH_ELEMENT> + <PATH_ELEMENT> + <option name="myItemId" value="data" /> + <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" /> + </PATH_ELEMENT> + </PATH> + <PATH> + <PATH_ELEMENT> + <option name="myItemId" value="The Lost Crown" /> + <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" /> + </PATH_ELEMENT> + <PATH_ELEMENT> + <option name="myItemId" value="The Lost Crown" /> + <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" /> + </PATH_ELEMENT> + <PATH_ELEMENT> + <option name="myItemId" value="data" /> + <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" /> + </PATH_ELEMENT> + <PATH_ELEMENT> + <option name="myItemId" value="states" /> + <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" /> + </PATH_ELEMENT> + </PATH> + <PATH> + <PATH_ELEMENT> + <option name="myItemId" value="The Lost Crown" /> + <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" /> + </PATH_ELEMENT> + <PATH_ELEMENT> + <option name="myItemId" value="The Lost Crown" /> + <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" /> + </PATH_ELEMENT> + <PATH_ELEMENT> + <option name="myItemId" value="data" /> + <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" /> + </PATH_ELEMENT> + <PATH_ELEMENT> + <option name="myItemId" value="components" /> + <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="options.splitter.main.proportions" value="0.3" /> + <property name="options.lastSelected" value="Errors" /> + <property name="last_opened_file_path" value="$PROJECT_DIR$/.." /> + <property name="options.splitter.details.proportions" value="0.2" /> + <property name="options.searchVisible" value="true" /> + </component> + <component name="RunManager"> + <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="The Lost Crown" /> + <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="The Lost Crown" /> + <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="The Lost Crown" /> + <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="The Lost Crown" /> + <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="The Lost Crown" /> + <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="The Lost Crown" /> + <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> + <list size="0" /> + </component> + <component name="ShelveChangesManager" show_recycled="false" /> + <component name="TaskManager"> + <task active="true" id="Default" summary="Default task"> + <changelist id="94120964-a69b-4504-beac-d9331a54b67a" name="Default" comment="" /> + <created>1393520921233</created> + <updated>1393520921233</updated> + </task> + <servers /> + </component> + <component name="ToolWindowManager"> + <frame x="678" y="22" width="765" height="819" extended-state="0" /> + <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="-1" 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="-1" 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="true" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.24444444" 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.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="-1" 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="-1" 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.33" 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="-1" 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="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.33" 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="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> + </component> + <component name="Vcs.Log.UiProperties"> + <option name="RECENTLY_FILTERED_USER_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 /> + </component> + <component name="editorHistoryManager"> + <entry file="file://$PROJECT_DIR$/data/constants.py"> + <provider selected="true" editor-type-id="text-editor"> + <state line="6" column="12" selection-start="104" selection-end="104" vertical-scroll-proportion="0.0" vertical-offset="0" max-vertical-offset="195"> + <folding /> + </state> + </provider> + </entry> + <entry file="file://$PROJECT_DIR$/data/__init__.py"> + <provider selected="true" editor-type-id="text-editor"> + <state line="0" column="0" selection-start="0" selection-end="0" vertical-scroll-proportion="0.0" vertical-offset="0" max-vertical-offset="699"> + <folding /> + </state> + </provider> + </entry> + <entry file="file://$PROJECT_DIR$/data/states/__init__.py"> + <provider selected="true" editor-type-id="text-editor"> + <state line="0" column="0" selection-start="0" selection-end="0" vertical-scroll-proportion="0.0" vertical-offset="0" max-vertical-offset="699"> + <folding /> + </state> + </provider> + </entry> + <entry file="file://$PROJECT_DIR$/data/components/__init__.py"> + <provider selected="true" editor-type-id="text-editor"> + <state line="1" column="0" selection-start="31" selection-end="31" vertical-scroll-proportion="0.0" vertical-offset="0" max-vertical-offset="105"> + <folding /> + </state> + </provider> + </entry> + <entry file="file://$PROJECT_DIR$/resources/fonts/__init__.py"> + <provider selected="true" editor-type-id="text-editor"> + <state line="0" column="0" selection-start="0" selection-end="0" vertical-scroll-proportion="0.0" vertical-offset="0" max-vertical-offset="676"> + <folding /> + </state> + </provider> + </entry> + <entry file="file://$PROJECT_DIR$/resources/graphics/__init__.py"> + <provider selected="true" editor-type-id="text-editor"> + <state line="0" column="0" selection-start="0" selection-end="0" vertical-scroll-proportion="0.0" vertical-offset="0" max-vertical-offset="676"> + <folding /> + </state> + </provider> + </entry> + <entry file="file://$PROJECT_DIR$/resources/music/__init__.py"> + <provider selected="true" editor-type-id="text-editor"> + <state line="0" column="0" selection-start="0" selection-end="0" vertical-scroll-proportion="0.0" vertical-offset="0" max-vertical-offset="676"> + <folding /> + </state> + </provider> + </entry> + <entry file="file://$PROJECT_DIR$/resources/sound/__init__.py"> + <provider selected="true" editor-type-id="text-editor"> + <state line="0" column="0" selection-start="0" selection-end="0" vertical-scroll-proportion="0.0" vertical-offset="0" max-vertical-offset="676"> + <folding /> + </state> + </provider> + </entry> + <entry file="file://$PROJECT_DIR$/The_Lost_Crown.py"> + <provider selected="true" editor-type-id="text-editor"> + <state line="13" column="14" selection-start="268" selection-end="268" vertical-scroll-proportion="0.0" vertical-offset="0" max-vertical-offset="300"> + <folding /> + </state> + </provider> + </entry> + <entry file="file://$PROJECT_DIR$/data/setup.py"> + <provider selected="true" editor-type-id="text-editor"> + <state line="24" column="42" selection-start="687" selection-end="687" vertical-scroll-proportion="0.0" vertical-offset="0" max-vertical-offset="465"> + <folding> + <element signature="e#116#125#0" expanded="true" /> + </folding> + </state> + </provider> + </entry> + <entry file="file://$PROJECT_DIR$/data/main.py"> + <provider selected="true" editor-type-id="text-editor"> + <state line="12" column="17" selection-start="316" selection-end="316" vertical-scroll-proportion="0.0" vertical-offset="0" max-vertical-offset="270"> + <folding /> + </state> + </provider> + </entry> + <entry file="file://$PROJECT_DIR$/data/tools.py"> + <provider selected="true" editor-type-id="text-editor"> + <state line="133" column="18" selection-start="4166" selection-end="4166" vertical-scroll-proportion="0.0" vertical-offset="1466" max-vertical-offset="2190"> + <folding> + <element signature="e#32#41#0" expanded="true" /> + </folding> + </state> + </provider> + </entry> + <entry file="file://$PROJECT_DIR$/data/states/town.py"> + <provider selected="true" editor-type-id="text-editor"> + <state line="17" column="40" selection-start="496" selection-end="496" vertical-scroll-proportion="0.3531856" vertical-offset="0" max-vertical-offset="722"> + <folding> + <element signature="e#32#59#0" expanded="true" /> + </folding> + </state> + </provider> + </entry> + </component> +</project> +
A The_Lost_Crown.py

@@ -0,0 +1,14 @@

+#!/usr/bin/env python +__author__ = 'justinarmstrong' + +"""This is a fantasy RPG game about a warrior whose +quest is to recover a magic crown""" + +import sys +import pygame as pg +from data.main import main + +if __name__ =='__main__': + main() + pg.quit() + sys.quit()
A data/__init__.py

@@ -0,0 +1,1 @@

+__author__ = 'justinarmstrong'
A data/components/__init__.py

@@ -0,0 +1,1 @@

+__author__ = 'justinarmstrong'
A data/constants.py

@@ -0,0 +1,7 @@

+__author__ = 'justinarmstrong' + +"""Constants used throughout the game""" + +##GAME STATES""" + +TOWN = 'town'
A data/main.py

@@ -0,0 +1,13 @@

+__author__ = 'justinarmstrong' + +from . import setup, tools +from . states import town +from . import constants as c + +def main(): + """Add states to control here""" + run_it = tools.Control(setup.ORIGINAL_CAPTION) + state_dict = {c.TOWN: town.Town()} + + run_it.setup_states(state_dict, c.TOWN) + run_it.main()
A data/setup.py

@@ -0,0 +1,25 @@

+__author__ = 'justinarmstrong' + +""" +This module initializes the display and +creates dictionaries of resources. +""" + +import os +import pygame as pg +from . import tools +from . import constants as c + +ORIGINAL_CAPTION = 'The Lost Crown' + +os.environ['SDL_VIDEO_CENTERED'] = '1' +pg.init() +pg.event.set_allowed([pg.KEYDOWN, pg.KEYUP, pg.QUIT]) +pg.display.set_caption(ORIGINAL_CAPTION) +SCREEN = pg.display.set_mode((800, 600)) +SCREEN_RECT = SCREEN.get_rect() + +FONTS = tools.load_all_fonts(os.path.join('resources', 'fonts')) +MUSIC = tools.load_all_music(os.path.join('resources', 'music')) +GFX = tools.load_all_gfx(os.path.join('resources', 'graphics')) +SFX = tools.load_all_sfx(os.path.join('resources', 'sound'))
A data/states/__init__.py

@@ -0,0 +1,1 @@

+__author__ = 'justinarmstrong'
A data/states/town.py

@@ -0,0 +1,18 @@

+__author__ = 'justinarmstrong' + +from .. import setup, tools +from .. import constants as c + +class Town(tools._State): + def __init__(self): + super(Town, self).__init__() + + def startup(self, current_time, persist): + """Called when the State object is created""" + self.persist = persist + self.current_time = current_time + + def update(self, surface, keys, current_time): + """Updates state""" + self.keys = keys + self.current_time = current_time
A data/tools.py

@@ -0,0 +1,140 @@

+__author__ = 'justinarmstrong' + +import os +import pygame as pg + +class Control(object): + """ + Control class for entire project. Contains the game loop, and contains + the event_loop which passes events to States as needed. Logic for flipping + states is also found here. + """ + def __init__(self, caption): + self.screen = pg.display.get_surface() + self.done = False + self.clock = pg.time.Clock() + self.caption = caption + self.fps = 60 + self.show_fps = False + self.current_time = 0.0 + self.keys = pg.key.get_pressed() + self.state_dict = {} + self.state_name = None + self.state = None + + def setup_states(self, state_dict, start_state): + self.state_dict = state_dict + self.state_name = start_state + self.state = self.state_dict[self.state_name] + + def update(self): + self.current_time = pg.time.get_ticks() + if self.state.quit: + self.done = True + elif self.state.done: + self.flip_state() + self.state.update(self.screen, self.keys, self.current_time) + + def flip_state(self): + previous, self.state_name = self.state_name, self.state.next + persist = self.state.cleanup() + self.state = self.state_dict[self.state_name] + self.state.startup(self.current_time, persist) + self.state.previous = previous + + def event_loop(self): + for event in pg.event.get(): + if event.type == pg.QUIT: + self.done = True + elif event.type == pg.KEYDOWN: + self.keys = pg.key.get_pressed() + self.toggle_show_fps(event.key) + elif event.type == pg.KEYUP: + self.keys = pg.key.get_pressed() + self.state.get_event(event) + + def toggle_show_fps(self, key): + if key == pg.K_F5: + self.show_fps = not self.show_fps + if not self.show_fps: + pg.display.set_caption(self.caption) + + def main(self): + """Main loop for entire program""" + while not self.done: + self.event_loop() + self.update() + pg.display.update() + self.clock.tick(self.fps) + if self.show_fps: + fps = self.clock.get_fps() + with_fps = "{} - {:.2f} FPS".format(self.caption, fps) + pg.display.set_caption(with_fps) + +class _State(object): + """Base class for all game states""" + def __init__(self): + self.start_time = 0.0 + self.current_time = 0.0 + self.done = False + self.quit = False + self.next = None + self.previous = None + self.persist = {} + + def get_event(self, event): + pass + + def startup(self, current_time, persistant): + self.persist = persistant + self.start_time = current_time + + def cleanup(self): + self.done = False + return self.persist + + def update(self, surface, keys, current_time): + pass + + +def load_all_gfx(directory, colorkey=(255,0,255), accept=('.png', 'jpg', 'bmp')): + graphics = {} + for pic in os.listdir(directory): + name, ext = os.path.splitext(pic) + if ext.lower() in accept: + img = pg.image.load(os.path.join(directory, pic)) + if img.get_alpha(): + img = img.convert_alpha() + else: + img = img.convert() + img.set_colorkey(colorkey) + graphics[name] = img + return graphics + + +def load_all_music(directory, accept=('.wav', '.mp3', '.ogg', '.mdi')): + songs = {} + for song in os.listdir(directory): + name, ext = os.path.splitext(song) + if ext.lower() in accept: + song[name] = os.path.join(directory, song) + return songs + + +def load_all_fonts(directory, accept=('ttf')): + return load_all_music(directory, accept) + + +def load_all_sfx(directory, accept=('.wav','.mp3','.ogg','.mdi')): + effects = {} + for fx in os.listdir(directory): + name, ext = os.path.splitext(fx) + if ext.lower() in accept: + effects[name] = pg.mixer.Sound(os.path.join(directory, fx)) + return effects + + + + + +
A resources/fonts/__init__.py

@@ -0,0 +1,1 @@

+__author__ = 'justinarmstrong'
A resources/graphics/__init__.py

@@ -0,0 +1,1 @@

+__author__ = 'justinarmstrong'
A resources/music/__init__.py

@@ -0,0 +1,1 @@

+__author__ = 'justinarmstrong'
A resources/sound/__init__.py

@@ -0,0 +1,1 @@

+__author__ = 'justinarmstrong'