Skip to content
Draft
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
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
__pycache__
build
13 changes: 10 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,21 @@ A Windows build of the game is available [here](https://polymars.itch.io/flappuc
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:
1. Windows or Linux:
``python -m pip install pygame``
2. Mac:
``python3 -m pip install pygame``
3. Linux:
Same as windows.
3. Browser
```sh
pip install pygbag
cd ..
pygbag Flappuccino
```
Then
http://localhost:8000

Ensure ``main.py`` is in the same directory as ``./data`` and execute ``python main.py``.
**Note:** If python does not work, try python3, py, or py3.

## 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.
18 changes: 12 additions & 6 deletions background.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
import pygame
import colorsys


class Background:
uncolored_sprite = pygame.image.load('data/gfx/bg.png')

def __init__(self):
self.sprite = pygame.image.load('data/gfx/bg.png')
self.position = 0
self.uncoloredSprite = pygame.image.load('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

def set_sprite(self, tint: float) -> None:
copy = self.uncolored_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
11 changes: 7 additions & 4 deletions bean.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import pygame
class Bean:
def __init__(self):
self.sprite = pygame.image.load('data/gfx/bean.png')


class Bean:
sprite = pygame.image.load('data/gfx/bean.png')

def __init__(self, x_pos: float = 0, y_pos: float = 0):
self.position = pygame.Vector2()
self.position.xy
self.position.xy = x_pos, y_pos
21 changes: 16 additions & 5 deletions button.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,18 @@
import pygame
from pygame.image import load


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

def __init__(self, index: int, indicator: str) -> None:
self.price = 5
self.level = 1
self.index = index
self.type_indicator_sprite = load(indicator)
self.position = pygame.Vector2()
self.position.xy = 220 + (self.index*125), 393

def set_price(self, new_price: int) -> None:
self.price = new_price
Binary file added data/sfx/bean-pygbag.ogg
Binary file not shown.
Binary file added data/sfx/dead-pygbag.ogg
Binary file not shown.
Binary file added data/sfx/flap-pygbag.ogg
Binary file not shown.
Binary file added data/sfx/upgrade-pygbag.ogg
Binary file not shown.
Loading