Arne Babenhauserheide  committed 4703715

setuptools fixes to make fungus egg distributable.

  • Participants
  • Parent commits 8ff6d52
  • Tags v0.1.1

Comments (0)

Files changed (4)


 # Also listdir to see the files in the audio dir
 from os import listdir
-from os.path import isfile, join
+from os.path import isfile, join, dirname
 #### An example audio scene ####
 ## An audio file ##
 sword_file = "sword.wav"
+AUDIO_BASE_PATH = join(dirname(__file__), "audio")
 ### The Scene itself. 
 class Scene(BaseScene): 


     - python fungus_01_intro.Scene
       Start the fungus Intro
+For developers: 
+    - Just clone the fungus project from the Mercurial repository and add your scenes inside it. 
+      Distribute them along with the fungus engine. 
+Mercurial repository: 
-To adjust the default scene, just import another one as Scene
+To adjust the default scene, just import another one as Scene in
 ### Imports ###


 from fungus_core import Sprite
 from fungus_scene import BaseScene
-from os.path import join
+from os.path import join, dirname
 from random import random, choice, randint
 ### Things needed for the scene
+IMAGE_BASE_PATH = join(dirname(__file__), "graphics")
 class Blob(Sprite): 
 	"""One of the moving blobs.
 	_unbonded = UNBONDED
 	def __init__(self, sex=None, *args, **kwds): 
 		if sex is None: 
-			super(Blob, self).__init__(image_path=join("graphics", "blobn.png"), *args, **kwds)
+			super(Blob, self).__init__(image_path=join(IMAGE_BASE_PATH, "blobn.png"), *args, **kwds)
 		elif sex=="female":
-			super(Blob, self).__init__(image_path=join("graphics", "blobf.png"), *args, **kwds)
+			super(Blob, self).__init__(image_path=join(IMAGE_BASE_PATH, "blobf.png"), *args, **kwds)
 		else: # male
- 			super(Blob, self).__init__(image_path=join("graphics", "blob.png"), *args, **kwds)
+ 			super(Blob, self).__init__(image_path=join(IMAGE_BASE_PATH, "blob.png"), *args, **kwds)
 		#: The one to move towards
 		self.partner = None
 		#: The last partner
 #    You should have received a copy of the GNU General Public License
 #    along with this program.  If not, see <>
-"""Fungus - Live and survive in a world of mold.
+"""Fungus - A simple scene based game engine building on pyglet.
 # We use the advanced setuptools. 
-from setuptools import setup
+from setuptools import setup, find_packages
+#from distutils.core import setup
 # If we have one or more packages, we also need to import find packages  
 # It is currently not necessary. 
 # The corresponding line in setup() is commented out, too. 
 # from setuptools import find_packages
-__version__ = "0.1"
+__version__ = "0.1.1"
 # Create the description from the docstrings 
 LONG_DESCRIPTION += "\n\n" + "\n".join(fungus_game__doc__.split("\n")[3:])
 # And the Changelog from Changelog.txt
-#LONG_DESCRIPTION += "\n\n" + __changelog__
+# Load the changelog data
+    f = open("Changelog.txt", "r")
+    __changelog__ = f.readlines()
+    __changelog__ = ["  " + line for line in __changelog__]
+    __changelog__ = "\n".join(__changelog__)
+    f.close()
+    __changelog__ == ""
+LONG_DESCRIPTION += "\n\nChangelog: \n" + __changelog__
 # Fire up setup with these values.i- must be modified. 
-      author='Phillip Schönherr and Arne Babenhauserheide',
+      author='Phillip Schoenherr and Arne Babenhauserheide',
       keywords=["game engine", "pyglet"], 
       license="GNU GPL-3 or later", 
       requires = ["pyglet"], 
+      # package data
+      packages = find_packages('.'), 
+      #packages = ['graphics'],
+      package_dir = {'graphics': 'graphics'},
+      package_data = {'': ['*.png', '*.wav*']},
       # All classifiers can be found via python register --list-classifiers
       classifiers = [
             "License :: OSI Approved :: GNU General Public License (GPL)",
 	    "Topic :: Games/Entertainment"
-      #packages = find_packages('.'), 
-      py_modules=['fungus_core', 'fungus_scene'],
+      py_modules=['fungus_core', 'fungus_scene', 'fungus_swarm', 'fungus_audio_scene', 'fungus_01_intro', 'fungus_game'],