[Dev] unintended consequence of canonizing slashes in asset names
Brian Fisher
brian at hamsterrepublic.com
Tue Mar 25 21:56:38 PDT 2008
I understand why it's happening now (a derived class of Movement,
VelocityMovement is using the speed property as an AssetRef, so the
problem is on the base class init), but I don't understand what the
code is trying to achive - does it make sense for speed to do double
duty as an int and as a reference to an asset object of a speed style?
Does it make sense for a SpeedStyle object to be passed to Direction's
go function, when the function appears to expect a scalar distance?
or to put another way - is this really just exposing a code bug in sidescroller?
On Tue, Mar 25, 2008 at 7:26 PM, James Paige <Bob at hamsterrepublic.com> wrote:
> james at doomtrain:~/src/mhgames/sidescroller$ python sidescroller.py
> Traceback (most recent call last):
> File "sidescroller.py", line 101, in <module>
> game = SideScroller()
> File "sidescroller.py", line 44, in __init__
> self.camera = Camera(0, 0, self.screen_width, self.screen_height)
> File "/home/james/src/mhgames/sidescroller/camera.py", line 14, in
> __init__
> self.move = VelocityMovement(self, "camera")
> File "/home/james/src/mhgames/sidescroller/movement.py", line 118, in
> __init__
> Movement.__init__(self, vector)
> File "/home/james/src/mhgames/sidescroller/movement.py", line 104, in
> __init__
> self.speed = speed
> File "/usr/lib/python2.5/site-packages/motherhamster/cheekpouches.py",
> line 436, in __set__
> value = value.replace("\\", "/")
> AttributeError: 'int' object has no attribute 'replace'
>
> ---
> James
> _______________________________________________
> Dev mailing list
> Dev at lists.motherhamster.org
> http://lists.motherhamster.org/listinfo.cgi/dev-motherhamster.org
>
More information about the Dev
mailing list