Skip to content

Commit

Permalink
1.6.5.1
Browse files Browse the repository at this point in the history
Release 1.6.5.1
  • Loading branch information
JustRedTTG committed Dec 18, 2020
1 parent 68019d9 commit 283d48e
Show file tree
Hide file tree
Showing 52 changed files with 1,424 additions and 359 deletions.
16 changes: 16 additions & 0 deletions pygameextra/PKG-INFO
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
Metadata-Version: 2.1
Name: pygameextra
Version: 1.6.5.1
Summary: pygame extra is a mask for pygame, you can easily make complex games and or apps with much less lines then you would of before, Pygame Extra makes coding easier. The online documentation can be found at: https://pygame-extra.readthedocs.io/en/latest/
License: BSD-3-Clause
Author: RedstoneHair
Requires-Python: >=3.5
Classifier: License :: OSI Approved :: BSD License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.5
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Requires-Dist: pygame (>=1.9.6)
Requires-Dist: requests (>=2.22.0)
Binary file removed pygameextra/dist/pygameextra_pong-0.0.0-py3.8.egg
Binary file not shown.
Binary file removed pygameextra/dist/pygameextra_tester-0.0.0-py3.8.egg
Binary file not shown.
Binary file not shown.
Binary file not shown.
624 changes: 315 additions & 309 deletions pygameextra/__init__.py → pygameextra/pygameextra/__init__.py

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
#!/usr/bin/env python
#!/usr/bin/python3

print("PGE-pong, unstable!!!")
import pygameextra as pe
pe.init()
if True:
hit = pe.sound.load(pe.scriptpath + '/examples/pong/pong.ogg')
#SETUP \/
ballP = [[0,0]] * 20
ballP = [[0,0]] * 1
bot = False
botT = False
speed = 10
Expand All @@ -13,7 +15,7 @@ if True:
pe.display.make((1000,600), 'Pong')
playerS = 0
playerTS = 0
ballSO = [5,5]
ballSO = [4,4]
ballS = [1,1]
playerTR = pe.rect(0,250,15,100)
playerR = pe.rect(985,250,15,100)
Expand Down Expand Up @@ -107,7 +109,7 @@ if True:

def draw_all():
pe.fill.full(background)
pe.draw.line(pe.color.gray,(500,0,500,600),5)
pe.draw.line(pe.color.gray,(500,0),(500,600),5)
pe.text.display(scoreT[0])
pe.text.display(scoreT[1])
pe.draw.rect(white,playerR,0)
Expand All @@ -127,6 +129,7 @@ if True:
ballS[1] *= -1
if ballR.colliderect(playerR) or ballR.colliderect(playerTR):
ballS[0] *= -1
hit.play()
if ballR.left <= 0:
score[1] += 1
elif ballR.right >= 1000:
Expand Down Expand Up @@ -167,7 +170,7 @@ if True:
pe.button.rect((150,300,200,50),(200,200,200),(150,150,150),buttonBOTT,botmode,[True,True])
pe.button.rect((150+500,250,200,50),(200,200,200),(150,150,150),buttonPlayer,botmode,[False,False])
pe.display.update()
pe.time.tick(60)
pe.time.tick(120)
ballR.centerx = 500

#functions /\
Expand Down Expand Up @@ -196,9 +199,9 @@ if True:
move_players()
move_ball()
draw_all()
pe.time.tick(60)
pe.time.tick(120)
tick += 1
if tick >= 500:
if tick >= 200:
ballSO[0] += 0.1
ballSO[1] += 0.1
tick = 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ s2.pingpong = True # enable sprite pong
sO = 50 # set slider variable
sT = 50 # set slider variable
test = ""
testall = 0
testdrop = -100
lerplength = 100

# button function
Expand All @@ -71,10 +73,29 @@ def set_test(data):
pe.display.make((500, 500), "PGE Testing Utility", 1)
else:
pe.display.make((500, 500), "PGE Testing Utility", 0)


def set_lerplength(data):
global lerplength
lerplength = data

# Testing Texts
#testtext = [
# pe.text.quick.small("pe.rect", (250,250), layer=1), # 0
# pe.text.quick.small("pe.math.lerp", (250,250), layer=1), # 1
# pe.text.quick.small("pe.math.center", (250,250), layer=1), # 2
# pe.text.quick.small("pe.draw.rect", (250,250), layer=1), # 3
# pe.text.quick.small("pe.draw.circle", (250,250), layer=1), # 4
# pe.text.quick.small("pe.draw.line", (250,250), layer=1), # 5
# pe.text.quick.small("pe.draw.ellipse", (250,250), layer=1), # 6
# pe.text.quick.small("pe.sound.load", (250,250), layer=1), # 7
# pe.text.quick.small("pe.", (250,250), layer=1), # 8
# pe.text.quick.small("pe.", (250,250), layer=1), # 9
# pe.text.quick.small("pe.", (250,250), layer=1)
#]

