#πŸ”’ Animation won't play

16 messages Β· Page 1 of 1 (latest)

topaz jay
#

In class Player in an update function I made it so an image is supposed to change after some time but id doesnt want to. Can anyone help

crimson skiffBOT
crimson skiffBOT
#

@topaz jay

Python help channel opened

Remember to:

  • Ask your Python question, not if you can ask or if there's an expert who can help.
  • Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
  • Explain what you expect to happen and what actually happens.

:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.

severe sparrow
#

Try adding logging or some print statements to check the code flow and why it is not triggering the block of code you want

arctic siren
topaz jay
arctic siren
# topaz jay oooooh bruh. Thanks for pointing it out

When debugging something like this, besides the logging the other person suggested (logging counter, the main variable involved, would have pointed out the problem), look at each line of the function and say what its purpose is. If you had done that for the update function, you would have said "reset self.counter to 0" on the second line in, and that may have tipped you off.

#

This is typicaly called "rubber duck debugging".

topaz jay
arctic siren
#

You're welcome.

#

@topaz jay FYI, all the global statements you're using are unnecessary.

topaz jay
arctic siren
#

Ok, I just thought I'd point that out. A lot of people misunderstand how global works.

topaz jay
crimson skiffBOT
#
Python help channel closed for inactivity

This help channel has been closed. Feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.