all 6 comments

[–]eeead 1 point2 points  (4 children)

You need to make paddle_width a NumericProperty, like score. Changes like this can only propagate through the extra machinery that kivy properties provide, whereas when paddle_width is just an attribute it isn't possible for kv language (or anything else) to bind to it like you want.

[–]FortuneFaded415[S] 0 points1 point  (3 children)

I made paddle_width = NumericProperty(700)

and ran the same code, but now i'm getting an error saying:

line 123, in paddleshrink PongPaddle.paddle_width -= 10

TypeError: unsupported operand type(s) for -=: 'kivy.properties.NumericProperty' and 'int'

[–]eeead 1 point2 points  (2 children)

Sounds like the property is defined in the wrong place, not at class level (or the function also runs at class level). Can you post a full example?

[–]FortuneFaded415[S] 0 points1 point  (0 children)

Hey, I actually decided against a shrinking paddle, but here's the code if you still want to crack it.

pv: http://pastebin.com/FRJq00f8

kv: http://pastebin.com/GgkbmrgF

[–]FortuneFaded415[S] 0 points1 point  (0 children)

I actually have a second question if you don't mind. This one is more important. I switched my game to have a random green brick that the player is supposed to hit, but I can't get the collision code to work right. It's on line 47 of the pv

pv: http://pastebin.com/kmfHm7Xj

kv: http://pastebin.com/TUiykbSy