Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    1. COHey, thanks for the answer, `tempballVelocity` is global because I can't get it to work if it's not a global. I changed the second `if` to an `elif` and removed the global but the problem remains. So is what you're saying.. because I'm creating `tempBallVelocity` inside an if statement, it will be deleted once that if statement is completed? If so, do you know how I could work around this? I tried creating `tempBallVelocity` outside of the method and passing it as a parameter, but `_on_keyboard_down` can only take 5 arguments, hence that method won't work. Any ideas?
      singulars
    2. COYes, the variable is no longer accessible outside of the block. Just try to add `tempBallVelocity = 0` before the first `if`. If you want the variable to be persistent between calls you need to make it an instance variable using `self.tempBallVelocity` and initialize it in the `__init__` function.
      singulars
    3. COWonderful, the former didn't work, however the latter worked. I appreciate it, Thank you. Now All I need to do is try and get the pause and unpause working by only using one button. I've tried it by doing nesting if statements, but what happens is that the first if statement will execute, and this will enable `paused` = `true`, but the NEXT if statement checks if paused and as such it unpauses it at the exact same time. I've also tried it with a while loop but the same thing happens. Do you think it would be wisest to make a new question or update my existing one?
      singulars
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload