undercase / FlappyKivy

Flappy Bird clone programming in Python + Kivy!
MIT License
69 stars 14 forks source link

AttributeError: 'NoneType' object has no attribute 'normal_velocity' #1

Closed livibetter closed 10 years ago

livibetter commented 10 years ago

I don't really know how to run FlappyKivy, first time trying Kivy, I got this error with both Python 2.7 and 3.3 using ac253fc34170fd4b605d3a8dd347536fdf52f5c9:

$ python3 FlappyBird.py
[INFO              ] Kivy v1.8.0
[INFO              ] [Logger      ] Record log in /home/livibetter/.kivy/logs/kivy_14-05-08_7.txt
[INFO              ] [Factory     ] 157 symbols loaded
[DEBUG             ] [Cache       ] register <kv.image> with limit=None, timeout=60s
[DEBUG             ] [Cache       ] register <kv.atlas> with limit=None, timeout=Nones
[INFO              ] [Image       ] Providers: img_tex, img_dds, img_pygame, img_pil, img_gif
[DEBUG             ] [Cache       ] register <kv.texture> with limit=1000, timeout=60s
[DEBUG             ] [Cache       ] register <kv.shader> with limit=1000, timeout=3600s
[DEBUG             ] [Cache       ] register <kv.lang> with limit=None, timeout=Nones
[DEBUG             ] [Cache       ] register <kv.loader> with limit=500, timeout=60s
[INFO              ] [Loader      ] using a thread pool of 2 workers
[DEBUG             ] [App         ] Loading kv <./flappybird.kv>
[DEBUG             ] [App         ] kv <./flappybird.kv> not found
[DEBUG             ] [Window      ] Ignored <egl_rpi> (import error)
[INFO              ] [Window      ] Provider: pygame(['window_egl_rpi'] ignored)
libpng warning: iCCP: Not recognizing known sRGB profile that has been edited
[DEBUG             ] [Window      ] Display driver x11
[DEBUG             ] [Window      ] Actual window size: 800x600
[DEBUG             ] [Window      ] Actual color bits r8 g8 b8 a0
[DEBUG             ] [Window      ] Actual depth bits: 24
[DEBUG             ] [Window      ] Actual stencil bits: 8
[DEBUG             ] [Window      ] Actual multisampling samples: 2
[INFO              ] [GL          ] OpenGL version <b'2.1 Mesa 10.0.4'>
[INFO              ] [GL          ] OpenGL vendor <b'X.Org R300 Project'>
[INFO              ] [GL          ] OpenGL renderer <b'Gallium 0.4 on ATI RV515'>
[INFO              ] [GL          ] OpenGL parsed version: 2, 1
[INFO              ] [GL          ] Shading version <b'1.20'>
[INFO              ] [GL          ] Texture max size <4096>
[INFO              ] [GL          ] Texture max units <16>
[DEBUG             ] [Shader      ] Fragment compiled successfully
[DEBUG             ] [Shader      ] Vertex compiled successfully
[DEBUG             ] [ImagePygame ] Load </usr/lib64/python3.3/site-packages/kivy/data/glsl/default.png>
[INFO              ] [Window      ] virtual keyboard not allowed, single mode, not docked
 Traceback (most recent call last):
   File "FlappyBird.py", line 160, in <module>
     FlappyBirdApp().run()
   File "/usr/lib64/python3.3/site-packages/kivy/app.py", line 766, in run
     root = self.build()
   File "FlappyBird.py", line 155, in build
     game = FlappyBirdGame()
   File "FlappyBird.py", line 101, in __init__
     self.mcnay.normal_velocity = [0, -4]
 AttributeError: 'NoneType' object has no attribute 'normal_velocity'
vlinhart commented 10 years ago

@livibetter have a look at my pull request, had the same issue as you, now it works with the patch

undercase commented 10 years ago

Sorry about that, it seems that on the latest Kivy build (the current Linux one), you can't make empty class-level Object Properties anymore.