Pygame Beginner Tutorial in Python - PART 1 || Bricks Game Design

preview_player
Показать описание
This is a small game development project. The source code of this project is given below (Some youtube restrictions, greater than, less than symbol written in word Press like and subscribe button for more game development video):

............................................................................................................................
import pygame, os, sys

black=pygame.Color(0,0,0)

playerY = 580
mousex, mousey = (0, playerY)
mousex = 0
mousey = playerY

ballStartY=200
ballSpeed=3
ballServed=False
bx,by=(24,ballStartY)
sx,sy=(ballSpeed,ballSpeed)

bricks=[]
for y in range(5):
brickY=(y*24)+100
for x in range(10):
brickX=(x*31)+245
rect=Rect(brickX, brickY, width,height)

while True:


for b in bricks:





if(mousex less than 800-55):
else:


if ballServed:
bx+=sx
by+=sy
ballServed=True

if(by less than=0):
by=0
sy*=-1

if(by greater than=600-8):
ballServed=False
bx,by=(24,ballStartY)
ballSpeed=3
sx,sy=(ballSpeed,ballSpeed)
by=600-8
sy*=-1

if(bx less than=0):
bx=0
sx*=-1

if(bx greater than=800-8):
bx=800-8
sx*=-1




by=playerY-40
sy*=-1


if brickHitIndex greater than=0:
hb=bricks[brickHitIndex]
mx=bx+4
my=by+4
sx*=-1
else:
sy*=-1
del(bricks[brickHitIndex])






............................................................................................................................

Subscribe:

#Python #PythonProject #ProjectForStudents #Pygame #Pygametutorial #Pygameprojects #python2021 #pythongame #gamedevelopment #bricksgame #latest #trends
Рекомендации по теме
welcome to shbcf.ru