1 / 16

Creating a pygame bundle

Creating a pygame bundle. What is a bundle activity.info Activity Icon activity.py Custom Data Saved Data Rolling a bundle Testing bundles. Bundles. https://coderanger.net/svn/projects/olpc/games/Example.activity/ MyGame .activity/ activity/ activity.info activity- mygame .svg data/

aulani
Download Presentation

Creating a pygame bundle

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Creating a pygame bundle • What is a bundle • activity.info • Activity Icon • activity.py • Custom Data • Saved Data • Rolling a bundle • Testing bundles

  2. Bundles • https://coderanger.net/svn/projects/olpc/games/Example.activity/ • MyGame.activity/ • activity/ • activity.info • activity-mygame.svg • data/ • sounds! images! music! • activity.py • mygame.py • ...

  3. Creating an Icon

  4. Creating an Icon • Option 1: Steal it

  5. Creating an Icon • Option 1: Steal it • Option 2: Create one • Create SVG (start with existing icon)‏ • Edit SVG to conform to specs • http://wiki.laptop.org/go/Sugar_Icon_Format

  6. [Activity] name = My Game activity_version = 1 host_version = 1 service_name = org.yourgroup.olpc.MyGame icon = activity-mygame class = activity.MyGameActivity activity.info

  7. import olpcgames class MyGameActivity(olpcgames.PyGameActivity): """An example of using a Pygame game as a Sugar activity.""" game_name = 'mygame' # Alternately, #game_name = 'mygame:mymainfunction' game_title = 'My Game' #game_size = (1200, 825)‏ activity.py

  8. No absolute path names! We can't know ahead of time where we are installed from olpcgames.util import data_pathfull_path = data_path(relativefilename)‏ Custom Data

  9. Saved Data

  10. Saved Data • Not Done Yet

  11. Saved Data • Not Done Yet • Just for now,import sugar.envos.path.join(sugar.env.get_profile_path(), 'mygame') • This will go away one the datastore is finished.

  12. Create the bundle • zip -r MyGame-[version].xo MyGame.activity

  13. Testing Bundles • Changed activity.info? • restart X • Activity launched successfully? • kill the sugar-activity-factory • Developer mode: alt - = • /home/olpc/.sugar/default/logs • A better way:$ sugar-activity “My Game”

  14. Getting Help • #olpc-gamejam • I'm 'ywwg'

More Related