Fix for See You Later

Got this while trying to jump into the second time machine:

  File "/Local/Games/PyWeek12/Unpack/see_you_later/main.py", line 310, in set_view_position
    y1 = contoller.view_height - 2048
NameError: global name 'contoller' is not defined

Fix is to change contoller to controller.

(log in to comment)

Comments

Another problem after getting 3 babies on the pink bridge and then trying to walk onto it myself:

  File "/Local/Games/PyWeek12/Unpack/see_you_later/main.py", line 257, in baby_collision
    baby = arbiter.shapes[0].object()
AttributeError: 'NoneType' object has no attribute 'object'

A patch that seems to stop it from happening:

--- main.orig.py    2011-04-18 10:27:08.000000000 +1200
+++ main.py    2011-04-18 12:53:02.000000000 +1200
@@ -254,7 +254,10 @@
 
     def baby_collision(self, space, arbiter, *args, **kwargs):
         if not arbiter.is_first_contact: return
-        baby = arbiter.shapes[0].object()
+        shape = arbiter.shapes[0]
+        if not shape:
+            return
+        baby = shape.object()
         if baby.state == 'crawl_right':
             direction = Vec2d(1,0)
         elif baby.state == 'crawl_left':

A problem in windows

Trying to run without changes gives me the dreaded pyglet 1.2dev ATI problem (issue 483), crash at pyglet initialization. I know that this particular crash can be avoided with newer drivers, but there are other problems (see the issue for details)

renamed the pyglet dir included in the game package to let my copy of pyglet 1.1.4 be found.

Then got traceback


File "E:\tmp\pyweek12\see_you_later\run_game.py", line 3, in <module>
run_game()
File "E:\tmp\pyweek12\see_you_later\main.py", line 581, in run_game
window = MainWindow()
File "E:\tmp\pyweek12\see_you_later\main.py", line 20, in __init__
self.start_game(1)
File "E:\tmp\pyweek12\see_you_later\main.py", line 42, in start_game
self.game_controller = GameController(self, self.num_babies)
File "E:\tmp\pyweek12\see_you_later\main.py", line 363, in __init__
self.map = GameMap(window)
File "E:\tmp\pyweek12\see_you_later\main.py", line 183, in __init__
self.load_background_tiles()
File "E:\tmp\pyweek12\see_you_later\main.py", line 213, in load_background_til
es
tile = make_sprite(path + os.sep + name)
File "E:\tmp\pyweek12\see_you_later\util.py", line 32, in make_sprite
image = pyglet.resource.image(filename)
File "D:\hg_externals\pyglet-1.1.4\pyglet\resource.py", line 492, in image
identity = self._cached_images[name] = self._alloc_image(name)
File "D:\hg_externals\pyglet-1.1.4\pyglet\resource.py", line 436, in _alloc_im
age
file = self.file(name)
File "D:\hg_externals\pyglet-1.1.4\pyglet\resource.py", line 394, in file
raise ResourceNotFoundException(name)
pyglet.resource.ResourceNotFoundException: Resource "bg\bg_0_0.png" was not foun
d on the path. Ensure that the filename has the correct captialisation.


The problem is line 213 in main, changing from
    tile = make_sprite(path + os.sep + name)
to
    tile = make_sprite(path + '/' + name) 

fixed the problem

Note that resource *names* in pyglet uses the unix slash in any OS; it is analog to the relation 
path <-> URL 
you don't change URL slashes when changing OS

This was standard pyglet from at least 1.1.2, so probably the ones running in windows with the included pyglet will found the same problem.
 
Thanks, both of you.  I added the changes to my googlecode repository here

http://code.google.com/p/see-you-later/
Now I don't seem to be able to get more than 5 babies before Chipmunk crashes on me with a Bus Error somewhere in cpArbiterPreStep. Looks like this one will require some serious debugging.
I think this is because I was incorrectly trying to remove the bridge during a collision callback.  I've added a fix for this and I think I've got it working with pymunk 1.0 now.  But there's not really much more game for you to see if you already have 5 babies.
I was certainly getting a lot of crashes around the bridge area, but I also got one after having opened the door in the toadstool and then jumping onto the lever beyond.

Anyhow, I've now succeeded in breaking the bridge, but got myself stuck by jumping down there without having enough babies to proceed, and now I can't climb out again.

Is it worth starting over, or have I seen all there is to see? Is it possible to reach 9 babies (I guess that would have been the ultimate goal)?
No, that's about it unfortunately.  I messed up the placement of the time machine under the bridge, so it actually is just a cardboard box.  I had a particular ending in mind for the game, but only made it about halfway there.
Hope you can finish it later -- it has the makings of a great game!