Skip to content
This repository has been archived by the owner on Apr 4, 2022. It is now read-only.
/ RPSParty Public archive

Repository created for the final project of the "Laboratório de Programação Orientada por Objectos" class - LPOO

Notifications You must be signed in to change notification settings

afonsojramos/RPSParty

Repository files navigation

RPS PARTY Final Delivery

Setup

Install the .apk file provided which is located inside the android folder and is named "android-release.apk".

Development Documentation

Updated UML

UML

(In more detail inside the file UML.pdf located in the root.)

Design Patterns

Singleton: Ensure a class has only one instance, and provide a global point of access to it. In our project we use it in the controller and model classes.

State: Allow an object to alter its behavior when its internal state changes. The object will appear to change its class. In our project we use on GameScreen because we have a stage when the players have to choose an option and then another stage that will draw the result of the match between the players' choices. So, in the same class, the methods can change their behaviour.

Template Method:Define the skeleton of an algorithm in an operation, deferring some steps to client subclasses. Template Method lets subclasses redefine certain steps of an algorithm without changing the algorithm's structure. In our project we use it in the abstract classes EntityModel, EntityView and EntityButton.

Observer: Define a one-to-many dependency between objects so that when one object changes state, all its dependents are notified and updated automatically. Encapsulate the core (or common or engine) components in a Subject abstraction, and the variable (or optional or user interface) components in an Observer hierarchy. In our project we use it as we apply the Model-View-Controller architecture pattern and, consequently, the View corresponds to the Observer.

Major Difficulties Along the Way

  • Code structure planning;

  • Communication between sockets;

  • Adjust the textures to the right coordinates on the screen.

Lessons Learned

  • Do a lot of research as new concepts come up;

  • See sample code extracts as a good way to learn;

  • Write the plan on paper before starting coding;

  • Ask for help, but always try to resolve it by yourself at first;

  • Collaborating with people from others courses to help with the design of the app.

Overall Time Spent Developing

Around 120 hours.

Work Distribution Amongst Team Members

50-50

User Manual

Splash Screen.

SplashScreen

You can choose to start a Party (game) or to join one.

MainMenuS

If you have pressed “START PARTY” you IP is shown and you also need to choose the number of sets that your game will have.

StartParty

If you have pressed “JOIN PARTY” you have to insert your opponent IP to join his party (game).

JoinParty

ServerIP

As the game starts you have to choose between rock, paper or scissors (one of the three buttons).

RPS

After you and your opponent choose one option, you have to shake your phone 3 times so yours options are launched in both screens (and then collide).

collision

If you win a set you are marked with X, otherwise you are marked with a check mark.

Results

If it’s a tie, you have to play a thematic mini game against you opponent. Rock Mini Game: Tap the rocks to destroy them. They can be empty or have a coin. Earn as much coins as you can (each coin is one point).

RockGame

Paper Mini Game: Drag off a roll of toilet paper

PaperGame

Scissors Mini Game: Draw the symmetry as accurately as possible.

ScissorsGame

Every mini game has a limited time to be concluded. You can also see a quick explanation of the mini games in the Main Menu if click on the button in the upper right corner:

Help

RPS PARTY Intermediate Checkpoint

Behavioural Aspects

Behavioural Aspects

UML

UML

Design Patterns

Singleton: Ensure a class has only one instance, and provide a global point of access to it. In our project we use it in the controller and model classes.

State: Allow an object to alter its behavior when its internal state changes. The object will appear to change its class. In our project we use on GameScreen because we have a stage when the players have to choose an option and then another stage that will draw the result of the match between the players' choices. So, in the same class, the methods can change their behaviour.

Template Method:Define the skeleton of an algorithm in an operation, deferring some steps to client subclasses. Template Method lets subclasses redefine certain steps of an algorithm without changing the algorithm's structure. In our project we use it in the abstract classes EntityModel, EntityView and EntityButton.

Observer: Define a one-to-many dependency between objects so that when one object changes state, all its dependents are notified and updated automatically. Encapsulate the core (or common or engine) components in a Subject abstraction, and the variable (or optional or user interface) components in an Observer hierarchy. In our project we use it as we apply the Model-View-Controller architecture pattern and, consequently, the View corresponds to the Observer.

Tests

1 To the correct transition between screens, depending on the button pressed;

2 To the correct attribution of points to the winner player;

3 To the game’s physic (correct objects’ trajectory taking into account their weight, the clash between two objects whose coordinates intersect, etc.);

4 To the correct socket creation nad correct connection of the “cliente” (second player) to the socket created by the “server” (first player);

5 To the mobile phone’s shake correct detection.

Mock App

Main Menu

Join

Create

Choices

Create

Fight

Rock

Paper

Scissors

Win

Made by @afonsojramos and @BeatrizBaldaia

About

Repository created for the final project of the "Laboratório de Programação Orientada por Objectos" class - LPOO

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

 

Packages

 
 
 

Languages