{"id":15912306,"url":"https://github.com/drgfreeman/minefield","last_synced_at":"2025-04-03T02:27:40.232Z","repository":{"id":130571441,"uuid":"88280217","full_name":"DrGFreeman/MineField","owner":"DrGFreeman","description":"A Minecraft game for the Raspberry Pi - Do not step on a land mine !!!","archived":false,"fork":false,"pushed_at":"2022-04-08T21:06:34.000Z","size":1802,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-08T16:41:30.178Z","etag":null,"topics":["buzzer","capture-the-flag","game","gpiozero","leds","minecraft","minecraft-pi","physical-computing","python","python-3","python3","raspberry","raspberry-pi","raspberry-pi-gpio"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/DrGFreeman.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-04-14T15:37:57.000Z","updated_at":"2023-02-22T08:17:47.000Z","dependencies_parsed_at":null,"dependency_job_id":"b61e8b77-3f07-40ee-8dc3-12e35e6366d2","html_url":"https://github.com/DrGFreeman/MineField","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DrGFreeman%2FMineField","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DrGFreeman%2FMineField/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DrGFreeman%2FMineField/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DrGFreeman%2FMineField/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DrGFreeman","download_url":"https://codeload.github.com/DrGFreeman/MineField/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246924244,"owners_count":20855692,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["buzzer","capture-the-flag","game","gpiozero","leds","minecraft","minecraft-pi","physical-computing","python","python-3","python3","raspberry","raspberry-pi","raspberry-pi-gpio"],"created_at":"2024-10-06T16:03:57.348Z","updated_at":"2025-04-03T02:27:40.199Z","avatar_url":"https://github.com/DrGFreeman.png","language":"Python","readme":"# MineField\nA game for the Minecraft Raspberry Pi edition.\n\nBy Julien de la Bruère-Terreault (drgfreeman@tuta.io)\n\n# Summary\n_MineField_ is a game programmed in Python for [Minecraft Pi edition](https://www.raspberrypi.org/learning/getting-started-with-minecraft-pi/) making use of\n[physical computing](https://www.raspberrypi.org/learning/physical-computing-with-python/)\nto control LEDs and a buzzer.\n\nThe player must find and destroy a [block of gold](http://minecraft.gamepedia.com/Block_of_Gold) then return to its starting point marked by a [glowing obsidian block](http://minecraft.gamepedia.com/Glowing_Obsidian).\n\nSimple? Not so much!!!\n\nThe issue is that the Minecraft world is strewn with invisible land mines that the player must avoid to stay alive. To help them, the player is equipped with a mine detector indicating the distance to the nearest mine. The mine detector consists of four LEDs that light depending on the distance to the nearest mine, as well as a buzzer that buzzes an increasing number of beeps as the player gets closer to a mine. With the help of the mine detector, the player must navigate around the mines to find the block of gold and return to the starting point.\n\nTry it out and _have a blast_!\n\n# Screenshots\n\n![Game start](/doc/img/start.png)\u003cbr\u003e*Game start instructions. Note the red glowing obsidian block. The player will need to return to this block after having destroyed the block of gold.*\n\n![Block of gold](/doc/img/gold.png)\u003cbr\u003e*The block of gold to be found and destroyed.*\n\n![Objective reached](/doc/img/objReached.png)\u003cbr\u003e*Objective reached, now safely return to the starting point.*\n\n![Succeeded](/doc/img/succeeded.png)\u003cbr\u003e*Destroy the glowing obsidian block at the start position to complete the mission.*\n\n![Oops!](/doc/img/boom.png)\u003cbr\u003e*Oops! Things do not always go according to plan...*\n\n# Installing the game\n\nMinecraft Pi edition is installed by default on the Raspberry Pi Raspbian distribution. There is therefore no need to install it.\n\nTo install the _MineField_ game, open a terminal on the Raspberry Pi and clone the game's [GitHub repository](https://github.com/DrGFreeman/MineField) with the following command:\n\n`git clone https://github.com/DrGFreeman/MineField.git`\n\n# Playing the game\n\nPrior launching the game, launch Minecraft Pi edition on the Raspbery Pi and enter the world of your choice.  See [Getting Started with Minecraft Pi](https://www.raspberrypi.org/learning/getting-started-with-minecraft-pi/worksheet/) in the [Raspberry Pi Learning Resources](https://www.raspberrypi.org/resources/) for an introduction to Minecraft Pi edition.\n\nBeware, mine explosions may create craters or damage constructions in the selected world. If you want to avoid any damage to your worlds, create a new world to play this game.\n\nHit the _TAB_ key to exit the Minecraft window.\n\nTo launch the game, open a terminal on the Raspbery Pi. Change to the MineField directory:\n\n`cd MineField`\n\nLaunch the `minefield.py` script using Python 3:\n\n`python3 minefield.py`\n\nDouble click in the Minecraft window to start playing.\n\nTo launch a new game, hit the _TAB_ key to exit the Minecraft window and relaunch the script in the terminal.\n\n# Making the mine detector\nThe mine detector has two indication methods, a distance scale made of four [LEDs](https://www.raspberrypi.org/learning/physical-computing-with-python/worksheet/) and an [active buzzer](https://www.raspberrypi.org/learning/physical-computing-with-python/buzzer/) emitting a number of beeps equal to the number of LEDs lit.\n\nThe connections are as per the circuit below. The positive (long) legs of the LEDs as well as the active buzzer positive pin are connected to the Raspberry Pi GPIO pins indicated in the table below. The negative (short) legs of the LEDs are connected to ground through 220 ohm resistors (or any value above 50 ohm). The buzzer ground pin is connected directly to ground. If using a breadboard as shown, the breadboard ground must be connected to one of the Raspberry Pi ground pins.\n\nDevice | GPIO pin\n-------|----------\nBlue LED | 17\nGreen LED | 27\nYellow LED | 22\nRed LED | 16\nBuzzer | 4\n\n![mine detector circuit](/doc/img/mineDetector_700px.png)\n\n# Notes\n\n* The game is designed to work with Python 3.\n* The game can be played without the buzzer _or_ LEDs. This may make it more difficult to avoid mines.\n* The game difficulty can be adjusted by changing the parameters below in the minefield.py file.\n\n    ```python\n    ########################################\n    ### Game settings\n    # Adjust these settings to control game difficulty level\n\n    # Distance thresholds for mine detector LEDs and buzzer\n    distBlue = 16\n    distGreen = 8\n    distYellow = 5\n    distRed = 3\n\n    # Distance threshold for mine explosion\n    distMineTrigger = 1 # The mine explodes if the player is within this distance\n\n    # Number of mines\n    nbMines = 200\n\n    # Extent of mine coverage around player (+/-)\n    extentMines = 100\n\n    # Distance to goal\n    goalDist = 40\n    ```\n\n# Version history\n1.0.0 (2017-04-16): Initial documented release\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdrgfreeman%2Fminefield","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdrgfreeman%2Fminefield","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdrgfreeman%2Fminefield/lists"}