You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+25-25Lines changed: 25 additions & 25 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,5 @@
1
1
# Computer games design based on the application of a microcontroller
2
-
This software was developed as a result of my Bachelor Thesis titled "Computer games design based on the application of a microcontroller" under the mentorship of [Assoc. Prof. Nadica Miljković](https://www.etf.bg.ac.rs/en/faculty/staff/nadica-miljkovic-4323) from the [University of Belgrade - School of Electrical Engineering](https://www.etf.bg.ac.rs/en) defended on September 24, 2024.
2
+
This software was developed as a result of my Bachelor Thesis titled "Computer games design based on the application of a microcontroller" (srp. _Реализација рачунарских игара заснована на примени микроконтролера_) under the mentorship of [Assoc. Prof. Nadica Miljković](https://www.etf.bg.ac.rs/en/faculty/staff/nadica-miljkovic-4323) from the [University of Belgrade - School of Electrical Engineering](https://www.etf.bg.ac.rs/en) defended on September 24, 2024.
3
3
4
4
A video that demonstrates all the features of the finished project is available on [YouTube](https://www.youtube.com/) (Google LLC, San Bruno, California, USA) and it can be accessed via the following [link](https://youtu.be/TDOLidR57ME).
5
5
@@ -12,18 +12,18 @@ A video that demonstrates all the features of the finished project is available
12
12
13
13
***
14
14
### 1. Introduction
15
-
The goal of this project was to build a fully functional game console using some of the simplest hardware components available and to program a set of games that could be played on it. An [Arduino](https://www.arduino.cc/) microcontroller board was used as the core of the console to execute source code and to communicate with all of the used components. The console supports single-player and two-player versions of the following games:
15
+
The goal of this project was to build a fully functional game console using some of the simplest and low-cost hardware components available, as well as to program a set of games. An [Arduino](https://www.arduino.cc/)UNO microcontroller board was used as the core of the console to execute source code. The console supports single-player and two-player versions of the following games:
The games themselves are not original, but their implementations were developed independently in [C++](https://isocpp.org/) programming language without seeking other people's ideas or solutions. In order to make the code more readable and to simplify the management of individual components, some additional libraries were also manually written. However, the source code does rely on the following list of public libraries and header files as well, in their original forms:
21
-
+[LedControl library](http://wayoda.github.io/LedControl/index.html) - Developed by [Eberhard Fahle](https://github.com/wayoda), accessed on November 8, 2024
22
-
+[pitches.h file](https://github.com/arduino/arduino-examples/blob/main/examples/02.Digital/toneMelody/pitches.h) - Part of an Arduino built-in example, accessed on November 8, 2024
20
+
The games are not original by design, but their implementations were developed independently in [C++](https://isocpp.org/) programming language without seeking other people's ideas or solutions. In order to make the code more readable and to simplify the management of individual components, some additional libraries were also manually written. However, the source code does rely on the following list of public libraries and header files as well, in their original forms:
21
+
+[LedControl library](http://wayoda.github.io/LedControl/index.html) - Developed by [Eberhard Fahle](https://github.com/wayoda), Accessed on November 8, 2024
22
+
+[pitches.h file](https://github.com/arduino/arduino-examples/blob/main/examples/02.Digital/toneMelody/pitches.h) - Part of an Arduino built-in example, Accessed on November 8, 2024
23
23
24
-
The code also uses functionalities provided by libraries that are an integral part of the Arduino UNO R3 microcontroller board and, as such, these libraries are not a part of this repository (e.g. [Arduino.h](https://github.com/arduino/ArduinoCore-avr/blob/master/cores/arduino/Arduino.h), [avr/progmem.h](https://github.com/avrdudes/avr-libc/blob/main/tests/simulate/progmem.h) and [stdint.h](https://github.com/codebendercc/arduino-core-files/blob/master/v102/hardware/tools/avr/lib/avr/include/stdint.h)).
24
+
The code also uses functionalities provided by libraries that are an integral part of the UNO R3 microcontroller board and, as such, these libraries are not a part of this repository (_e.g._,[Arduino.h](https://github.com/arduino/ArduinoCore-avr/blob/master/cores/arduino/Arduino.h), [avr/progmem.h](https://github.com/avrdudes/avr-libc/blob/main/tests/simulate/progmem.h) and [stdint.h](https://github.com/codebendercc/arduino-core-files/blob/master/v102/hardware/tools/avr/lib/avr/include/stdint.h)).
25
25
26
-
**DISCLAIMER:** Although the project as a whole is under the [GNU GPL (General Public License) Version 3+ license](https://github.com/aleva147/Arduino-Game-Console/blob/main/LICENSE), the [LedControl](http://wayoda.github.io/LedControl/index.html) library has its own [license](https://github.com/aleva147/Arduino-Game-Console/blob/main/libraries/Display/LICENSE) located in the [Libraries/Display directory](https://github.com/aleva147/Arduino-Game-Console/tree/main/libraries/Display). It is important to read this license and to follow its obligations should you choose to work on this project.
26
+
**DISCLAIMER:** Although the project as a whole is shared under the [GNU GPL (General Public License) Version 3+ license](https://github.com/aleva147/Arduino-Game-Console/blob/main/LICENSE), the [LedControl](http://wayoda.github.io/LedControl/index.html) library has its own [license](https://github.com/aleva147/Arduino-Game-Console/blob/main/libraries/Display/LICENSE) located at the [Libraries/Display directory](https://github.com/aleva147/Arduino-Game-Console/tree/main/libraries/Display). It is important to read this license and to follow its obligations, in case of further work on this project.
27
27
28
28
This repository contains:
29
29
+[Console](https://github.com/aleva147/Arduino-Game-Console/tree/main/Console) directory in which the main Arduino sketch ([Console.ino](https://github.com/aleva147/Arduino-Game-Console/blob/main/Console/Console.ino)) is located
@@ -45,29 +45,29 @@ Software:
45
45
+ Arduino IDE
46
46
47
47
Hardware:
48
-
+ Arduino UNO R3
48
+
+ Arduino UNO or UNO R3
49
49
+ USB 2.0 cable type A/B
50
50
+ Breadboard
51
51
+ Analog joystick (x2)
52
52
+ 8x8 LED matrix display with the MAX72XX driver [1] (x2)
53
53
+ Passive buzzer
54
54
+ Jumper wire male to male (x9)
55
55
+ Jumper wire male to female (x15)
56
-
+ Resistor (not necessary)
56
+
+ Resistor (optional)
57
57
58
-
The image below shows how the hardware should be assembled. It was created using [Wokwi](https://wokwi.com/)[2]. Since the identifiers of the used pins are not very clear on the image, pin identifiers can also be found inside the [Constants.h file](https://github.com/aleva147/Arduino-Game-Console/blob/main/libraries/Constants/Constants.h) which is located in the [libraries/Constants directory](https://github.com/aleva147/Arduino-Game-Console/tree/main/libraries/Constants).
58
+
The image below shows how the hardware should be assembled. It was created using [Wokwi](https://wokwi.com/)[2]. Since the identifiers of the used pins are not clearly presented in figure, pin identifiers can also be found inside the [Constants.h file](https://github.com/aleva147/Arduino-Game-Console/blob/main/libraries/Constants/Constants.h) which is located in the [libraries/Constants directory](https://github.com/aleva147/Arduino-Game-Console/tree/main/libraries/Constants).
In order to run the available source code on your hardware, follow these steps:
62
+
To run the available source code Arduino UNO or UNO R3 hardware, following steps are requires:
63
63
+ Download the code as a ZIP archive and extract its contents.
64
-
+ Move the [Console.ino](https://github.com/aleva147/Arduino-Game-Console/blob/main/Console/Console.ino) file to the directory where your Arduino IDE stores its sketches (this location can be found by opening Arduino IDE and clicking on File/Preferences).
65
-
+ Copy all of the downloaded [library folders](https://github.com/aleva147/Arduino-Game-Console/tree/main/libraries) to the libraries subfolder inside of the directory where Arduino IDE stores its sketches.
66
-
+ Connect the Arduino UNO microcontroller board with your computer, open the copied Console.ino sketch in Arduino IDE and upload the sketch to the board.
64
+
+ Move the [Console.ino](https://github.com/aleva147/Arduino-Game-Console/blob/main/Console/Console.ino) file to the directory where Arduino IDE stores sketches (this location can be found by opening Arduino IDE and clicking on File/Preferences).
65
+
+ Copy all of the downloaded [library folders](https://github.com/aleva147/Arduino-Game-Console/tree/main/libraries) to the libraries subfolder inside of the directory where Arduino IDE stores sketches.
66
+
+ Connect the Arduino UNO microcontroller board with computer, open the copied Console.ino sketch in Arduino IDE and upload the sketch to the board.
67
67
68
68
References:<br>
69
-
[1] MAX72XX drivers are manufactured by Maxim Integrated (San Jose, California, USA).<br>
70
-
[2] Wokwi is a web simulator for embedded and IoT systems that assists in learning and planning embedded device interactions and programming. It is developed and operated by CodeMagic Ltd.
69
+
[1] MAX72XX drivers are manufactured by the Maxim Integrated (San Jose, California, USA).<br>
70
+
[2] Wokwi is a web simulator for embedded and IoT (Internet of Things) systems that assists in learning and planning embedded device interactions and programming. It is developed and operated by CodeMagic Ltd.
71
71
72
72
***
73
73
### 3. User Interface Overview
@@ -80,37 +80,37 @@ The following image represents the main menu:
On the left half of the screen, there is a drawing of an arrow facing up and an arrow facing down. This is an indication to the user that it is possible to scroll through the list of available games by aiming either of the two joysticks up or down. A short looping animation of the currently selected game is displayed on the right half of the screen. In order to confirm the currently selected game and to advance to the player selection menu, move one of the joysticks to the right.
83
+
On the left half of the screen, there is a drawing of an arrow facing up and an arrow facing down. This is an indication to the user that it is possible to scroll through the list of available games by aiming either of the two joysticks in up or down directions. A short looping animation of the currently selected game is displayed on the right half of the screen. To confirm currently selected game and to advance to the player selection menu, one of the joysticks should be moved to the right.
84
84
85
85
The image below represents the player selection menu:
Every game can be played by either one or two players. Change the number of players by moving one of the joysticks up or down. To confirm the selected number of players and to start the game, aim either of the two joysticks to the right.
89
+
All games can be played by either one or two players. Change the number of players by moving one of the joysticks up or down. To confirm the selected number of players and to start the game, aim either of the two joysticks to the right.
90
90
91
91
The next image shows what the single-player version of each game looks like:
Before the selected game begins, a short countdown is always shown to let the players get ready. After the end of the game, the achieved score is shown on the screen and users can either return to the main menu by aiming one of the joysticks to the left, or play the game again by aiming either joystick to the right. The specific controls for both versions of every available game are explained in the next chapter of this document.
95
+
Before the selected game begins, a short countdown is always shown to let the players get ready. After the end of the game, the achieved score is shown on the screen and users can either return to the main menu by aiming one of the joysticks to the left, or play the game again by aiming either joystick to the right. The specific controls for both versions of available games are explained in the next chapter of this document.
96
96
97
97
***
98
98
### 4. Game Controls
99
99
100
100
#### Snake
101
-
The snake will always spawn near the bottom-left corner of the screen and its initial direction will be to the right. Use the left joystick to change the direction in which the snake is heading. If the joystick is aimed diagonally, the game won't know whether to change the snake's horizontal or vertical direction, and the snake will just continue heading in its current direction. So, make sure to aim the joystick as precisely as possible to avoid undetected commands. If the snake runs into one of the walls or into its own body, the player will lose and the game will end. The player will win if he/she collects 127 apples.
101
+
The snake will always spawn near the bottom-left corner of the screen and its initial direction will be to the right. Use the left joystick to change the direction in which the snake is heading. If the joystick is aimed diagonally, the game will not know whether to change the horizontal or vertical direction of the snake, so the snake will just continue heading in its current direction. Therefore, make sure to aim the joystick as precisely as possible to avoid undetected commands. If the snake runs into one of the walls or into its own body, the player will lose and the game will end. The player will win if he/she collects 127 apples.
102
102
103
-
In case of a two-player game, the second snake will always spawn near the bottom left corner of the right half of the screen and its initial direction will also be to the right. Use the right joystick to control the second snake's movement. The snakes must avoid each other while trying to collect the apples together. The game will end in victory if the total length of the two snakes is the greatest possible (128).
103
+
In case of a two-player game, the second snake will always spawn near the bottom left corner of the right half of the screen and its initial direction will also be to the right. Use the right joystick to navigate the second snake movements. The snakes must avoid each other while trying to collect the apples together (collaborative multi-player approach). The game will end in victory if the total length of the two snakes is the greatest possible (128).
104
104
105
105
#### Pong
106
-
When playing a single-player game, use the left joystick to move the racket along the left border of the screen by aiming the joystick up or down. It's important to keep the joystick aimed in the desired direction until the racket moves to a new position. Otherwise, if you only quickly push the joystick up or down and then let go, the movement won't be registered and the racket will stay in place. Unlike the other games, Pong has multiple rounds. This means that the game will end once someone reaches 3 points and only then will it be possible to return to the main menu or to start a new game.
106
+
When playing a single-player game, use the left joystick to move the racket along the left border of the screen by aiming the joystick up or down. It is important to keep the joystick aimed in the desired direction until the racket moves to a new position. Otherwise, if you only quickly push the joystick up or down and then let go, the movement will not be registered and the racket will stay in place. Unlike the other games, Pong has multiple rounds. This means that the game will end once someone reaches 3 points and only then it will be possible to return to the main menu or to start a new game.
107
107
108
-
The same rules apply for the two-player version of the game as well. The racket on the right half of the screen is controlled by the second player using the right joystick.
108
+
The same rules apply for the two-player version of the game. The racket on the right half of the screen is controlled by the second player using the right joystick.
109
109
110
110
#### Flappy Bird
111
-
Every time the left joystick is clicked, the bird will fly up by one pixel and its falling speed will reset to the initial value. The longer the joystick isn't pressed, the faster the bird falls. If the bird hits any of the incoming pipes or if the bird falls beneath the bottom border of the screen, the player will lose. To achieve victory, the bird needs to successfully pass through 50 obstacles. The game is intentionally hard, but there are no impossible pairs of incoming obstacles.
111
+
Each time the left joystick is clicked, the bird will fly up by one pixel and its falling speed will reset to the initial value. The longer the joystick is not pressed, the faster the bird falls. If the bird hits any of the incoming pipes or if the bird falls beneath the bottom border of the screen, the player will lose the game. To achieve victory, the bird needs to successfully pass through 50 obstacles. The game is intentionally hard, but there are no impossible pairs of incoming obstacles.
112
112
113
-
In the two-player version, each player has his/hers own bird and the birds need to pass through the incoming pipes together. To control the second bird, use the right joystick. The game will be harder for the second player since the second bird is closer to the right edge of the screen and there is less time to react. If either of the two birds collides with an obstacle or falls through the bottom border of the screen, the game ends for both players.
113
+
In the two-player version, each player has his/hers own bird and the birds are required to pass through the incoming pipes together (collaborative multi-player approach). To control the second bird, use the right joystick. The game will be harder for the second player since the second bird is closer to the right edge of the screen and there is less time to react. If either of the two birds collides with an obstacle or falls through the bottom border of the screen, the game ends for both players.
0 commit comments