Skip to content
This repository was archived by the owner on Mar 31, 2020. It is now read-only.

overjoyed otolaryngologists #4

Open
wants to merge 58 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
6bfc10a
Update README.md
ravenkls Feb 21, 2019
dab427b
Update README.md
ravenkls Feb 22, 2019
9a4ab37
Update README.md
ravenkls Feb 22, 2019
4274d04
first commit
ravenkls Feb 22, 2019
9f2aed8
Merge branch 'master' of https://github.com/ravenkls/code-jam-4
ravenkls Feb 22, 2019
8a0a80d
minesweeper gui simple created
ravenkls Feb 22, 2019
b735ee9
logic skeleton
ravenkls Feb 22, 2019
c5124cd
linting errors
ravenkls Feb 23, 2019
15c3961
put_mines_in_grid function complete
ravenkls Feb 23, 2019
cb72992
get_tile_number function complete
ravenkls Feb 23, 2019
508394d
get_tile_number function complete
ravenkls Feb 23, 2019
8de68e5
fixed __get_tile_safe function
ravenkls Feb 23, 2019
5732ef0
Extended the click_tile function
freyah4224 Feb 23, 2019
2989cfe
"Reworded" the logic in the click_tile function to make it more readable
freyah4224 Feb 23, 2019
dc2e8d9
add method to discover tiles
ravenkls Feb 23, 2019
d2a1dc7
basic GUI implementation
ravenkls Feb 23, 2019
78b8f40
When you right-click it now adds a flag icon.
freyah4224 Feb 24, 2019
ce8594c
place_flag is now fully functional
freyah4224 Feb 24, 2019
2815052
new method for storing resources
ravenkls Feb 24, 2019
9e14fa1
merged gui.py
ravenkls Feb 24, 2019
341d8f6
implemented a way to change the amount of clicks for the tiles
ravenkls Feb 24, 2019
3d9cddc
fixed linting issues
ravenkls Feb 24, 2019
c764c80
noqa
ravenkls Feb 24, 2019
89e66d4
Mines are now revealed with a mine icon
freyah4224 Feb 24, 2019
5c653d3
added cracking animation and stylesheet
ravenkls Feb 24, 2019
92d6c6d
fixed bug where tiles would move about after destroying them
ravenkls Feb 24, 2019
e7aac65
Implemented game_over function
freyah4224 Feb 25, 2019
1003ec2
random explosions with sound effects at gameover
ravenkls Feb 25, 2019
afdca49
merged
ravenkls Feb 25, 2019
e9fc915
updated the styling, actually looks good now
ravenkls Feb 26, 2019
554838d
clicking limiter & nice sound effects
ravenkls Feb 26, 2019
fddbacd
better modal positioning for alert
ravenkls Feb 26, 2019
dcac0fe
added a timer and flag counter
ravenkls Feb 26, 2019
ee61709
basic start screen
ravenkls Feb 26, 2019
5875da6
Added fields to set grid width, grid height, and number of mines. Res…
freyah4224 Mar 2, 2019
a040d2c
changed layout from QHBox to QForm on menu and added spacers around t…
ravenkls Mar 2, 2019
5312d46
added support for high dpi displays
ravenkls Mar 2, 2019
a9a846a
forgot to lint
ravenkls Mar 2, 2019
de505af
fixed bug with grid
ravenkls Mar 2, 2019
a35ab97
fixed bugs
ravenkls Mar 2, 2019
a16b0f8
Added game over modal
freyah4224 Mar 2, 2019
8971d2b
Fixed crash when OK button clicked in a modal
freyah4224 Mar 3, 2019
248f74c
styled main menu
ravenkls Mar 3, 2019
eab64da
Merge branch 'master' of https://github.com/ravenkls/code-jam-4
ravenkls Mar 3, 2019
c85e030
game over button returns to main menu now
ravenkls Mar 3, 2019
0b05010
tile resets when you click too fast
ravenkls Mar 3, 2019
1030ce3
timer speeds up everytime you click too fast
ravenkls Mar 3, 2019
7a10191
lint
ravenkls Mar 3, 2019
1278d2b
the blocks now scream when you hit them
ravenkls Mar 3, 2019
9b997e6
you can actually win the game now
ravenkls Mar 3, 2019
724b474
better sounds for tiles
ravenkls Mar 3, 2019
1487852
adds bgm. somewhat of a hacky solution (see comment)
Attocia Mar 3, 2019
eff00ae
fixed music, wasnt working on my machine
ravenkls Mar 3, 2019
0ad2a66
changed the music to something more annoying
ravenkls Mar 3, 2019
9139e46
howtoplay on readme
ravenkls Mar 3, 2019
78c25e6
the timer now displays itself in terms of lustrums
ravenkls Mar 3, 2019
04cea5f
finishing touches
ravenkls Mar 3, 2019
ebf7353
added size limits on grids because it crashed if the grid was less th…
ravenkls Mar 3, 2019
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
3 changes: 2 additions & 1 deletion .flake8
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
[flake8]
max-line-length=100
application_import_names=projectt
ignore=P102,B311,W503,E226,S311,W504,F821
exclude=__pycache__, venv, .venv, tests
exclude=__pycache__, venv, .venv, tests, resources.py
import-order-style=pycharm
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -102,3 +102,6 @@ venv.bak/

