From 1461507e68dc44e783b1ff050da32372e4353907 Mon Sep 17 00:00:00 2001 From: LC-jrx Date: Thu, 8 Jun 2023 14:33:22 +0200 Subject: [PATCH] all: added license to project README.md: finalized project description, added known bugs and license information --- LICENSE | 8 ++++++++ README.md | 39 ++++++++++++++++++++++++++++++++++----- brick_pong.py | 20 ++++++++++++++++++++ brick_snake.py | 20 ++++++++++++++++++++ detect_devices.py | 20 ++++++++++++++++++++ game_control.py | 20 ++++++++++++++++++++ main.py | 20 ++++++++++++++++++++ matrix_helper.py | 20 ++++++++++++++++++++ pixel_pics.py | 21 +++++++++++++++++++++ 9 files changed, 183 insertions(+), 5 deletions(-) create mode 100644 LICENSE diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..30d23ee --- /dev/null +++ b/LICENSE @@ -0,0 +1,8 @@ +Copyright <2023> + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +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. + diff --git a/README.md b/README.md index 57fd8eb..a7e425a 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,38 @@ # BrickBoyColor -*** -This project is about a fully working portable gaming console made from 100% pure LEGO® and Pybricks framework. +This project is about a fully working portable arcade gaming console made from 100% pure LEGO® and Pybricks framework. -## General Info *** -Basis for the project are the electronic components from LEGO® Spike Prime and elements from LEGO® Technic. The code is -written in Python/Micropython and is based upon [Pybricks](http://pybricks.com) project – thanks a lot! +### General Info +Basis for the project are the electronic components from LEGO® Spike Prime and elements from LEGO® Technic. The code is written in Python/Micropython and is based upon [Pybricks](http://pybricks.com) project – thanks a lot! + +### Games & How to play + +Currently two arcade games are implemented for the BrickBoyColor. The first game is the classic "Pong". The second one is the well-known game "Snake" from earlier Nokia phones. + + +#### Program control +The BrickBoyColor is controlled by the four buttons of the hub. The Bluetooth button serves as a stop and ends the whole program sequence. The center button serves as an input button and confirms the selected choice in menus. The selection itself is made using the two arrow keys. + +#### Game controls +After starting the games, the input is done via the two game controllers. + +In Snake, the left controller makes the snake turn left (counterclockwise). The right controller accordingly makes the snake turn to the right (clockwise). + +In Pong, the two controllers steer the left tennis racket. The left game controller makes the racket move to the left (i.e. upwards), right correspondingly to the right (i.e. downwards). The game controllers have a staggered sensitivity. A slight pressure moves the racket pixel by pixel. Stronger pressure on the controllers moves the racket two or more pixels in the respective direction. The right tennis racket is steered by the computer. + +### Known Bugs +#### Snake +No known bugs. +#### Pong +I: When a higher game speed aka difficulty level is selected, the movement of the ball is not correct and not predictable. Also, in this case, the rules for the upper and lower boundaries of the playing field do not work correctly. + +II: The "Hard Game" setting has no effect on the size of the tennis rackets at the low resolution of 6x6 pixels. + +### Future or possible expansion and further development +- more games like Tetris, Space Invaders or Pac Man +- wireless connection between two BrickBoyColor for multi-player games +- Extension of the BrickBoyColor to a stationary arcade machine + +### Licence +The BrickBoyColor, the BrickBoyColor software and the BrickBoyColor games are licensed under the [MIT License](LICENSE). \ No newline at end of file diff --git a/brick_pong.py b/brick_pong.py index b168512..d376a10 100644 --- a/brick_pong.py +++ b/brick_pong.py @@ -1,3 +1,23 @@ +""" +Arcade Game BrickPong for BrickBoyColor + +Copyright <2023> + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated +documentation files (the “Software”), to deal in the Software without restriction, including without limitation the +rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, +and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +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. + +""" + from pybricks.hubs import PrimeHub from pybricks.pupdevices import ForceSensor from pybricks.parameters import Port, Color diff --git a/brick_snake.py b/brick_snake.py index 2b45f7b..06855a9 100644 --- a/brick_snake.py +++ b/brick_snake.py @@ -1,3 +1,23 @@ +""" +Arcade Game BrickSnake for BrickBoyColor + +Copyright <2023> + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated +documentation files (the “Software”), to deal in the Software without restriction, including without limitation the +rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, +and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +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. + +""" + from pybricks.hubs import PrimeHub from pybricks.pupdevices import ForceSensor from pybricks.parameters import Port, Color diff --git a/detect_devices.py b/detect_devices.py index 0f27566..aa59b9b 100644 --- a/detect_devices.py +++ b/detect_devices.py @@ -1,3 +1,23 @@ +""" +Class Detect Devices used in BrickBoyColor project + +Copyright <2023> + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated +documentation files (the “Software”), to deal in the Software without restriction, including without limitation the +rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, +and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +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. + +""" + from pybricks.iodevices import PUPDevice from pybricks.parameters import Port from uerrno import ENODEV diff --git a/game_control.py b/game_control.py index 7d0406e..e2d8028 100644 --- a/game_control.py +++ b/game_control.py @@ -1,3 +1,23 @@ +""" +Class GameControl used in BrickBoyColor project + +Copyright <2023> + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated +documentation files (the “Software”), to deal in the Software without restriction, including without limitation the +rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, +and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +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. + +""" + from pybricks.hubs import PrimeHub from pybricks.parameters import Button, Color from pybricks.tools import wait diff --git a/main.py b/main.py index 86fadfd..00f8573 100644 --- a/main.py +++ b/main.py @@ -1,3 +1,23 @@ +""" +Main program for BrickBoyColor project + +Copyright <2023> + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated +documentation files (the “Software”), to deal in the Software without restriction, including without limitation the +rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, +and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +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. + +""" + from pybricks.hubs import PrimeHub from pybricks.parameters import Icon, Button from pybricks.tools import wait diff --git a/matrix_helper.py b/matrix_helper.py index e16d7fb..8eb36fe 100644 --- a/matrix_helper.py +++ b/matrix_helper.py @@ -1,3 +1,23 @@ +""" +Class MatrixHelper as used in BrickBoyColor project + +Copyright <2023> + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated +documentation files (the “Software”), to deal in the Software without restriction, including without limitation the +rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, +and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +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. + +""" + from pybricks.parameters import Color from pybricks.pupdevices import ColorLightMatrix from pybricks.tools import wait diff --git a/pixel_pics.py b/pixel_pics.py index 5d98a2c..0397f38 100644 --- a/pixel_pics.py +++ b/pixel_pics.py @@ -1,3 +1,24 @@ +""" +Small library of icons aka emojies used in BrickBoyColor project + +Copyright <2023> + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated +documentation files (the “Software”), to deal in the Software without restriction, including without limitation the +rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, +and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +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. + +""" + + class PixelPics: def __init__(self): self.smiley = ((0, 0), (1, 0), (0, 1), (1, 1), (4, 0), (5, 0), (4, 1),