4 Commits

Author SHA1 Message Date
e5584bd439 disable dev menu functionality 2023-01-26 15:17:09 -05:00
44986e62c0 fixed python version needed in README.md 2023-01-26 15:06:27 -05:00
6d28f0827f changed doc references to gitea site 2023-01-26 15:05:21 -05:00
c25b021501 upgraded pygame to 2.1.2 2023-01-26 15:02:39 -05:00
6 changed files with 36 additions and 56 deletions

View File

@@ -1,11 +1,11 @@
![Pocket Friends](https://github.com/nickedyer/pocket-friends/blob/master/pocket_friends/game_files/resources/images/promotional.png?raw=true)
![Pocket Friends](https://gitea.citruxx.com/ndyer/pocket-friends/raw/branch/master/pocket_friends/game_files/resources/images/promotional.png)
[![License: GNU GPL v3.0](https://img.shields.io/badge/license-GNU%20GPL%20v3.0-blue)](LICENSE)
Pocket Friends is a game where you raise your own little pocket friend! These pocket friends, called bloops, are great little companions to have! You can feed them, play with them, and watch them grow up!
~~You can download the latest release of Pocket Friends on the [releases page.](https://github.com/nickedyer/pocket-friends/releases)~~
~~You can download the latest release of Pocket Friends on the [releases page.](https://gitea.citruxx.com/ndyer/pocket-friends/releases)~~
There are currently no releases of the game. To install the current version on GitHub, follow the instructions below.
---
@@ -13,13 +13,13 @@ There are currently no releases of the game. To install the current version on G
## Installing From Source
Requirements:
- Python 3.6 or greater
- Python 3.10 or greater
- Pip
- Git
All you need to do to install Pocket Friends is install it with pip and you're good to go!
`pip install git+https://github.com/nickedyer/pocket-friends.git`
`pip install git+https://gitea.citruxx.com/ndyer/pocket-friends.git`
Now that the game is installed, just run it like you would any other Python program.
@@ -33,7 +33,7 @@ If you wish to build this version of Pocket Friends for Windows, you will need t
requirements as to install it to your system from source. After you have done that,
issue the following:
```
git clone https://github.com/nickedyer/pocket-friends.git
git clone https://gitea.citruxx.com/ndyer/pocket-friends.git
cd pocket-friends
pip install -r requirements.txt
pip install pyinstaller

View File

@@ -1,7 +1,25 @@
"""
Wrapper that launches the launch script.
Launch script for Pocket Friends.
"""
import pocket_friends.launch as launch
import os
from pathlib import Path
import pygame
import sys
from pocket_friends.game_files.game import main as game_main
from pocket_friends.development.dev_menu import main as dev_menu_main
if __name__ == '__main__':
launch.main()
enable_dev = False
# enable dev mode if --dev argument is passed
if len(sys.argv) > 0:
for arg in sys.argv:
match arg:
case '--delete-save':
save_dir = os.path.join(Path.home(), '.pocket_friends')
os.remove(save_dir + '/save.json')
game_main()
pygame.quit()
sys.exit()

View File

@@ -534,7 +534,7 @@ except ImportError:
on_hardware = False
def game(screen_size):
def game():
"""
Starts the game.
"""
@@ -543,6 +543,10 @@ def game(screen_size):
# Hide the cursor for the Pi display.
pygame.mouse.set_visible(False)
# The game is normally rendered at 80 pixels and upscaled from there. If changing displays, change the
# screen_size to reflect what the resolution of the new display is.
screen_size = 320
window = pygame.display.set_mode((screen_size, screen_size))
surface = pygame.Surface((game_res, game_res))
@@ -970,11 +974,11 @@ def game(screen_size):
draw()
def main(screen_size=320):
def main():
"""
Calls the game() function to start the game.
"""
game(screen_size)
game()
GPIOHandler.teardown()
pygame.quit()

View File

@@ -1,42 +0,0 @@
import os
from pathlib import Path
import argparse
import pygame
import sys
from pocket_friends.game_files.game import main as game_main
def main():
"""
Launch script for Pocket Friends.
"""
# Creates the parser object.
parser = argparse.ArgumentParser()
# Adds parser arguments.
parser.add_argument('-D', '--delete-save', action='store_true', help='Deletes the save file if it exists.')
parser.add_argument('-s', '--size', type=int, default=320, help='Sets the size of the window.')
# Parse the arguments given
args = parser.parse_args()
# If given the delete-save argument, delete the safe file
if args.delete_save:
save_dir = os.path.join(Path.home(), '.pocket_friends')
# Remove the file if it exists
try:
os.remove(save_dir + '/save.json')
print('Save file deleted.')
except FileNotFoundError:
print('Save file does not exist, cannot delete.')
# Set the screen size
screen_size = int(args.size)
# Start the game
game_main(screen_size)
# Cleanup
pygame.quit()
sys.exit()

View File

@@ -1 +1 @@
pygame==1.9.4
pygame~=2.1.2

View File

@@ -15,12 +15,12 @@ setuptools.setup(
license='GNU GPL-3.0',
long_description=long_description,
long_description_content_type='text/markdown',
url='https://github.com/nickedyer/pocket-friends',
url='https://gitea.citruxx.com/ndyer/pocket-friends',
packages=setuptools.find_packages(),
# https://pypi.org/classifiers/
classifiers=[
],
install_requires=required,
python_requires='>=3.6',
python_requires='>=3.10',
include_package_data=True,
)