commit:ecd308b1d0473e781737eef4544e4d51a94ad74b
author:Chip Black
committer:Chip Black
date:Sun Jul 27 15:44:12 2008 -0500
parents:c198192398ad49ffae0e53eb37692b23a66acadb
Changed level YAML format to add arbitrary top-level properties and put
the layers list in a 'level' property. Enabled platformtest Camera bbox
bits.
diff --git a/levels/example1/level.yaml b/levels/example1/level.yaml
line changes: +27/-25
index e7721f2..1275984
--- a/levels/example1/level.yaml
+++ b/levels/example1/level.yaml
@@ -1,29 +1,31 @@
-- name: main
-  collage: example1
-  surfaces: example1
-  things:
+bbox: [0, 0, 1216, 480]
+layers:
+  - name: main
+    collage: example1
+    surfaces: example1
+    things:
 
-    player:
-      class: RichterActor
-      properties: {position: [64,64]}
-      events:
-        collide(self, obj): |
-          if obj == zombie1:
-          	print "ZOMBIE!"
-        enterRegion(self, region): |
-          print "region"
+      player:
+        class: RichterActor
+        properties: {position: [64,64]}
+        events:
+          collide(self, obj): |
+            if obj == zombie1:
+            	print "ZOMBIE!"
+          enterRegion(self, region): |
+            print "region"
 
-    candelabra:
-      class: Candelabra
-      properties: {position: [64,64]}
+      candelabra:
+        class: Candelabra
+        properties: {position: [64,64]}
 
-    zombie1:
-      class: Zombie
-      properties: {position: [512, 64]}
-      events:
-        collide(self, obj): |
-          print "GRAAAR!", obj
+      zombie1:
+        class: Zombie
+        properties: {position: [512, 64]}
+        events:
+          collide(self, obj): |
+            print "GRAAAR!", obj
 
-- name: stars
-  parallax: 0.25
-  collage: stars
+  - name: stars
+    parallax: 0.25
+    collage: stars

diff --git a/platformtest.py b/platformtest.py
line changes: +5/-5
index 29771d8..0643406
--- a/platformtest.py
+++ b/platformtest.py
@@ -20,7 +20,7 @@ Engine.drawers.append(l.draw)
 player = l.env['player']
 
 camera = Camera(l)
-#camera.setBbox(l.bbox)
+camera.setBbox(l.bbox)
 Engine.updaters.append(camera.update)
 camera.setFocus(player)
 
@@ -34,10 +34,10 @@ def input(e):
 			player.jump()
 		elif e.key == pygame.K_1:
 			l.toggleDrawSurfaces()
-		#elif e.key == pygame.K_2:
-		#	camera.clearBbox()
-		#elif e.key == pygame.K_3:
-		#	camera.setBbox(l.bbox)
+		elif e.key == pygame.K_2:
+			camera.clearBbox()
+		elif e.key == pygame.K_3:
+			camera.setBbox(l.bbox)
 		elif e.key == pygame.K_ESCAPE:
 			Engine.stop()
 	elif e.type == pygame.KEYUP: