'I think I might have found a bug in Pygame?
I am currently creating a snake game and if I go to the settings I got 3 Buttons. One for the sound volume, one for the back to menu and the one which creates the speed of the game.
The speed button is the problem one, because if I click on it it is flickering, even if I am not filling the screen (normally I do fill the screen I just made that to test it). The speed of flickering gets faster if I increase the FPS but the flickering isn't evenly spaced.
If I am not filling the screen, the volume button stuff obviously works as expected so it's not getting deleted after I moved it, but the speed button doesn't care, it's just flickering all day long.
I am actually able to close the Button again (so it's not flickering anymore) even if the screen isn't filling up.
Is there any way to fix the flickering?
def difficulty(self):
global difficult
difficult = True
def Update_difficulty(self):
self.draw( )
self.check_click_difficulty( )
def check_click_difficulty(self):
global game_speed, difficult
mouse_pos = pygame.mouse.get_pos()
if self.top_rect.collidepoint(mouse_pos):
self.top_color = "Blue"
if pygame.mouse.get_pressed()[0]:
self.dynamic_elevaition = 0
self.pressed = True
self.difficulty( )
return
else:
if self.pressed == True:
self.dynamic_elevaition = self.elevaition
self.pressed = False
if self.button_down[-1] == 2:
self.button_down.append(1)
difficult = False
self.list.append(self.user_input)
self.user_input = int(self.user_input)
if isinstance(self.user_input,str):
self.list = [0]
self.user_input = "0"
game_speed -= int(self.list[-1])
pygame.time.set_timer(SCRREEN_UPDATE,game_speed)
self.list = [0]
self.user_input = "0"
return game_speed
if self.button_down[-1] == 1:
self.button_down.append(2)
difficult = True
return
def text_input(self):
for event in events:
if event.type == pygame.KEYDOWN:
if event.key == pygame.K_BACKSPACE:
self.user_input = self.user_input[0:-1]
else:
self.user_input += event.unicode
pygame.draw.rect(screen,"Black", self.input_rect,4)
font_text = self.text_font.render(str("Speed: " + self.user_input), True, "White")
screen.blit(font_text, (self.input_rect.x + 10, self.input_rect.y + 10))
(while loop)
.....
if game_over and settings:
screen.fill((0, 0, 100))
font_go = pygame.font.SysFont("Calibri", 100, True, False)
settings_text = font_go.render("Settings", True, "White")
screen.blit(settings_text,[screen_width // 2 - screen_width // 2.5,100])
button_back_home.Update_back_home()
for event in events:
main_game.Quit(event)
button_difficulty.Update_difficulty()
button_volume.update_volume()
if difficult:
button_difficulty.text_input()
if volume_got_clicked:
volume.draw( )
FPS.tick(60)
pygame.display.flip()
Solution 1:[1]
an account with "reset user password permission" will be able to set or unset "change password at next logon" attribute.
And of course if this value is set, the user will still be able to login remotely with this password to exchange OWA (if used) and change his password at first login (which is preferred)
but if you have a problem instructing the user to login to OWA; you can schedule a script to list the accounts with "user must change password at next logon" and unset them automatically as follow
Get-ADUser -LDAPFilter "(pwdLastSet=0)" | where {$_.enabled -eq $true} | Set-ADUser -ChangePasswordAtLogon $false
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Mahmoud Moawad |