# mypy
.mypy_cache/

#Pycharm
.idea
4 changes: 3 additions & 1 deletion Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,11 @@ verify_ssl = true
flake8 = "*"

[packages]
pyqt5 = "*"

[requires]
python_version = "3.7"

[scripts]
lint = "python -m flake8"
lint = "python -m flake8"
start = "python -m project"
32 changes: 30 additions & 2 deletions Pipfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

35 changes: 29 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,40 @@ You should be using [Pipenv](https://pipenv.readthedocs.io/en/latest/). Take a l
* Running the application (assuming you use our project layout): `pipenv run start`

# Project Information

`# TODO`
Overjoyed Olaryngologists attempt at code jam 4... hope you like it

## Description

`# TODO`
Welcome to Minesweeper (but I want to die).
##### Features
- Very nice user interface
- Nice sound effects
- Functioning minesweeper game
- Customisable grid length / height

##### Real Features
- Each tile takes up to 100 clicks to destroy
- If you click too fast you get punished
- You have to type the settings in binary
- The time is measured in lustrums (period of 5 years)

And the music is lovely ;)

## Setup & Installation

`# TODO`
Very simple
```cmd
git clone https://github.com/ravenkls/code-jam-4.git
cd code-jam-4
pipenv install
pipenv run start
```

## How do I use this thing?

`# TODO`
Very intuitive so I don't think it will be that hard to understand.

Just run the program, enter the grid height and width in binary and then run the game.

You have to repeatedly click the mines to break them, you will see cracks form as visual feedback.

https://www.wikihow.com/Play-Minesweeper
29 changes: 29 additions & 0 deletions project/__main__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
from PyQt5.QtWidgets import QApplication
from PyQt5.QtCore import Qt, QUrl
from PyQt5 import QtMultimedia
from .gui import MinesweeperApp
from . import resources # noqa
import sys
import os


if __name__ == '__main__':
# For high DPI displays
QApplication.setAttribute(Qt.AA_EnableHighDpiScaling, True)

app = QApplication(sys.argv)

# This plays the background music in a continuous loop
music_file = os.path.join(os.path.dirname(__file__), 'background.mp3')
bgm_playlist = QtMultimedia.QMediaPlaylist()
bgm_playlist.addMedia(QtMultimedia.QMediaContent(
QUrl.fromLocalFile(music_file)))
bgm_playlist.setPlaybackMode(QtMultimedia.QMediaPlaylist.Loop)
bgm_player = QtMultimedia.QMediaPlayer()
bgm_player.setPlaylist(bgm_playlist)
bgm_player.play()

window = MinesweeperApp()
window.show()

sys.exit(app.exec_())
Binary file added project/background.mp3
Binary file not shown.
Loading