-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change trigger of Step 0 workflow (#137)
`create` -> `push` to `main`
- Loading branch information
1 parent
eb258a9
commit b4773f8
Showing
1 changed file
with
3 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 comments
on commit b4773f8
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hello
import pygame
import sys
import random
Initialize Pygame
pygame.init()
Set up the game window
width, height = 800, 600
screen = pygame.display.set_mode((width, height))
pygame.display.set_caption("Move the Player Game with Obstacles")
Set up colors
WHITE = (255, 255, 255)
RED = (255, 0, 0)
GREEN = (0, 255, 0)
Player settings
player_width, player_height = 50, 50
player_x, player_y = width // 2, height // 2
player_speed = 5
Obstacle settings
obstacle_width, obstacle_height = 60, 60
obstacle_x = random.randint(0, width - obstacle_width)
obstacle_y = random.randint(0, height - obstacle_height)
Game loop flag
running = True
Game loop
while running:
# Handle events
for event in pygame.event.get():
if event.type == pygame.QUIT:
running = False # Exit the game
Quit the game
pygame.quit()
sys.exit()