flappy bird
Drop files here
or click to upload
import streamlit as st
import pygame
import sys
st.title('Flappy Bird Game')
# Initialize Pygame
def init_game():
pygame.init()
screen = pygame.display.set_mode((400, 600))
return screen
# Game function
def run_game(screen):
clock = pygame.time.Clock()
while True:
for event in pygame.event.get():
if event.type == pygame.QUIT:
pygame.quit()
sys.exit()
screen.fill((135, 206, 235)) # Fill background
pygame.display.flip()
clock.tick(60)
# Button to start the game
if st.button('Start Game'):
screen = init_game()
run_game(screen)
Hi! I can help you with any questions about Streamlit and Python. What would you like to know?