Commit fcb4ffe1 authored by Ari Trachtenberg's avatar Ari Trachtenberg
Browse files

public version

parent b9126b19
Loading
Loading
Loading
Loading
+3.89 MiB

File added.

No diff preview for this file type.

+160 −59
Original line number Diff line number Diff line
# Group 11
# EC327 Final Project - Group 11 - TetrTriDiMonoTris
---
## Summary
### Project type
Animated Game Android

### TL;DR
The non-copyright Tetris game implements a wider range of blocks with sizes that take 1-4 grid spots.

### Description
This Tetris-inspired game reimagines the classic puzzle experience by incorporating a wider variety of block shapes and sizes. Unlike traditional Tetris, where pieces consist of four grid cells, this version includes blocks of varying sizes, ranging from single-grid pieces to four-cell configurations, adding new layers of complexity and strategy. The game is designed with a retro aesthetic, featuring intuitive controls for an engaging user experience. Core features include dynamic score tracking, difficulties, controllable sound effects, responsive UI updates through observers, and essential functionalities like game pause and game over states. The project combines front-end design with a well-documented back-end, providing seamless integration and a polished user experience.

## Getting started
## Authors
### Group members

To make it easy for you to get started with GitLab, here's a list of recommended next steps.
YoAnZhao yoanzhao@bu.edu

