Skip to content

Commit

Permalink
Added nebula files, added automagic dependency importer, and cleaned …
Browse files Browse the repository at this point in the history
…up filetree more
  • Loading branch information
HyperSourceGithub committed Apr 18, 2024
1 parent 1e6e5ae commit a984dd4
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 4 deletions.
Binary file removed assets/plane.png
Binary file not shown.
Binary file removed assets/plane2.png
Binary file not shown.
Binary file removed assets/plane3.png
Binary file not shown.
Binary file removed assets/plane4.png
Binary file not shown.
11 changes: 8 additions & 3 deletions flightsim.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Check python version
import os
import sys
pyver = sys.version_info.major
if pyver < 3:
Expand All @@ -9,8 +10,12 @@
try:
import pygame, requests
except ImportError as e:
print("Missing dependencies! Install pygame and requests first: `pip install pygame requests`")
exit()
autoimport = input("Missing dependencies! Would you like to import them automagically? [Y/n]")
if autoimport.lower() == "y":
os.system("python3 -m pip install -r requirements.txt")
elif autoimport.lower() == "n":
print("Please run [python3 -m pip install -r requirements.txt] please.")
exit()

import math
import random
Expand Down Expand Up @@ -52,7 +57,7 @@
}

# plane images for cycle
planes = ["assets/plane.png", "assets/plane2.png", "assets/plane3.png", "assets/plane4.png"]
planes = ["assets/planes/plane.png", "assets/planes/plane2.png", "assets/planes/plane3.png", "assets/planes/plane4.png"]
plane_index = 0

# ==========================================================================
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
certifi==2024.2.2
charset-normalizer==3.3.2
idna==3.7
pygame-ce==2.4.1
pygame==2.5.2
requests==2.31.0
urllib3==2.2.1

0 comments on commit a984dd4

Please sign in to comment.