You are on page 1of 8

App 6

Rock, Paper, Scissors App

Overview

The Rock, Paper, Scissors App will allow the user to play the Rock, Paper, Scissors game. This
App allows for only 1 player as he will be playing against the Phone. The game will be played
with the following images:

lion0.png cobra.png rabbit.png

Note that the rabbit image is facing right while the lion and cobra are facing to the left. Four total
images are provided for the lion that we will display them continuously (from lion0.png to
lion3.png) when the lion image is dragged (complete description of this property is described in
later section)

The game is played by the user selecting one of the animals above. The Phone will then
randomly select one of the animals as well. The rules for our game are as follows:

1. Lion defeats rabbit (lion can catch rabbit)


2. Cobra defeats lion (cobra can bite lion)
3. Rabbit defeats cobra (rabbit can outrun cobra)

Our game will extensively utilize view animation techniques. The main objective of our
game is to utilize the animation requirements as outlined in this document and
the game will be graded primarily on these animation properties.

Opening Display Screen

The following image contains the title that we want to display when this App starts:

The image should start out very small and then expand to cover the upper portion of the app.
This effect should be implemented as a zoom.
An example of the opening displays for this App illustrating the zoom effect is shown
below:

The title should then fade out gradually followed by the scoring labels fade in gradually as
shown below:

Jungleframe.png

lion0.png

cobra.png

rabbit.png

CustomizedView (MyView)
Hint: You will probably want to make the CustomizedView (e.g., MyView) cover the entire
display so you can collect coordinates from the entire display when dragging the animals
around the screen.

Note: It will probably be easier to build all the Animation Handling within the methods
Customized View class rather than MainActivity as illustrated during class.

The user can play the game by dragging one of the animal images into the blue rectangular
(i.e., jungle) region. The following requirements are applied when dragging the animals.

1. The animal must be completely dragged into the blue region in order to play.
2. The animal is moved gradually back to its original location if the animal is
dragged anyplace else other than the blue rectangular region.
3. Continuously display the 4 lion images when the lion image is dragged until the finger
is lifted off the screen.

Example screen captures of dragging the lion outside of the blue rectangular region are shown
below. Note how the lion images are continuously displayed through all 4 images as long as the
lion is being dragged.

The lion is placed back to its original location if it is not completely placed within the blue
rectangle. Be sure and display the original image by placing it back to its original location when
it is not dragged into the blue rectangle.

An example of dragging the the lion outside of the box is shown below (Note how the 4 images
are displayed continuously as long as the lion is dragged):

Upon lifting the finger off the lion, the lion is then placed back to its original location.
Suppose the lion is dragged completely into the blue rectangular region. An example of this is shown
below:

You will need to place the image at a fixed location once the dragging is complete - Do
not simply allow the image to reside wherever the player drags it!

As soon as the image is in place, the Phone will randomly select another animal and that
animal gradually fades in and is displayed to the left of the Player’s animal. An example
of the Phone selecting the rabbit is shown below (Important: The animals must face
each other)

The winning animal will then move towards the loosing animal. In this case the lion is
the winning animal.

\Lion next moves gradually toward rabbit once


the rabbit is fully visible
Rabbit
initiall
y Fades
in
gradual
ly
The steps are summarized below:

1. The rabbit fades into the blue rectangular region at a fixed location on the left side of the
region. The rabbit must face the lion.

2. The lion defeats the rabbit, so it gradually moves towards the rabbit and gradually covers the
rabbit completely (see screen captures below).

3. The Rabbit gradually fades out and the lion is the only object that appears.

4. The label indicating the result gradually fades in as the lion is left as the only object as shown
below:

This textView will fade in


gradually after the lion has moved
over the rabbit

5. Next the score for the player will be incremented by 1 and the textview will fadeout
gradually.

6. The lion is next displayed back to the right ready to play again.

The result of these steps are shown below:

textview will fadeout gradually

At this point, the player is ready to select another animal and play again.
A tie results when the Phone selects the same animal as the player.
No points are awarded.

An example of a tie for the cobra or rabbit is shown below.

The Phone’s animal fades in gradually as before.

Note how the cobras (or rabbits) face each other as shown below:

Phone’s cobra gradually fades in Both cobras and textview


Tie! gradually fades in Cobra displayed
then fade out at the same back to the right.
time Ready to play again
Both animals and “Tie!” fade out gradually at the same time.
The animal on the right will then be displayed back to its original location.

Rabbit example

The player loses if the Phone chooses an animal that defeats the one that he selected. An example of a
losing play is shown below:

The player chose rabbit and dragged it into the right of the box and the rabbit is then displayed at its
standard position
The phone chose lion and faded in gradually on the left.

The message indicating the result is:

Lion defeats Rabbit – You Lose!

The steps are summarized below:

1. The player chose the rabbit and the Phone chose the lion.

2. The lion will gradually fade in and then move from the left to the right and then completely cover
the rabbit.

3. The rabbit will gradually fade out

4. The score is incremented for the Phone, the label indicating the result textview gradually fades in..

5. The result textview gradually fades out and the rabbit is displayed back to its original location.

Testing on Emulators
Test your app on the following Virtual Devices:

You will need to test your App on each emulator and assure that the App runs properly on all 4 emulators.

What you Submit

You should name your Android project App6. Zip up the entire Android project. Submit the zip file
via Blackboard.

Grading
It’s important to provide the core animation functionality of the App as specified in this document. You will
not be graded on how identical your App’s graphics is to the example. Feel free to use different
backgrounds, different options, and different layouts too if you like.

Be sure and provide the core animation requirements as described in this document. Be sure and
test your App on another machine to assure that it runs properly.

You might also like