Skip to content

Commit ac643d2

Browse files
authored
Merge pull request #4 from ljnath/release/1.0.5
Release/1.0.5
2 parents fcd51f5 + 293831d commit ac643d2

File tree

9 files changed

+108
-50
lines changed

9 files changed

+108
-50
lines changed

.vscode/settings.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{
22
"python.pythonPath": ".venv\\Scripts\\python.exe",
3-
"python.jediEnabled": false
3+
"python.jediEnabled": false,
4+
"python.languageServer": "Microsoft"
45
}

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# Changelog
22

3+
## [1.0.5] - 2021-06-10
4+
- changed default quit choice to No in ExitMenu
5+
- added support to hide the exit menu if ESCAPE key is pressed
6+
- code refactoring
7+
38
## [1.0.4] - 2020-05-17
49
- added exit prompt in the game, this also acts as a game pause feature
510
- changed size of sam missile

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2020 Lakhya Jyoti Nath
3+
Copyright (c) 2021 Lakhya Jyoti Nath
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 43 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
# PyBluesky
2-
### Version : 1.0.4
2+
### Version : 1.0.5
33

4-
A simple python game to navigate your jet and fight though a massive missiles attack based on pygame framework</br>
5-
Based on https://realpython.com/blog/python/pygame-a-primer
64

75
Author : Lakhya Jyoti Nath (ljnath)<br>
86
Date : April 2020 - May 2020<br>
@@ -16,9 +14,48 @@ Website : https://www.ljnath.com
1614

1715
[![Download PyBluesky](https://sourceforge.net/sflogo.php?type=13&group_id=3215162)](https://sourceforge.net/p/ljnath/)
1816

19-
## Development
17+
</br>
18+
</br>
19+
20+
## INTRODUCTION
21+
PyBluesky is a simple 2D python game developed using the pygame framework.</br>
22+
Based on https://realpython.com/blog/python/pygame-a-primer
23+
</br></br>
24+
25+
## GAME MECHANICS
26+
The game is simple where the objective is to navigate and shoot your way through the sky.
27+
There are enemy missiles which travels from right-to-left with varied speed. These enemy missiles can be destroyed by shooting at them. With increase in game level, SAM launchers also moves on the ground, which can fire targeted missile at the jet. These missiles cannot be destroyed, so user needs to evade them.
28+
29+
The jet can be controlled both my keyboard and mouse. It can move in all directions viz. forward, backward, up and down. It can also be navigated diagonally with key combinations.
30+
For example, in order to move in north-east directory, you can press both the RIGHT and UP arrow key.
31+
32+
While playing with keyboard, you can shoot bullets using the SPACEBAR and you can use your LEFT mouse button while playing with mouse.<br>
33+
34+
The gameplay has levels, which changes every 20 seconds. A level increase results in increases of enemy missiles.
35+
It also gives 50 new ammo to the jet as well as the game score is bumped up by 10 points.
36+
37+
The game also features a power-up star which falls across the sky at each level.
38+
Catching the power-up star will destroy all the enemy bullets in the current game frame.
39+
</br></br>
2040

21-
### Dependencies
41+
## HOW TO PLAY
42+
You can either download these code and directly play from it. For this you need to have python3 and the dependencies mentioned in the requirements.txt file needs to be installed.
43+
44+
Alternately you can download and install the game binary from [sourceforge.com](https://sourceforge.net/p/ljnath/). This does not need any pre-requisite, as all the required pre-requisites are built into the binary package.
45+
</br></br>
46+
47+
## LEADERBOARD
48+
The game also features a network-controlled leaderboard. User scores along with few other metadata are published to a remote server.
49+
50+
During the game startup, the updated scores are download from the server and displayed as leaderboard.
51+
52+
</br></br>
53+
54+
## DEVELOPMENT
55+
56+
Following are the required dependencies for building the binary of this game.
2257

2358
- `pip install cx-Freeze==6.1` for creating distribution
24-
- `sudo apt install zlib1g-dev` for cx-Freeze installaion in ubuntu
59+
- `sudo apt install zlib1g-dev` for cx-Freeze installaion in ubuntu
60+
61+

game/data/static.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@ def name(self):
1212

1313
@property
1414
def version(self):
15-
return '1.0.4'
15+
return '1.0.5'
1616

1717
@property
1818
def screen_width(self):
1919
# return 1024
2020
return self.__display_info.current_w # game resolution is same as monitor resolution
21-
21+
2222

2323
@property
2424
def screen_height(self):

game/handlers/network.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ async def check_game_update(self, game_env):
2424
try:
2525
get_parameters = {'action': 'getUpdate', 'apiKey': self.__api_key}
2626
async with aiohttp.ClientSession() as session:
27-
async with session.get(self.__api_endpoint, params=get_parameters) as response:
27+
async with session.get(self.__api_endpoint, params=get_parameters, timeout=aiohttp.ClientTimeout(total=10)) as response:
2828
if response.status != 200:
2929
raise Exception()
3030
json_response = loads(await response.text())
@@ -41,7 +41,7 @@ async def get_leaders(self):
4141
try:
4242
get_parameters = {'action': 'getTopScores', 'apiKey': self.__api_key}
4343
async with aiohttp.ClientSession() as session:
44-
async with session.get(self.__api_endpoint, params=get_parameters) as response:
44+
async with session.get(self.__api_endpoint, params=get_parameters, timeout=aiohttp.ClientTimeout(total=15)) as response:
4545
if response.status != 200:
4646
raise Exception()
4747
leaders = loads(await response.text())
@@ -87,7 +87,7 @@ async def __post_results(self, session, payload):
8787
result = True
8888
try:
8989
payload['apiKey'] = self.__api_key
90-
async with session.put(self.__api_endpoint, json=payload) as response:
90+
async with session.put(self.__api_endpoint, json=payload, timeout=aiohttp.ClientTimeout(total=30)) as response:
9191
if response.status != 201:
9292
result = False
9393
except:

game/sprites/text/exitmenu.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ def __init__(self, game_env):
1818
self.__n_selected_surf = self.font.render("No",1, self.__game_env.static.text_selection_color) # creating surface with No text when highlighted
1919

2020
self.__choices = self.__title.surf.get_width()/2 - (self.__y_selected_surf.get_width() + self.__n_surf.get_width())/2
21-
self.__highlight_yes()
21+
self.__highlight_no()
2222

2323
def __recreate_surf(self):
2424
self.surf = Surface((self.__title.surf.get_width(), self.__title.surf.get_height() + self.__y_surf.get_height()), self.__game_env.SRCALPHA)

0 commit comments

Comments
 (0)