keys[pygame.K_DOWN] and player.rect.y < SCREEN_HEIGHT - player.rect.height: player.rect.y += PLAYER_SPEED if keys[pygame.K_LEFT] and player.rect.x > 0: player.rect.x -= PLAYER_SPEED if keys[pygame.K_RIGHT] and player.rect.x < SCREEN_WIDTH - player.rect.width: player.rect.x += PLAYER_SPEED # 当たり判定 if player.rect.colliderect(enemy.rect): running = False if player.rect.colliderect(goal.rect): running = False # 画面描画 screen.fill(BLACK) screen.blit(player.image, player.rect) screen.blit(enemy.image, enemy.rect) screen.blit(goal.image, goal.rect) pygame.display.update() clock.tick(FPS) # ゲーム終了 pygame.quit()
*This prompt didn't get me into the game this time. Plz try to generate it a few times.