# test functions
testscore = 0
# Main GAMELOOP
while True:
for pe.event.c in pe.event.get():
Expand Down Expand Up @@ -111,9 +132,33 @@ while True:
pe.draw.circle(pe.color.aqua, (125, 125), 40, 0)
pe.draw.rect(pe.color.red, (325, 75, 100, 100), 5)
pe.draw.rect(pe.color.aqua, (335, 85, 80, 80), 0)
pe.draw.line(pe.color.red, (0, 250, 250,500), 5)
pe.draw.line(pe.color.red, (250, 250, 0,500), 5)
pe.draw.line(pe.color.red, (0, 250), (250,500), 5)
pe.draw.line(pe.color.red, (250, 250), (0, 500), 5)
pe.draw.ellipse(pe.color.red, (250, 250, 250, 250))
elif test == "teststart":
pe.Layer[0][1] = (0, -100)
pe.E_intro.intro(0,pe.color.lightgray,pe.color.gray)
print("Performing test of all functions, please wait")
test = "testall"
elif test == "testall":
pe.Layer[0][1] = (0, -100)
pe.E_intro.intro(0, pe.color.lightgray, pe.color.gray)
pe.Layer[0][1] = (0, 0)
if testall >= len(testtext):
pe.Layer[0][1] = (0, testdrop+100)
testdrop += 100
pe.E_intro.intro(0, pe.color.lightgray, pe.color.gray)
pe.time.sleep(100)
if pe.Layer[0][1][1] >= 0:
pe.time.sleep(500)
pe.Layer[0][1] = (0, 0)
print("Use the testing GUI, to further test the result of functions!")
test = ""
else:
pe.text.display(testtext[testall])
dotest(testall)
testall += 1
pe.display.update()

if test == "":
pe.button.rect((0, 200, 100, 50), pe.color.white, pe.color.lightgray, bt[0], action=set_test, data="button")
Expand All @@ -127,6 +172,8 @@ while True:
if test != "":
if "math_" in test:
pe.button.rect((0, 0, 100, 50), pe.color.verydarkgray, pe.color.darkgray, bt[8], action=set_test, data="math")
elif test == "testall":
pass
else:
pe.button.rect((0, 0, 100, 50), pe.color.white, pe.color.lightgray, bt[2], action=set_test, data="")
#
Expand All @@ -152,16 +199,17 @@ while True:
lerp3 = pe.math.lerp((0,pe.display.get.size()[1]), mp, lerplength)
lerp4 = pe.math.lerp(pe.display.get.size(), mp, lerplength)

pe.draw.line(pe.color.red, (0, 0, mp[0], mp[1]), 5)
pe.draw.line(pe.color.red, (pe.display.get.size()[0], 0, mp[0], mp[1]), 5)
pe.draw.line(pe.color.red, (0, pe.display.get.size()[1], mp[0], mp[1]), 5)
pe.draw.line(pe.color.red, (pe.display.get.size()[0], pe.display.get.size()[1], mp[0], mp[1]), 5)
pe.draw.line(pe.color.red, (0, 0), mp, 5)
pe.draw.line(pe.color.red, (pe.display.get.size()[0], 0), mp, 5)
pe.draw.line(pe.color.red, (0, pe.display.get.size()[1]), mp, 5)
pe.draw.line(pe.color.red, (pe.display.get.size()[0], pe.display.get.size()[1]), mp, 5)

pe.draw.line(pe.color.white, (0,0,lerp1[0],lerp1[1]), 5)
pe.draw.line(pe.color.white, (pe.display.get.size()[0],0,lerp2[0],lerp2[1]), 5)
pe.draw.line(pe.color.white, (0,pe.display.get.size()[1],lerp3[0],lerp3[1]), 5)
pe.draw.line(pe.color.white, (pe.display.get.size()[0],pe.display.get.size()[1],lerp4[0],lerp4[1]), 5)
pe.draw.line(pe.color.white, (0,0), lerp1, 5)
pe.draw.line(pe.color.white, (pe.display.get.size()[0],0), lerp2, 5)
pe.draw.line(pe.color.white, (0,pe.display.get.size()[1]), lerp3, 5)
pe.draw.line(pe.color.white, (pe.display.get.size()[0],pe.display.get.size()[1]), lerp4, 5)
elif test == "math_center":
pe.draw.circle(pe.color.white, pe.math.center((0,0,pe.display.get.size()[0],pe.display.get.size()[1])), 5, 5)
pe.display.update()
if test != "testall":
pe.display.update()
pe.time.tick(200)
34 changes: 34 additions & 0 deletions pygameextra/pygameextra/colors.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
"""colors"""
red = (255, 0, 0)
darkred = (155, 0, 0)
verydarkred = (55, 0, 0)

