Please post code in code tags instead of uploading an attachment. It makes it a pain to view in a phone
Your traceback shows that lives is not an int as expected.Your move method returns an int only if thr if condition is met, so I suspect one time it is not met, and returning None. Functions return None if nothing else is returned.
Also in pygame you can clamp a rect to the screen
rect nullifying any code to restrict thr object from going out of screen with a one liner.
Your traceback shows that lives is not an int as expected.Your move method returns an int only if thr if condition is met, so I suspect one time it is not met, and returning None. Functions return None if nothing else is returned.
Also in pygame you can clamp a rect to the screen
rect nullifying any code to restrict thr object from going out of screen with a one liner.
Recommended Tutorials: