Skip to content

Commit

Permalink
Build fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
SuperArcherG committed Dec 31, 2022
1 parent 7261153 commit 88bbdb8
Show file tree
Hide file tree
Showing 26 changed files with 33 additions and 17 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,6 @@ Platformy.spec
build/*
build/Platformy
Icon
dist/assets
dist/assets
assets.zip
__MACOSX/assets
3 changes: 2 additions & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
"request": "launch",
"program": "Platformy.py",
"console": "integratedTerminal",
"justMyCode": true
"justMyCode": true,
"sudo" : true
}
]
}
33 changes: 18 additions & 15 deletions Platformy.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,16 @@
import urllib.request
import zipfile

print(platform.system)

if platform.system == "Darwin" and not os.path.exists(os.path.join("assets")):
pathToZip = os.path.join("assets.zip")
urllib.request.urlretrieve(
"https://superarcherg.com/Platformy/assets.zip", pathToZip)
print(os.name)
print(platform.system())
if platform.system() == "Darwin" and not os.path.exists(os.getcwd() + "/assets"):
pathToZip = os.getcwd() + "/assets.zip"
opener = urllib.request.URLopener()
opener.addheader('User-Agent', 'ARCHER_PROD/Platformy')
filename, headers = opener.retrieve(
"https://server.superarcherg.com/assets", pathToZip)
with zipfile.ZipFile(pathToZip, 'r') as zip_ref:
zip_ref.extractall(os.path.join("assets"))
zip_ref.extractall(os.getcwd())


pygame.init() # initialize pygame
Expand All @@ -41,23 +43,24 @@
gravity = 0.2
Grounded = True

jump = pygame.mixer.Sound(os.path.join("assets/audio/jump.wav"))
land = pygame.mixer.Sound(os.path.join("assets/audio/land.wav"))
jump = pygame.mixer.Sound(os.getcwd() + "/assets/audio/jump.wav")
land = pygame.mixer.Sound(os.getcwd() + "/assets/audio/land.wav")

# player coordinates
Px, Py = 0, 0
Vx, Vy = 0, 0
Ox, Oy = 0, 0
# Load the background image here. Make sure the file exists!

Mountains = BG(screenwidth, screenheight,
os.path.join("assets/images/background/BG.png"))
L, R, U, D, N = os.path.join("assets/images/Player/L.png"), os.path.join("assets/images/Player/R.png"), os.path.join(
"assets/images/Player/U.png"), os.path.join("assets/images/Player/D.png"), os.path.join("assets/images/Player/N.png")
Mountains = BG(screenwidth, screenheight, os.getcwd() +
"/assets/images/background/BG.png")
L, R, U, D, N = os.getcwd() + "/assets/images/Player/L.png", os.getcwd() + "/assets/images/Player/R.png", os.getcwd() + \
"/assets/images/Player/U.png", os.getcwd() + "/assets/images/Player/D.png", os.getcwd() + \
"/assets/images/Player/N.png"
Player = Player(L, R, U, D, N, screenwidth, screenheight)
Floor = Floor(screenwidth, screenheight,
os.path.join("assets/images/tiles/Ground.png"), os.path.join(
"assets/images/tiles/DirtGround.png"))
os.getcwd() + "/assets/images/tiles/Ground.png", os.getcwd() +
"/assets/images/tiles/DirtGround.png")
pygame.mouse.set_visible(0)
pygame.display.set_caption('Platformy')
pressedKeys = pygame.key.get_pressed()
Expand Down
6 changes: 6 additions & 0 deletions Test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import os
import urllib.request

pathToZip = os.path.join("assets.zip")
urllib.request.urlretrieve(
"https://superarcherg.com/Platformy/assets.zip", pathToZip)
Binary file removed assets/audio/death.wav
Binary file not shown.
Binary file removed assets/audio/explosion.wav
Binary file not shown.
Binary file removed assets/audio/hurt.wav
Binary file not shown.
Binary file removed assets/audio/jump.wav
Binary file not shown.
Binary file removed assets/audio/land.wav
Binary file not shown.
Binary file removed assets/images/Player/B.png
Binary file not shown.
Binary file removed assets/images/Player/D.png
Binary file not shown.
Binary file removed assets/images/Player/L.png
Binary file not shown.
Binary file removed assets/images/Player/N.png
Binary file not shown.
Binary file removed assets/images/Player/R.png
Binary file not shown.
Binary file removed assets/images/Player/U.png
Binary file not shown.
Binary file removed assets/images/background/BG.png
Binary file not shown.
Binary file removed assets/images/background/BG2.png
Binary file not shown.
Binary file removed assets/images/promo/SlimeCover.png
Binary file not shown.
Binary file removed assets/images/tiles/DirtGround.png
Binary file not shown.
Binary file removed assets/images/tiles/Ground.png
Binary file not shown.
Binary file removed assets/images/tiles/GroundOLD.png
Binary file not shown.
Binary file removed assets/images/tiles/GroundRock.png
Binary file not shown.
Binary file added dist/Platformy.zip
Binary file not shown.
Binary file modified dist/Platformy/Platformy
Binary file not shown.
4 changes: 4 additions & 0 deletions dist/Platformy/README.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
How to Launch:
In this folder, there shold be a file labeled "Platformy"
Right click it, and open with Terminal
It may take a moment to download the assets
Binary file modified dist/Platformy/base_library.zip
Binary file not shown.

0 comments on commit 88bbdb8

Please sign in to comment.