Coder Social home page Coder Social logo

afonsojramos / rpsparty Goto Github PK

View Code? Open in Web Editor NEW
0.0 4.0 0.0 65.16 MB

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

Java 98.43% HTML 0.91% JavaScript 0.01% CSS 0.64%
android game mini-game rock-paper-scissors feup lpoo feup-lpoo

rpsparty's Introduction

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

rpsparty's People

Contributors

afonsojramos avatar beatrizbaldaia avatar

Watchers

 avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.