Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixing issue #11 and #6, Enable running the game from anywhere #16

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
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
29 changes: 18 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,27 +1,34 @@
# Flappuccino

Flappuccino is a game created in 48 hours for the [PyGame Community New Years Jam](https://itch.io/jam/pygame-community-jam) using Python with [Pygame](https://www.pygame.org).
Flappuccino is a game created in 48 hours for the [PyGame Community New Years Jam](https://itch.io/jam/pygame-community-jam) using Python with [Pygame](https://www.pygame.org).

## Screenshots
![](https://img.itch.zone/aW1hZ2UvODg3MDQ0LzUwMDQzOTkuZ2lm/original/vd0wHu.gif)

![](https://img.itch.zone/aW1hZ2UvODg3MDQ0LzUwMDQzOTkuZ2lm/original/vd0wHu.gif)

## Background

Information on how to play is available on the game's [itch.io page](https://polymars.itch.io/flappuccino).

## Usage

### Releases

A Windows build of the game is available [here](https://polymars.itch.io/flappuccino).

### Running from source
Grab the latest release of Python from [here](https://www.python.org/downloads/) **and** install Pygame by executing ``pip install pygame``.

**Note:** If the ``pip install pygame`` did not work for you, then try this:
1. Windows:
``python -m pip install pygame``
2. Mac:
``python3 -m pip install pygame``
3. Linux:
Same as windows.
Grab the latest release of [Python](https://www.python.org/downloads/) **and** install [Pygame](https://www.pygame.org/wiki/GettingStarted) by executing `pip install pygame`.

**Note:** If the `pip install pygame` did not work for you, then try this:

Ensure ``main.py`` is in the same directory as ``./data`` and execute ``python main.py``.
1. Windows and Linux:
`python -m pip install pygame`
2. Mac:
`python3 -m pip install pygame`

Ensure `main.py` is in the same directory as `./data` and execute `python main.py`.

## Contributing

Pull requests are welcome! For major refactors, please open an issue first to discuss what you would like to improve. Feel free to create a fork of this repository and use the code for any noncommercial purposes.
21 changes: 14 additions & 7 deletions background.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,18 @@
import colorsys
import pygame


class Background:
def __init__(self):
self.sprite = pygame.image.load('data/gfx/bg.png')
def __init__(self, BASE_PATH):
self.sprite = pygame.image.load(BASE_PATH + "/data/gfx/bg.png")
self.position = 0
self.uncoloredSprite = pygame.image.load('data/gfx/bg.png')
def setSprite(self, tint):
self.uncoloredSprite = pygame.image.load(BASE_PATH + "/data/gfx/bg.png")

def setSprite(self, tint):
copy = self.uncoloredSprite.copy()
color = colorsys.hsv_to_rgb(tint,1,1)
copy.fill((color[0]*255, color[1]*255, color[2]*255), special_flags=pygame.BLEND_ADD)
self.sprite = copy
color = colorsys.hsv_to_rgb(tint, 1, 1)
copy.fill(
(color[0] * 255, color[1] * 255, color[2] * 255),
special_flags=pygame.BLEND_ADD,
)
self.sprite = copy
10 changes: 6 additions & 4 deletions bean.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import pygame
class Bean:
def __init__(self):
self.sprite = pygame.image.load('data/gfx/bean.png')


class Bean:
def __init__(self, BASE_PATH):
self.sprite = pygame.image.load(BASE_PATH + "/data/gfx/bean.png")
self.position = pygame.Vector2()
self.position.xy
self.position.xy
12 changes: 8 additions & 4 deletions button.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
import pygame


class Button:
def __init__(self):
def __init__(self, BASE_PATH):
self.price = 3
self.level = 1
sprite = pygame.image.load('data/gfx/button.png')
typeIndicatorSprite = pygame.image.load('data/gfx/null_indicator.png')
self.level = 1
self.sprite = pygame.image.load(BASE_PATH + "/data/gfx/button.png")
self.typeIndicatorSprite = pygame.image.load(
BASE_PATH + "/data/gfx/null_indicator.png"
)
Loading