green = (0, 255, 0)
darkgreen = (0, 155, 0)
verydarkgreen = (0, 55, 0)

blue = (0, 0, 255)
darkblue = (0, 0, 155)
verydarkblue = (0, 0, 55)

yellow = (255, 255, 0)
darkyellow = (155, 155, 0)
verydarkyellow = (55, 55, 0)

aqua = (0, 255, 255)
darkaqua = (0, 155, 155)
verydarkaqua = (0, 55, 55)

pink = (255, 0, 255)
darkpink = (155, 0, 155)
verydarkpink = (55, 0, 55)


white = (255, 255, 255)

black = (0, 0, 0)

lightgray = (200, 200, 200)
gray = (100, 100, 100)
darkgray = (50, 50, 50)
verydarkgray = (25, 25, 25)
Binary file not shown.
Binary file not shown.
File renamed without changes.
Binary file added pygameextra/pygameextra/examples/pong/pong.ogg
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
#!/usr/bin/env python

print("PGE-pong, unstable!!!")
import pygameextra as pe
pe.init()
if True:
hit = pe.sound.load(pe.scriptpath + '/examples/pong/pong.ogg')
#SETUP \/
ballP = [[0,0]] * 20
ballP = [[0,0]] * 1
bot = False
botT = False
speed = 10
Expand All @@ -13,7 +15,7 @@ if True:
pe.display.make((1000,600), 'Pong')
playerS = 0
playerTS = 0
ballSO = [5,5]
ballSO = [4,4]
ballS = [1,1]
playerTR = pe.rect(0,250,15,100)
playerR = pe.rect(985,250,15,100)
Expand Down Expand Up @@ -107,7 +109,7 @@ if True:

def draw_all():
pe.fill.full(background)
pe.draw.line(pe.color.gray,(500,0,500,600),5)
pe.draw.line(pe.color.gray,(500,0),(500,600),5)
pe.text.display(scoreT[0])
pe.text.display(scoreT[1])
pe.draw.rect(white,playerR,0)
Expand All @@ -127,6 +129,7 @@ if True:
ballS[1] *= -1
if ballR.colliderect(playerR) or ballR.colliderect(playerTR):
ballS[0] *= -1
hit.play()
if ballR.left <= 0:
score[1] += 1
elif ballR.right >= 1000:
Expand Down Expand Up @@ -167,7 +170,7 @@ if True:
pe.button.rect((150,300,200,50),(200,200,200),(150,150,150),buttonBOTT,botmode,[True,True])
pe.button.rect((150+500,250,200,50),(200,200,200),(150,150,150),buttonPlayer,botmode,[False,False])
pe.display.update()
pe.time.tick(60)
pe.time.tick(120)
ballR.centerx = 500

#functions /\
Expand Down Expand Up @@ -196,9 +199,9 @@ if True:
move_players()
move_ball()
draw_all()
pe.time.tick(60)
pe.time.tick(120)
tick += 1
if tick >= 500:
if tick >= 200:
ballSO[0] += 0.1
ballSO[1] += 0.1
tick = 0
Expand Down
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ s2.pingpong = True # enable sprite pong
sO = 50 # set slider variable
sT = 50 # set slider variable
test = ""
testall = 0
testdrop = -100
lerplength = 100

# button function
Expand All @@ -71,10 +73,29 @@ def set_test(data):
pe.display.make((500, 500), "PGE Testing Utility", 1)
else:
pe.display.make((500, 500), "PGE Testing Utility", 0)


def set_lerplength(data):
global lerplength
lerplength = data

# Testing Texts
#testtext = [
# pe.text.quick.small("pe.rect", (250,250), layer=1), # 0
# pe.text.quick.small("pe.math.lerp", (250,250), layer=1), # 1
# pe.text.quick.small("pe.math.center", (250,250), layer=1), # 2
# pe.text.quick.small("pe.draw.rect", (250,250), layer=1), # 3
# pe.text.quick.small("pe.draw.circle", (250,250), layer=1), # 4
# pe.text.quick.small("pe.draw.line", (250,250), layer=1), # 5
# pe.text.quick.small("pe.draw.ellipse", (250,250), layer=1), # 6
# pe.text.quick.small("pe.sound.load", (250,250), layer=1), # 7
# pe.text.quick.small("pe.", (250,250), layer=1), # 8
# pe.text.quick.small("pe.", (250,250), layer=1), # 9
# pe.text.quick.small("pe.", (250,250), layer=1)
#]

