Skip to content
This repository has been archived by the owner on Nov 1, 2022. It is now read-only.

Commit

Permalink
added controls in README and instructions on building the executable
Browse files Browse the repository at this point in the history
  • Loading branch information
tasdikrahman committed Jan 18, 2016
1 parent 255e084 commit eceea26
Show file tree
Hide file tree
Showing 5 changed files with 91 additions and 19 deletions.
34 changes: 34 additions & 0 deletions BUILDING_EXECUTABLE.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
Creating the Executable
=======================

For ``Debain/Ubuntu`` based systems
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

1. I used `pyinstaller <https://github.com/pyinstaller/pyinstaller/>`__ to create the executable.

After installing it and adding the changes. Inside the ``spaceShooter`` directory, simply run the command

.. code:: bash
$ pyinstaller --onefile --windowed spaceShooter.py
This will create an executable and place it inside the directory ``dist``

2. Place the folders ``assets`` and ``sounds`` together with the excutable inside a single folder and zip it.

For ``Windows`` based systems
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

1. `cx_freeze <http://cx-freeze.sourceforge.net/>`__ was used to create the excutable for Windows based systems

2. Use the `setup.py <https://github.com/prodicus/spaceShooter/blob/master/setup.py>`__ file for building the executable.

3. Go to the directory ``spaceShooter`` and then run the command

.. code:: python
$ python setup.py build
This will create a new folder inside ``spaceShooter``.

4. Rename it and zip that file
4 changes: 3 additions & 1 deletion CONTRIBUTING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ Contributing

2. Clone it

Make sure you have installed `pygame <http://pygame.org>`__ installed on your system

create a `virtualenv <http://pypi.python.org/pypi/virtualenv>`__

.. code:: bash
Expand Down Expand Up @@ -34,4 +36,4 @@ Conform to `PEP8 <https://www.python.org/dev/peps/pep-0008/>`__ and if everythin

6. Create new Pull Request

Hack away!
Hack away!
8 changes: 7 additions & 1 deletion LICENSE.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,10 @@ Permission is hereby granted, free of charge, to any person obtaining a copy of

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

