google-code-export / gummworld2

Automatically exported from code.google.com/p/gummworld2
Other
2 stars 0 forks source link

Support for more recent pymunk #22

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Please add support for a more recent pymunk version. I don't know where it 
became broken but version 3.0.0 is definitely incompatible with the engine and 
the examples. 

Removing the pymunk.init_pymunk() in __init__.py lets it at least start up, but 
there seem to be other issues at least in 08_pymunk_motion.py:

D:\personal\Projects\gummworld2\examples>08_pymunk_motion.py
Loading chipmunk for Windows (32bit) [C:\Python27\lib\site-packages\pymunk\chipm
unk.dll]
gummworld2 v0.4.1 loading...
tiledtmxloader loading ...
DEBUG:tiledtmxloader:tiledtmxloader.tiledtmxloader loading ...
tiledtmxloader loaded: 0.047000s
gummworld2 v0.4.1 loaded
Engine: -- new engine --
Engine: Screen(resolution, display_flags)
Engine: using pre-made map
Engine: WorldPymunk(self.map.rect)
Initializing cpSpace - Chipmunk v6.1.1 (Debug Enabled)
Compile with -DNDEBUG defined to disable debug mode and runtime assertion checks

Engine: making camera target CircleBody()
Engine: making camera view from screen
Engine: making camera
Engine: creating GameClock
Engine: copying my objects to State
CONTEXT: pushing App
CONTEXT: enter App
Traceback (most recent call last):
  File "D:\personal\Projects\gummworld2\examples\08_pymunk_motion.py", line 190,
 in <module>
    gummworld2.run(app)
  File "D:\personal\Projects\gummworld2\gamelib\gummworld2\engine.py", line 458,
 in run
    State.clock.tick()
  File "D:\personal\Projects\gummworld2\gamelib\gummworld2\gameclock.py", line 2
78, in tick
    self._run_schedules()
  File "D:\personal\Projects\gummworld2\gamelib\gummworld2\gameclock.py", line 3
76, in _run_schedules
    self.update_callback(self.dt_update)
  File "D:\personal\Projects\gummworld2\gamelib\gummworld2\engine.py", line 358,
 in _update
    self.update(dt)
  File "D:\personal\Projects\gummworld2\examples\08_pymunk_motion.py", line 106,
 in update
    self.update_camera_position(dt)
  File "D:\personal\Projects\gummworld2\examples\08_pymunk_motion.py", line 148,
 in update_camera_position
    camera.slew(Vec2d(wx,wy), dt)
  File "D:\personal\Projects\gummworld2\gamelib\gummworld2\camera.py", line 174,
 in slew
    self.target.slew(vec, dt)
AttributeError: 'CircleBody' object has no attribute 'slew'

Original issue reported on code.google.com by g.threep...@gmail.com on 11 Jun 2013 at 6:11

GoogleCodeExporter commented 9 years ago
The incompatibility is in pymunk. The newer version removed slew() from the 
API. At one time I thought I would like to use pymunk--primarily for collision 
detection and non-rectangular objects--but I never found a project for it. It 
is easy enough to integrate a custom "world" (model) into gummworld2, and 
pymunk already has a complete API.

What this decision boils down to, I think: Without a real personal need, I 
don't feel I could improve upon the pymunk API, nor keep up with compatibility. 
The model is an aspect that has not matured in gummworld2. I have just used 
collections or the included SpatialHash, and a custom update routine.

Original comment by stabbing...@gmail.com on 12 Aug 2013 at 2:12