Already a pro? Just edit this README.md and make it your own. Want to make it easy? [Use the template at the bottom](#editing-this-readme)!
DerekLee derekl07@bu.edu

## Add your files
JustinCheong justinfo@bu.edu

- [ ] [Create](https://docs.gitlab.com/ee/user/project/repository/web_editor.html#create-a-file) or [upload](https://docs.gitlab.com/ee/user/project/repository/web_editor.html#upload-a-file) files
- [ ] [Add files using the command line](https://docs.gitlab.com/ee/gitlab-basics/add-file.html#add-a-file-using-the-command-line) or push an existing Git repository with the following command:
MaxwellTsai tsaima@bu.edu

```
cd existing_repo
git remote add origin https://agile.bu.edu/gitlab/ec327-public-projects/2024/group-11.git
git branch -M master
git push -uf origin master
```
BryceHwang bryhwang@bu.edu

## Integrate with your tools
AlexanderChen afchen@bu.edu

- [ ] [Set up project integrations](https://agile.bu.edu/gitlab/ec327-public-projects/2024/group-11/-/settings/integrations)
### Roles
[The final version of the [role table](https://agile.bu.edu/fw/EC327/ProjectGroups#Roles ). ]

## Collaborate with your team
Table:
| Name | Project Lead | Front End | Back End Role 1 | Back End Role 2 | Documenter | Tester | Total |
|---|---|---|---|---|---|---|---|
| YoAn Zhao | 50% | 25% | 0% | 25% | 0% | 0% | 100 |
| Derek Lee | 0% | 0% | 0% | 75% | 0% | 25% | 100 |
| Justin Cheong | 25% | 25% | 0% | 0% | 50% | 0% | 100 |
| Maxwell Tsai | 25% | 50% | 0% | 0% | 25% | 0% | 100 |
| Alexander Chen | 0% | 0% | 75% | 0% | 0% | 25% | 100 |
| Bryce Hwang | 0% | 0% | 25% | 0% | 25% | 50% | 100 |
| Total | 100 | 100 | 100 | 100 | 100 | 100 | --- |

- [ ] [Invite team members and collaborators](https://docs.gitlab.com/ee/user/project/members/)
- [ ] [Create a new merge request](https://docs.gitlab.com/ee/user/project/merge_requests/creating_merge_requests.html)
- [ ] [Automatically close issues from merge requests](https://docs.gitlab.com/ee/user/project/issues/managing_issues.html#closing-issues-automatically)
- [ ] [Enable merge request approvals](https://docs.gitlab.com/ee/user/project/merge_requests/approvals/)
- [ ] [Set auto-merge](https://docs.gitlab.com/ee/user/project/merge_requests/merge_when_pipeline_succeeds.html)

## Test and Deploy
Justin

Use the built-in continuous integration in GitLab.
Project Lead: I was responsible for setting objectives with deadlines, monitoring progress, and adjusting team roles to ensure efficient project completion. I oversaw group dynamics, ensured attendance at meetings, reassigned tasks to address absences, and certify each member's contributions for the final submission.

- [ ] [Get started with GitLab CI/CD](https://docs.gitlab.com/ee/ci/quick_start/index.html)
- [ ] [Analyze your code for known vulnerabilities with Static Application Security Testing (SAST)](https://docs.gitlab.com/ee/user/application_security/sast/)
- [ ] [Deploy to Kubernetes, Amazon EC2, or Amazon ECS using Auto Deploy](https://docs.gitlab.com/ee/topics/autodevops/requirements.html)
- [ ] [Use pull-based deployments for improved Kubernetes management](https://docs.gitlab.com/ee/user/clusters/agent/)
- [ ] [Set up protected environments](https://docs.gitlab.com/ee/ci/environments/protected_environments.html)
Front-End Developer: I designed and implemented the game screen layout, including the game grid, score display, controls, and status messages like "Game Over" and "Game Paused." I integrated observers to sync the UI with game logic and styled the design with retro aesthetics to enhance the Tetris experience.

***
Documenter: I ensured comprehensive documentation for developers and users, including JavaDoc for all classes and methods, external code references, and detailed API specifications. I created user-facing guides explaining gameplay and features like pausing and game over, presented clearly with visual aids.

# Editing this README

When you're ready to make this README your own, just edit this file and use the handy template below (or feel free to structure it however you want - this is just a starting point!). Thanks to [makeareadme.com](https://www.makeareadme.com/) for this template.
Maxwell

## Suggestions for a good README
Project Lead: I organized in person group meetings as needed and as frequent as possible so that every member was kept in the loop about the state of the project and always knew what they had to work on until our next meeting. 

Every project is different, so consider which of these sections apply to yours. The sections used in the template are suggestions for most open source projects. Also keep in mind that while a README can be too long and detailed, too long is better than too short. If you think your README is too long, consider utilizing another form of documentation rather than cutting out information.
Front End Developer: Implemented the movement buttons, visual elements, and buttons for settings and rules pages. Also implemented new activities for the settings and rules pages, making sure they don’t conflict with ongoing events such as the background music or a currently running game. Additionally, I wrote the rules page and implemented the background music volume buttons on the settings page.

## Name
Choose a self-explaining name for your project.
Documenter: I comprehensively checked over my groupmates comments, making sure they followed the JavaDoc style notation, and filled in holes where I didn’t see any comments were made yet. Made sure that all comments were extensive yet concise.

## Description
Let people know what your project can do specifically. Provide context and add a link to any reference visitors might be unfamiliar with. A list of Features or a Background subsection can also be added here. If there are alternatives to your project, this is a good place to list differentiating factors.

## Badges
On some READMEs, you may see small images that convey metadata, such as whether or not all the tests are passing for the project. You can use Shields to add some to your README. Many services also have instructions for adding a badge.
Derek

## Visuals
Depending on what you are making, it can be a good idea to include screenshots or even a video (you'll frequently see GIFs rather than actual videos). Tools like ttygif can help, but check out Asciinema for a more sophisticated method.
Back End Developer: I implemented sound systems in our game screen, making sure that sounds would only play when the app was in use. I added the sound effects to other functions to let them play when specific activities in the game occurred. I also added the mute system in the settings page that oversees all sounds and mutes everything once toggled.

## Installation
Within a particular ecosystem, there may be a common way of installing things, such as using Yarn, NuGet, or Homebrew. However, consider the possibility that whoever is reading your README is a novice and would like more guidance. Listing specific steps helps remove ambiguity and gets people to using your project as quickly as possible. If it only runs in a specific context like a particular programming language version or operating system or has dependencies that have to be installed manually, also add a Requirements subsection.
Tester: I conducted routine tests on our game to check that all of our functions worked as expected and other functionality tests as per the request of group members. This included testing the user interface and buttons for functionality as well as smaller details like if music plays when the activity is switched.

## Usage
Use examples liberally, and show the expected output if you can. It's helpful to have inline the smallest example of usage that you can demonstrate, while providing links to more sophisticated examples if they are too long to reasonably include in the README.

## Support
Tell people where they can go to for help. It can be any combination of an issue tracker, a chat room, an email address, etc.
Alexander

## Roadmap
If you have ideas for releases in the future, it is a good idea to list them in the README.
Back End Developer: I was responsible for implementing the majority of the initial back-end framework. I implemented the classes responsible for representing the game board, representing the individual game blocks, drawing the game board, handling the game logic, and handling the interactions between the front end and back end. I also implemented the high score feature that allows the high score to be stored locally on devices.

## Contributing
State if you are open to contributions and what your requirements are for accepting them.
Tester: My contributions to testing mainly involved testing the back-end features that I implemented. For example, I tested things such as making sure the blocks fell properly, stopped falling when they were supposed to, disappeared/appeared when they were supposed to, etc. I also tested the high-score feature and behavior of the color and shape of the game pieces. 

For people who want to make changes to your project, it's helpful to have some documentation on how to get started. Perhaps there is a script that they should run or some environment variables that they need to set. Make these steps explicit. These instructions could also be useful to your future self.

You can also document commands to lint the code or run tests. These steps help to ensure high code quality and reduce the likelihood that the changes inadvertently break something. Having instructions for running tests is especially helpful if it requires external setup, such as starting a Selenium server for testing in a browser.
YoAn

## Authors and acknowledgment
Show your appreciation to those who have contributed to the project.
Project Lead: I did a lot of assigning the distribution of work, as well as managing the GitLab repository, merging branches, resolving merge-conflicts/communicating with other group members as to how to resolve merge conflicts. I also organized a lot of the brainstorming for the design choices, including the layout of the UI, the types of pieces that we would implement and the extra features that we added, and answering any questions about those features to ensure the group was on the same page about the product.

## License
For open source projects, say how it is licensed.
Front End Developer: I added in the buttons that were used to change the difficulty as well as the original layout of that we used for the game.

Back End Developer: I was responsible for adding in the C++ integration using JNI. I also implemented the scoring system (using c++) as well as the ability to change the difficulty. I also implemented the rotation feature of the pieces. I was responsible for a lot of the debugging, trying to eliminate possible crashes and incorrect game logic.


Bryce

Back End Developer: I added keybinds to the game block actions, setting only 4 keys to activate the movement. This made it easier and quicker to play the game. Found the non copyright songs that were implemented into the game. 

Documenter: Helped decipher the classes and data structures that made up our game’s logic. Utilized information learned into the Demo presentation and to further develop the additional features of the game.

Tester: Contributed many detailed reports on game bugs such as the relocation and disappearance of stable blocks. Made sure the movement actions resulted in specific increments based on the amount of times clicked. Added feedback and ideas on the different game pages.

---
## Accomplishments

### Minimum requirements
#### Completed
Moving graphical pieces.

The ability of the user to control some of the moving pieces through input.

Include a score that is changed based on the user satisfying requirements.

Have a simple-to-use, graphical user interface.

Provide clear documentation of the rules of the game.

Not require any Internet or network connectivity.

Not violate the copyright of Tetris or any other game.

#### Partially completed



### Possible features
#### Completed
Provide a high-score that persists when the app is closed and then reopened. [10%]

Allow the user to tweak the rules of the game being played. [10%]

Add sound effects for specific activities in the game. [10%]

Do all calculations in a lower-level language (C++). [20%]


#### Partially completed

---
## Execution

### Project source
### Installation
Note: Lab machines are not equipped to run the most recent version of Android Studio. 

Instead, the user can either use their personal laptop/computer or their Android phone if applicable. 

Android Studio Instructions:

Download the latest version of Android Studio

Open the Group11Project Gitlab repository

Stay in master branch

Code -> Download Source Code -> zip

Unzip: folder should be called “group11project-master”

In Android Studio, File -> Open, then select the folder

Wait for sync

Click the green triangle at the top right to run the game



Android Phone (APK) Instructions:

In a browser on your phone, open the Group11Project Gitlab repository

Stay in master branch

Locate the file called “app-debug-androidTest.apk”

Download the .apk file

Open the app

### Usage

Upon opening the app, the user is presented with the main screen which is the functioning TetrTriDiMonoTris game. The “START” button will begin the game and the first block will fall (Moving graphical pieces). This button is also used to restart the game once the user has lost and the game is finished. The “L”, “R”, “D”, and “ROT” buttons allow the user to move the falling blocks left, right, down, or rotate them respectively (user control). To make the game more friendly to users with a keyboard, we also implemented keybinds that correspond to each movement button. The left arrow key is mapped to “L”, the right arrow key to “R”, the down arrow key to “D”, and the “R” key is mapped to “ROT”. When the user scores by clearing a row, the number corresponding to “Score” on the top of the screen will update to reflect the new score (scoring) that is calculated in the backend using C++ calculations (lower level calculation). Above the score, we implemented a “High Score” that is stored locally on devices and updates at the end of each game only if necessary (high score). The “INC” and “DEC” buttons will increment or decrement the difficulty level, with 1 being the easiest, and 9 being the hardest (tweak rules). We set up the game so that the difficulty level can only be changed when the first game has yet to start or if the previous game has terminated. We have a background song that plays over the game, a sound effect for when the user scores, and a sound effect for when the game ends (sound effects). These sound effects can be altered on the settings page, which can be accessed by clicking the “SETTINGS” button at the bottom left-hand corner of the screen. This button brings the user to a separate screen, where there are “-” and “+” buttons corresponding to the Background Music Volume and a clickable switch that mutes both the Background Music and the sound effects. The “BACK” button brings the user back to the main page. There is also a rules page that can be accessed by clicking the “RULES” button at the bottom right-hand corner of the screen. This button brings the user to another separate screen where the rules of the game are clearly documented (rule documentation). There is also a “BACK” button that brings the user back to the main page. Together, our Animated Game is a fun and simple-to-use graphical interface that does not require network connectivity and does not violate the copyright of the original Tetris.

---
## Miscellaneous

### Extra features
No, we did not implement any more extra features into our app.

### Challenges

One of the major challenges with this project was the game logic. We especially had trouble when dealing with edge case rotations. Sometimes the blocks would disappear when we rotated them near the sides of the board.

Another challenge was implementing the score to be based on the number of lines cleared. Originally we simply had the score increment by one every time we saw a full row of blocks, so getting the program to know how many rows were cleared at once took some time. We ended up using an extra boolean value to be able to tell when the lines STOP clearing, and increment until they stop clearing to get the number of lines that need to be cleared. 

### Supporting material
Animated Game Presentation
Refer to the video demonstration provided in the repository.


### Release
Yes, we are comfortable with having this project visible to the broader public.

###
## Project status
If you have run out of energy or time for your project, put a note at the top of the README saying that development has slowed down or stopped completely. Someone may choose to fork your project or volunteer to step in as a maintainer or owner, allowing your project to keep going. You can also make an explicit request for maintainers.
+546 KiB

File added.

No diff preview for this file type.

app/.gitignore

0 → 100644
+1 −0
Original line number Diff line number Diff line
/build
 No newline at end of file

app/build.gradle

0 → 100644
+50 −0
Original line number Diff line number Diff line
plugins {
    id 'com.android.application'
}

android {
    namespace "com.group11project.tetris"
    compileSdk 31

    defaultConfig {
        applicationId "com.group11project.tetris"
        minSdk 26
        targetSdk 33
        versionCode 1
        versionName "1.0"

        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
        externalNativeBuild {
            cmake {
                cppFlags ''
            }
        }
    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
    externalNativeBuild {
        cmake {
            path file('src/main/cpp/CMakeLists.txt')
            version '3.22.1'
        }
    }
}

dependencies {

    implementation 'androidx.appcompat:appcompat:1.4.1'
    implementation 'com.google.android.material:material:1.5.0'
    implementation 'androidx.constraintlayout:constraintlayout:2.1.3'
    testImplementation 'junit:junit:4.13.2'
    androidTestImplementation 'androidx.test.ext:junit:1.1.3'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
}
 No newline at end of file
Loading