The images used in the game are taken from [http://opengameart.org/](http://opengameart.org/), more particulary from the [Space shooter content pack](http://opengameart.org/content/space-shooter-redux) from [@kenney](http://opengameart.org/users/kenney).

License for them is in `Public Domain`

The game sounds were again taken from [http://opengameart.org/](http://opengameart.org/). The game music, [Frozen Jam](http://opengameart.org/content/frozen-jam-seamless-loop) by [tgfcoder](https://twitter.com/tgfcoder) licensed under [CC-BY-3](http://creativecommons.org/licenses/by/3.0/)
60 changes: 45 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ The classic retro game recreated using `Pygame` and `python`.

## Demo

Follow the youtube video to see how I fared on ``spaceShooter``

[![Space Shooter Demo - Youtube](http://i.imgur.com/bHjlJfG.jpg)](https://www.youtube.com/watch?v=o99zpLsM-ZI)

## Screenshots
Expand All @@ -25,25 +27,54 @@ The classic retro game recreated using `Pygame` and `python`.
- 3 lives per game
- Fun to play :)

## Controls

- To move the spaceship
- To left : <kbd>left</kbd>
- to right : <kbd>right</kbd>
- To fire the bullets : <kbd>spacebar</kbd>

## Installation

### For `Windows`

- Download the prebuilt `zip file` [from here](https://github.com/prodicus/spaceShooter/releases/download/v0.0.1/spaceShooter-0.0.1-windows.zip)
- Unzip it and run the executable named `spaceShooter`
- Download the prebuilt `zip file` [from here](https://github.com/prodicus/spaceShooter/releases/download/v0.0.1/spaceShooter-0.0.1-windows.zip) and extract the file to your preferred destination by using [7-zip](http://www.7-zip.org/download.html) or [winzip](http://www.winzip.com/prod_down.html) or any other similar program of your choice.
- Run the executable named `spaceShooter` inside the extracted file.

### For `MAC OS X` and `Linux/Debian` based systems

#### Option 1: Download the Executable file
#### Option 1: Download the zipped executable file

- Download the [latest zip file](https://github.com/prodicus/spaceShooter/releases/download/v0.0.1/SpaceShooter-0.0.1.Linux.zip)
- Unzip the file

If your download was saved on the `~/Downloads` folder

Press <kbd>Ctrl</kbd> + <kbd>Alt</kbd> + <kbd>T</kbd> to open the shell if you are on `GNU/Linux` based systems and type

```bash
$ unzip SpaceShooter-0.0.1.Linux.zip -d ~/Desktop
$ cd ~/Desktop
~/Desktop $ chmod +x spaceShooter
~/Desktop $ ./spaceShooter
```

This will unzip the file on your `Desktop`, you can replace it with the directory of your choice

**NOTE** : If it gives you an error, you probably don't have `unzip` installed in your system.

```bash
$ sudo apt-get install unzip
```
That should fix the error.

- Run the executable named `spaceShooter`

**NOTE** : Make `spaceShooter` executable by doing a `chmod +x spaceShooter`
A Similar process would be followed for `OS X`

#### Option 2: Build from source

You need to have `pygame` installed for this option
You need to have `pygame` installed for this option.

##### Ubuntu/Debian

Expand Down Expand Up @@ -72,34 +103,33 @@ $ cd spaceShooter/
$ python spaceShooter.py
```

This game was written in one day, so the coding standards might not be up the mark.

Enjoy the game :smile:
Enjoy the game!

## To-do:

- [x] Add the windows executable file
- [ ] Add main menu for the game
- [ ] Fix bug which stops the background music from looping
- [ ] Fix [bug](https://github.com/prodicus/spaceShooter/blob/master/spaceShooter.py#L372) which stops the background music from looping
- [ ] add feature to replay the game after all players die

## Contributing

Please refer [Contributing page for details](https://github.com/prodicus/spaceShooter/blob/master/CONTRIBUTING.rst)
This game was written in one day, so the coding standards might not be up the mark. Don't be shy to make a Pull request :)

For details, please refer [the Contributing page](https://github.com/prodicus/spaceShooter/blob/master/CONTRIBUTING.rst)

## Issues

Please report the bugs at the [issue tracker](https://github.com/prodicus/spaceShooter/issues)
You can report the bugs at the [issue tracker](https://github.com/prodicus/spaceShooter/issues)

## License

[MIT License](http://prodicus.mit-license.org) © [Tasdik Rahman](http://tasdikrahman.me)

You can find a copy of the License at http://prodicus.mit-license.org/

The images used in the game are taken from [http://opengameart.org/](http://opengameart.org/), more particulary from the [Space shooter content pack](http://opengameart.org/content/space-shooter-redux) from [@kenney](http://opengameart.org/users/kenney).
- The images used in the game are taken from [http://opengameart.org/](http://opengameart.org/), more particulary from the [Space shooter content pack](http://opengameart.org/content/space-shooter-redux) from [@kenney](http://opengameart.org/users/kenney).

License for them is in `Public Domain`

The game sounds were again taken from [http://opengameart.org/](http://opengameart.org/)

- The game music, [Frozen Jam](http://opengameart.org/content/frozen-jam-seamless-loop) by [tgfcoder](https://twitter.com/tgfcoder) licensed under [CC-BY-3](http://creativecommons.org/licenses/by/3.0/)
- The game sounds were again taken from [http://opengameart.org/](http://opengameart.org/). The game music, [Frozen Jam](http://opengameart.org/content/frozen-jam-seamless-loop) by [tgfcoder](https://twitter.com/tgfcoder) licensed under [CC-BY-3](http://creativecommons.org/licenses/by/3.0/)
4 changes: 2 additions & 2 deletions spaceShooter.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# @Date: 2016-01-17
# @Email: [email protected] Github username: @prodicus
# @Last Modified by: tasdik
# @Last Modified time: 2016-01-17
# @Last Modified time: 2016-01-18
# MIT License. You can find a copy of the License @ http://prodicus.mit-license.org

## Game music Attribution
Expand Down Expand Up @@ -200,7 +200,7 @@ def __init__(self):
self.radius = int(self.rect.width *.90 / 2)
self.rect.x = random.randrange(0, WIDTH - self.rect.width)
self.rect.y = random.randrange(-150, -100)
self.speedy = random.randrange(1, 8) ## for randomizing the speed of the Mob
self.speedy = random.randrange(5, 20) ## for randomizing the speed of the Mob

## randomize the movements a little more
self.speedx = random.randrange(-3, 3)
Expand Down

0 comments on commit eceea26

Please sign in to comment.