moyizuyik-
Japan
 
 
:picaroon:
trust me [matias.ma]
Právě je offline
Oblíbená hra
𓅪
import pygame
import sys
import random

pygame.init()

WIDTH, HEIGHT = 400, 600
screen = pygame.display.set_mode((WIDTH, HEIGHT))
pygame.display.set_caption("Floppy Bird")

WHITE = (255, 255, 255)
BLACK = (0, 0, 0)
GREEN = (0, 255, 0)

bird_x, bird_y = 100, HEIGHT // 2
bird_radius = 15
gravity = 0.5
bird_velocity = 0
jump_strength = -10

pipe_width = 50
pipe_gap = 150
pipe_speed = 5
pipes = []
score = 0

clock = pygame.time.Clock()
font = pygame.font.SysFont("Arial", 30)

def create_pipe():
y = random.randint(100, HEIGHT - 100 - pipe_gap)
pipes.append((WIDTH, y))

create_pipe()

def draw_pipes():
for pipe_x, pipe_y in pipes:
pygame.draw.rect(screen, GREEN, (pipe_x, 0, pipe_width, pipe_y))
pygame.draw.rect(screen, GREEN, (pipe_x, pipe_y + pipe_gap, pipe_width, HEIGHT))

def move_pipes():
global score
for i, (pipe_x, pipe_y) in enumerate(pipes):
pipes = (pipe_x - pipe_speed, pipe_y)

if pipes and pipes[0][0] + pipe_width < 0:
pipes.pop(0)
create_pipe()
score += 1

def check_collision():
for pipe_x, pipe_y in pipes:
if (bird_x + bird_radius > pipe_x and bird_x - bird_radius < pipe_x + pipe_width and
(bird_y - bird_radius < pipe_y or bird_y + bird_radius > pipe_y + pipe_gap)):
return True
if bird_y - bird_radius < 0 or bird_y + bird_radius > HEIGHT:
return True
return False

running = True
while running:
screen.fill(WHITE)

for event in pygame.event.get():
if event.type == pygame.QUIT:
pygame.quit()
sys.exit()
if event.type == pygame.KEYDOWN and event.key == pygame.K_SPACE:
bird_velocity = jump_strength

bird_velocity += gravity
bird_y += bird_velocity

move_pipes()

pygame.draw.circle(screen, BLACK, (bird_x, bird_y), bird_radius)
draw_pipes()

if check_collision():
running = False

score_text = font.render(f"Score: {score}", True, BLACK)
screen.blit(score_text, (10, 10))

pygame.display.flip()
clock.tick(30)

screen.fill(WHITE)
game_over_text = font.render("Game Over!", True, BLACK)
screen.blit(game_over_text, (WIDTH // 2 - 100, HEIGHT // 2 - 20))
final_score_text = font.render(f"Final Score: {score}", True, BLACK)
screen.blit(final_score_text, (WIDTH // 2 - 100, HEIGHT // 2 + 20))
pygame.display.flip()
pygame.time.wait(3000)
pygame.quit()
Nedávná aktivita
2 879 hodin celkem
Naposledy hráno 8. bře.
39 hodin celkem
Naposledy hráno 8. bře.
0,2 hodin celkem
Naposledy hráno 18. úno.
Not Silly Ambol 20. led. v 15.31 
+rep bot
kwakwa 20. lis. 2024 v 10.41 
+rep, very good mate
zxdhhkk 11. lis. 2024 v 8.22 
гашиш
ENDorfin 8. lis. 2024 v 8.43 
+REP
Sandor Clegane 24. říj. 2024 v 10.33 
+rep friendly :)
小月光M1kasa· 4. úno. 2023 v 22.12 
💚💚💚💚/>  フ💚💚💚💚
     |  _  _|
     /`ミ _x 彡
     /      |
    /  ヽ   ノ
 / ̄|   | | |
 | ( ̄ヽ__ヽ_)_)
 \二つ加我兄弟