while running:
screen.blit(background,(0,0))
screen.blit(game.warrior.image, game.warrior.rect)
screen.blit(game.shooter.image, game.shooter.rect)
game.warrior.update_health_bar(screen)
game.shooter.update_health_bar(screen)
game.shooter.update_jump()
for projectile in game.warrior.all_projectile:
projectile.move()
for projectile in game.shooter.all_projectile:
projectile.move()
game.warrior.all_projectile.draw(screen)
game.shooter.all_projectile.draw(screen)
if game.pressed.get(pygame.K_RIGHT) and game.shooter.rect.x + game.shooter.rect.width < 585:
game.shooter.move_right()
elif game.pressed.get(pygame.K_LEFT) and game.shooter.rect.x > 0:
game.shooter.move_left()
if game.pressed.get(pygame.K_UP) :
game.shooter.jump()
print(game.shooter.rect.y)
if game.pressed.get(pygame.K_e) :
game.warrior.jump()
if game.pressed.get(pygame.K_f) and game.warrior.rect.x + game.warrior.rect.width < screen.get_width():
game.warrior.move_right()
elif game.pressed.get(pygame.K_s) and game.warrior.rect.x > 0:
game.warrior.move_left()
Bonjour, j'ai modifié le titre de votre sujet, en effet les titres avec 'problème' ne sont pas tolérés.
saut réaliste avec Pygame
× Après avoir cliqué sur "Répondre" vous serez invité à vous connecter pour que votre message soit publié.
× Attention, ce sujet est très ancien. Le déterrer n'est pas forcément approprié. Nous te conseillons de créer un nouveau sujet pour poser ta question.