Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added src/__init__
Binary file not shown.
6 changes: 6 additions & 0 deletions src/__init__.py
Original file line number Diff line number Diff line change
@@ -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()

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is main()? Please check if this is a NameError not just for me.

32 changes: 32 additions & 0 deletions src/__init__.spec
Original file line number Diff line number Diff line change
@@ -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 )
49 changes: 49 additions & 0 deletions src/resources.py
Original file line number Diff line number Diff line change
@@ -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()
]