Now, it's late, I'm in Finland & EET time zone you see, and I'd like others to review the code before I suggest you mention this in the docs, or somewhere. I actually thought I'd edit the online docs to mention this little thing, but I didn't manage to figure the markup out in time. Maybe this should go in the Wiki instead. It's not like it's a key issue for a lot of folks.
But! It's not fun if you write code that then breaks with other versions of LÖVE where this typo either exists or is fixed. Just to make sure everyone can avoid this little bit of embarrassment, it's useful to have something like this around. This way you can call the properly spelled method anywhere with no worries.
But have a look at it first, please. I'm a bit tired now. Also, sorry for pegging the CPU with no framerate limit, unless you have vsync on. Then it might look a bit choppy because the physics step 1/60 secs which is also a typical vsync rate. To get smooth physics with low framerate you probably need to interpolate between frames and all that jazz. I'm not in the mood now.
The ideal solution would probably be to create one polygon shape and one circle shape once in love.load and then fix their metatables right there. There's no need to use those boolean vars as in my code, but I wanted to be explicit that you only need to mess with two types of metatables once and then the fix stays in place. I am not sure about every detail though! E.g. if you destroy the world, do the metatables get reset when you make another?
Anyway, too much ado about a little typo that is fixed in the SVN already. Pay no mind if you are not going to use getRestitution a lot! But you can play with the little shapes you can make by clicking the mouse buttons no matter what.
Code: Select all
Code removed. Please see the posting later in this thread for a later version.