Badishhh
Sarajevo, Federation of Bosnia and Herzego, Bosnia and Herzegovina
free palestine
trust me [matias.ma]
free palestine
trust me [matias.ma]
Currently Offline
Favorite Game
2,918
Hours played
1
Achievements
𓅪
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()
Recent Activity
218 hrs on record
last played on 21 Dec, 2025
1.6 hrs on record
last played on 12 Dec, 2025
4.8 hrs on record
last played on 13 Jul, 2025
ewqfi67113 15 Aug, 2025 @ 1:14am 
😡
Braca 31 Mar, 2025 @ 6:07am 
bih
Ambol The Not Silly Cat 20 Jan, 2025 @ 3:31pm 
+rep bot
kwakwa 20 Nov, 2024 @ 10:41am 
+rep, very good mate
sxvxxkxn 11 Nov, 2024 @ 8:22am 
гашиш
ENDorfin 8 Nov, 2024 @ 8:43am 
+REP