# test functions
testscore = 0
# Main GAMELOOP
while True:
for pe.event.c in pe.event.get():
Expand Down Expand Up @@ -111,9 +132,33 @@ while True:
pe.draw.circle(pe.color.aqua, (125, 125), 40, 0)
pe.draw.rect(pe.color.red, (325, 75, 100, 100), 5)
pe.draw.rect(pe.color.aqua, (335, 85, 80, 80), 0)
pe.draw.line(pe.color.red, (0, 250, 250,500), 5)
pe.draw.line(pe.color.red, (250, 250, 0,500), 5)
pe.draw.line(pe.color.red, (0, 250), (250,500), 5)
pe.draw.line(pe.color.red, (250, 250), (0, 500), 5)
pe.draw.ellipse(pe.color.red, (250, 250, 250, 250))
elif test == "teststart":
pe.Layer[0][1] = (0, -100)
pe.E_intro.intro(0,pe.color.lightgray,pe.color.gray)
print("Performing test of all functions, please wait")
test = "testall"
elif test == "testall":
pe.Layer[0][1] = (0, -100)
pe.E_intro.intro(0, pe.color.lightgray, pe.color.gray)
pe.Layer[0][1] = (0, 0)
if testall >= len(testtext):
pe.Layer[0][1] = (0, testdrop+100)
testdrop += 100
pe.E_intro.intro(0, pe.color.lightgray, pe.color.gray)
pe.time.sleep(100)
if pe.Layer[0][1][1] >= 0:
pe.time.sleep(500)
pe.Layer[0][1] = (0, 0)
print("Use the testing GUI, to further test the result of functions!")
test = ""
else:
pe.text.display(testtext[testall])
dotest(testall)
testall += 1
pe.display.update()

if test == "":
pe.button.rect((0, 200, 100, 50), pe.color.white, pe.color.lightgray, bt[0], action=set_test, data="button")
Expand All @@ -127,6 +172,8 @@ while True:
if test != "":
if "math_" in test:
pe.button.rect((0, 0, 100, 50), pe.color.verydarkgray, pe.color.darkgray, bt[8], action=set_test, data="math")
elif test == "testall":
pass
else:
pe.button.rect((0, 0, 100, 50), pe.color.white, pe.color.lightgray, bt[2], action=set_test, data="")
#
Expand All @@ -152,16 +199,17 @@ while True:
lerp3 = pe.math.lerp((0,pe.display.get.size()[1]), mp, lerplength)
lerp4 = pe.math.lerp(pe.display.get.size(), mp, lerplength)

pe.draw.line(pe.color.red, (0, 0, mp[0], mp[1]), 5)
pe.draw.line(pe.color.red, (pe.display.get.size()[0], 0, mp[0], mp[1]), 5)
pe.draw.line(pe.color.red, (0, pe.display.get.size()[1], mp[0], mp[1]), 5)
pe.draw.line(pe.color.red, (pe.display.get.size()[0], pe.display.get.size()[1], mp[0], mp[1]), 5)
pe.draw.line(pe.color.red, (0, 0), mp, 5)
pe.draw.line(pe.color.red, (pe.display.get.size()[0], 0), mp, 5)
pe.draw.line(pe.color.red, (0, pe.display.get.size()[1]), mp, 5)
pe.draw.line(pe.color.red, (pe.display.get.size()[0], pe.display.get.size()[1]), mp, 5)

pe.draw.line(pe.color.white, (0,0,lerp1[0],lerp1[1]), 5)
pe.draw.line(pe.color.white, (pe.display.get.size()[0],0,lerp2[0],lerp2[1]), 5)
pe.draw.line(pe.color.white, (0,pe.display.get.size()[1],lerp3[0],lerp3[1]), 5)
pe.draw.line(pe.color.white, (pe.display.get.size()[0],pe.display.get.size()[1],lerp4[0],lerp4[1]), 5)
pe.draw.line(pe.color.white, (0,0), lerp1, 5)
pe.draw.line(pe.color.white, (pe.display.get.size()[0],0), lerp2, 5)
pe.draw.line(pe.color.white, (0,pe.display.get.size()[1]), lerp3, 5)
pe.draw.line(pe.color.white, (pe.display.get.size()[0],pe.display.get.size()[1]), lerp4, 5)
elif test == "math_center":
pe.draw.circle(pe.color.white, pe.math.center((0,0,pe.display.get.size()[0],pe.display.get.size()[1])), 5, 5)
pe.display.update()
if test != "testall":
pe.display.update()
pe.time.tick(200)
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes.
Loading

0 comments on commit 283d48e

Please sign in to comment.