diff --git a/src/__init__ b/src/__init__ new file mode 100644 index 0000000..4d768f9 Binary files /dev/null and b/src/__init__ differ diff --git a/src/__init__.py b/src/__init__.py index e69de29..15c939a 100644 --- a/src/__init__.py +++ b/src/__init__.py @@ -0,0 +1,6 @@ +if __name__ == '__main__': + import sys, subprocess + dependencies = ['pygame'] # to add furture dependencies + subprocess.call([sys.executable, '-m', 'pip', 'install'] + dependencies) + import pygame + main() diff --git a/src/__init__.spec b/src/__init__.spec new file mode 100644 index 0000000..b5bacf1 --- /dev/null +++ b/src/__init__.spec @@ -0,0 +1,32 @@ +# -*- mode: python -*- + +block_cipher = None + + +a = Analysis(['__init__.py'], + pathex=['/media/xerous/0BB79E5469A065CA/projects/pygame-Coin-Fall-/src'], + binaries=[], + datas=[], + hiddenimports=[], + hookspath=[], + runtime_hooks=[], + excludes=[], + win_no_prefer_redirects=False, + win_private_assemblies=False, + cipher=block_cipher, + noarchive=False) +pyz = PYZ(a.pure, a.zipped_data, + cipher=block_cipher) +exe = EXE(pyz, + a.scripts, + a.binaries, + a.zipfiles, + a.datas, + [], + name='__init__', + debug=False, + bootloader_ignore_signals=False, + strip=False, + upx=True, + runtime_tmpdir=None, + console=True ) diff --git a/src/resources.py b/src/resources.py new file mode 100644 index 0000000..9dbb54a --- /dev/null +++ b/src/resources.py @@ -0,0 +1,49 @@ +########################################## +# Load all the resources used by the game +########################################## +import random + + +class Resources: + + def __init__(self, pygame): + + # set up fonts + # None is for default system font + self.basicFont = pygame.font.SysFont(None, 48) + + # set colors R, G, B code + self.BLACK = (0, 0, 0) + self.WHITE = (255, 255, 255) + self.BGCOLOR = (4, 145, 145) + self.BUTTONCOLOR = (150, 0, 0) + self.X = (0) + + # images + # convert for easy blitting + self.cart_img = pygame.image.load('Images/bb.jpg').convert() + self.coin_img = pygame.image.load('Images/coin.jpg').convert() + self.bluecoin = pygame.image.load('Images/bluecoin.jpg').convert() + self.bomb = pygame.image.load('Images/bomb.png').convert() + self.R = random.randint(1, 4) + self.BG = pygame.image.load('Images/coinfallbg'+str(self.R)+'.jpg').convert() + + # load images for animation + + self.gold_coin_images = [ + pygame.image.load('Images/GoldCoinAnimation/coin1.png').convert_alpha(), + pygame.image.load('Images/GoldCoinAnimation/coin2.png').convert_alpha(), + pygame.image.load('Images/GoldCoinAnimation/coin3.png').convert_alpha(), + pygame.image.load('Images/GoldCoinAnimation/coin4.png').convert_alpha(), + pygame.image.load('Images/GoldCoinAnimation/coin5.png').convert_alpha(), + pygame.image.load('Images/GoldCoinAnimation/coin6.png').convert_alpha() + ] + + self.silver_coin_images = [ + pygame.image.load('Images/SilverCoinAnimation/coin1.png').convert_alpha(), + pygame.image.load('Images/SilverCoinAnimation/coin2.png').convert_alpha(), + pygame.image.load('Images/SilverCoinAnimation/coin3.png').convert_alpha(), + pygame.image.load('Images/SilverCoinAnimation/coin4.png').convert_alpha(), + pygame.image.load('Images/SilverCoinAnimation/coin5.png').convert_alpha(), + pygame.image.load('Images/SilverCoinAnimation/coin6.png').convert_alpha() + ]