Oct-05-2017, 06:18 PM
(Oct-05-2017, 05:45 PM)DeaD_EyE Wrote: In line 38 you define the attribute sneek_width without any effect, because it's not bound to the instance nor to the class. In line 44 you define a method sneek_width of the class snek. Later you try to divide an integer with an instance method. You've forgotten to call the instance method.
But from where comes get_width? It looks for me like brute force programing with copied and pasted code.
I'm really new to python, so I was following a tutorial about how to use collision detection, but I already had been writing my own code, so I tried to implement collision detection into my code based on the code in the tutorial. How do I bind it to the instance or class? How do I call the instance method? Sorry about the stupid questions. I'm a noob.