diff --git a/.idea/gradle.xml b/.idea/gradle.xml
index 4b70700..aa704fc 100644
--- a/.idea/gradle.xml
+++ b/.idea/gradle.xml
@@ -13,12 +13,7 @@
-
+
diff --git a/app/build.gradle b/app/build.gradle
index b9b0e82..b41795c 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -22,5 +22,5 @@ android {
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
- compile 'com.android.support:appcompat-v7:23.0.0'
+ compile 'com.android.support:appcompat-v7:23.0.1'
}
diff --git a/app/src/ReadmeAdventureGame.txt b/app/src/ReadmeAdventureGame.txt
new file mode 100644
index 0000000..8dccc31
--- /dev/null
+++ b/app/src/ReadmeAdventureGame.txt
@@ -0,0 +1,37 @@
+Readme.txt for Adventure Game for final turn in
+
+Contributers
+Christian Gumacal
+Nina Ly
+Kevin Nguyen
+
+Description
+This application is going to be a game where the user picks the actions that will continue the story. The purpose of the game is entertainment while testing the user’s reasoning skills, attention to detail, and ability to take clues and use them in ways that will allow them to gain more points. The game will be played out as choices given to the user that will lead them to another set of choices. The game will seem straight-forward at first but if the user only chooses their actions from the first ones seen they will realize that they will not get very far. Many of the choices will also have clues in the panel that would lead them to performing a secret action and continue the game in a way that was not previously available to them. The goal is to make a game that the user will want to continue playing to find all the secret actions and ultimately get all the points on the way to the end goal. This is how our game is going to be interesting and entertaining.
+
+Version 1.0
+ First version of the product, features still being implemented but skeleton and all logic is done
+and in the process of implementation
+
+Version 1.1
+ Second version of the game that has complete implementation of game logic and screens. Replaced having multiple
+Screens for different parts of the game with 1 main activity. Completed the shared preferences and saving data. Completed the game
+over screen that is different depending on when in the story you died and displaying points. Also added 2 fight sequences to the ending
+of the game depending on the path you decided to follow. The fight sequence uses a random number generator to determin what action your enemy is taking
+and you must react accordingly or else you will take damage.
+
+Itemized list of Tasks done
+Task Contributer responsible % finished Time (hours)
+Create Start Menu Christian 100 3
+Create Story part 1-3 Christian 100 8
+Psuedo Code logic Christian 100 4
+Create layouts part 1 Nina 100 8
+Create layouts part 2 Kevin 100 5
+Create layouts part 3 Christian 100 6
+Implement logic part 1 Nina 100 10
+Implement logic part 2 Kevin 100 10
+Implement logic part 3 Christian 100 10
+Create Gameover Screen Christian 100 4
+Combining parts into 1 Kevin 100 4
+
+
+
diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
index 7c438c7..ffc105d 100644
--- a/app/src/main/AndroidManifest.xml
+++ b/app/src/main/AndroidManifest.xml
@@ -4,7 +4,7 @@
@@ -17,13 +17,12 @@
-
+
-
diff --git a/app/src/main/R.-web.png b/app/src/main/R.-web.png
new file mode 100644
index 0000000..aaac1f6
Binary files /dev/null and b/app/src/main/R.-web.png differ
diff --git a/app/src/main/java/com/example/ninaly/adventuregame453/Cave.java b/app/src/main/java/com/example/ninaly/adventuregame453/Cave.java
deleted file mode 100644
index c6a3f58..0000000
--- a/app/src/main/java/com/example/ninaly/adventuregame453/Cave.java
+++ /dev/null
@@ -1,402 +0,0 @@
-package com.example.ninaly.adventuregame453;
-
-import android.app.Activity;
-import android.content.Intent;
-import android.content.SharedPreferences;
-import android.content.pm.ActivityInfo;
-import android.content.res.Configuration;
-import android.hardware.Sensor;
-import android.hardware.SensorEvent;
-import android.hardware.SensorEventListener;
-import android.hardware.SensorManager;
-import android.os.Build;
-import android.os.Bundle;
-import android.support.v7.app.AppCompatActivity;
-import android.util.FloatMath;
-import android.view.Display;
-import android.view.Gravity;
-import android.view.Surface;
-import android.view.View;
-import android.view.WindowManager;
-import android.widget.Button;
-import android.widget.ImageView;
-import android.widget.RelativeLayout;
-import android.widget.TextView;
-import android.widget.Toast;
-import java.util.Calendar;
-
-public class Cave extends Activity implements SensorEventListener {
- public static final String Data = "Progress_Data";
- int points, evilPoints, progress;
- private boolean lantern, sword, emerald, key, treasure;
- private SensorManager mSensorManager;
- private Sensor mAccelerometer;
- private long curTime, lastUpdate;
- private float x, y, z, last_x, last_y, last_z;
- private final static long UPDATEPERIOD = 300;
- private static final int SHAKE_THRESHOLD = 800;
- private boolean lit = false;
- SharedPreferences progressData;
-
-
- // int[] part2Layouts = {R.layout.cavebeginning, R.layout.ogrecave, R.layout.sneakaround, R.layout.keepsneaking, R.layout.attackogrewithsword, R.layout.keepattacking, R.layout.attackogrewithoutsword, R.layout.night,
-// R.layout.sneakintothecave, R.layout.killtheogreinhissleep, R.layout.regularcave, R.layout.darkcave, R.layout.travelforwardwithoutlight, R.layout.run, R.layout.travelforwardwithlight, R.layout.key, R.layout.highupcave,
-// R.layout.throwswordtocuttherope, R.layout.jump, R.layout.changeorientation, R.layout.walkacross, R.layout.opendoor, R.layout.usekey, R.layout.picklock, R.layout.cavewithbreeze};
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- progressData = getSharedPreferences(Data, 0);
- points = progressData.getInt("points", 0);
- evilPoints = progressData.getInt("evilPoints", 0);
- progress = progressData.getInt("storyProgress", 0);
- lantern = progressData.getBoolean("lantern", true);
- sword = progressData.getBoolean("sword", true);
- emerald = progressData.getBoolean("emerald", false);
- key = progressData.getBoolean("key", true);
- treasure = progressData.getBoolean("treasure", false);
- setContentView(R.layout.cavebeginning);
- mSensorManager = (SensorManager)getSystemService(SENSOR_SERVICE);
- mAccelerometer = mSensorManager.getDefaultSensor(Sensor.TYPE_ACCELEROMETER);
- curTime = lastUpdate = (long) 0.0;
- x = y = z = last_x = last_y = last_z = (float) 0.0;
-
-
- }
-
- public void checkIfItsNight() {
- int currentHour = Calendar.getInstance().get(Calendar.HOUR_OF_DAY);
- if(currentHour >= 18) {
- setContentView(R.layout.night);
- }
- }
-
- public void onClick(View view){
- switch(view.getId()) {
- case R.id.hint1:
- Toast toast = Toast.makeText(this, "I sense the presense of a vile being in one of the caves. -Fairy", Toast.LENGTH_LONG);
- toast.setGravity(Gravity.TOP | Gravity.LEFT, 0, 0);
- toast.show();
- break;
- case R.id.ogrecave:
- setContentView(R.layout.ogrecave);
- checkIfItsNight();
- break;
- case R.id.regularcave:
- setContentView(R.layout.regularcave);
- Button button = (Button) findViewById(R.id.highupcave);
- break;
- case R.id.hint2:
- Toast toast2 = Toast.makeText(this, "You can pause and resume gameplay later. -Fairy", Toast.LENGTH_LONG);
- toast2.setGravity(Gravity.TOP | Gravity.LEFT, 0, 0);
- toast2.show();
- break;
- case R.id.sneakaround:
- setContentView(R.layout.sneakaround);
- checkIfItsNight();
- break;
- case R.id.hint3:
- Toast toast3 = Toast.makeText(this, "He saw us, I'd recommend fighting him. -Fairy", Toast.LENGTH_LONG);
- toast3.setGravity(Gravity.TOP | Gravity.LEFT, 0, 0);
- toast3.show();
- break;
- case R.id.keepsneaking:
- setContentView(R.layout.keepsneaking);
- checkIfItsNight();
- break;
- case R.id.hint4:
- Toast toast4 = Toast.makeText(this, "My master, you have died! -Fairy", Toast.LENGTH_LONG);
- toast4.setGravity(Gravity.TOP | Gravity.LEFT, 0, 0);
- toast4.show();
- break;
- case R.id.attackogre:
- if(sword == true)
- setContentView(R.layout.attackogrewithsword);
- else
- setContentView(R.layout.attackogrewithoutsword);
- checkIfItsNight();
- break;
- case R.id.hint5:
- Toast toast5 = Toast.makeText(this, "We're doing pretty well, lets keep going at it. -Fairy", Toast.LENGTH_LONG);
- toast5.setGravity(Gravity.TOP | Gravity.LEFT, 0, 0);
- toast5.show();
- break;
- case R.id.keepattacking:
- setContentView(R.layout.keepattacking);
- checkIfItsNight();
- break;
- case R.id.giveup:
- setContentView(R.layout.regularcave);
-
- break;
- case R.id.hint6:
- Toast toast6 = Toast.makeText(this, "Oh no we have no choice but to fight without the sword. -Fairy", Toast.LENGTH_LONG);
- toast6.setGravity(Gravity.TOP | Gravity.LEFT, 0, 0);
- toast6.show();
- break;
- case R.id.hint7:
- Toast toast7 = Toast.makeText(this, "He was just too strong for us. -Fairy", Toast.LENGTH_LONG);
- toast7.setGravity(Gravity.TOP | Gravity.LEFT, 0, 0);
- toast7.show();
- break;
- case R.id.hint8:
- Toast toast8 = Toast.makeText(this, "He seems to be asleep from 6PM to 12AM. -Fairy", Toast.LENGTH_LONG);
- toast8.setGravity(Gravity.TOP | Gravity.LEFT, 0, 0);
- toast8.show();
- break;
- case R.id.sneakintocave:
- setContentView(R.layout.sneakintothecave);
- break;
- case R.id.killogre:
- setContentView(R.layout.killtheogreinhissleep);
- break;
- case R.id.hint9:
- Toast toast9 = Toast.makeText(this, "Wow! A shiny emerald! We should take it! -Fairy", Toast.LENGTH_LONG);
- toast9.setGravity(Gravity.TOP | Gravity.LEFT, 0, 0);
- toast9.show();
- break;
- case R.id.takeit:
- emerald = true;
- setContentView(R.layout.regularcave);
- break;
- case R.id.leaveit:
- setContentView(R.layout.regularcave);
- break;
- case R.id.hint10:
- Toast toast10 = Toast.makeText(this, "Sometimes you have to play smart! Let's explore! -Fairy", Toast.LENGTH_LONG);
- toast10.setGravity(Gravity.TOP | Gravity.LEFT, 0, 0);
- toast10.show();
- break;
- case R.id.checkthecave:
- setContentView(R.layout.sneakintothecave);
- break;
- case R.id.leave:
- setContentView(R.layout.regularcave);
- break;
- case R.id.hint11:
- Toast toast11 = Toast.makeText(this, "Sorry, even I don't know where to go! -Fairy", Toast.LENGTH_LONG);
- toast11.setGravity(Gravity.TOP | Gravity.LEFT, 0, 0);
- toast11.show();
- break;
- case R.id.darkcave:
- setContentView(R.layout.darkcave);
- mSensorManager.registerListener(this, mAccelerometer, SensorManager.SENSOR_DELAY_NORMAL);
- break;
- case R.id.highupcave:
- setContentView(R.layout.highupcave);
- setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED);
- Button throwsword = (Button) findViewById(R.id.throwsword);
- if(sword == false)
- throwsword.setEnabled(false);
- break;
- case R.id.cavewithabreeze:
- setContentView(R.layout.cavewithbreeze);
- break;
- case R.id.hint12:
- if(lantern == false) {
- Toast toast12 = Toast.makeText(this, "It's dark... Im scared! We should go back... -Fairy", Toast.LENGTH_LONG);
- toast12.setGravity(Gravity.TOP | Gravity.LEFT, 0, 0);
- toast12.show();
- }
- else {
- Toast toast12 = Toast.makeText(this, "You have a flashlight, shake your device to turn it on! -Fairy", Toast.LENGTH_LONG);
- toast12.setGravity(Gravity.TOP | Gravity.LEFT, 0, 0);
- toast12.show();
- }
- break;
- case R.id.goback:
- setContentView(R.layout.regularcave);
- setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
- break;
- case R.id.travelforward:
- if(lit == true)
- setContentView(R.layout.travelforwardwithlight);
- else
- setContentView(R.layout.travelforwardwithoutlight);
- break;
- case R.id.hint13:
- Toast toast13 = Toast.makeText(this, "This dark room is dark and creepy, lets leave! -Fairy", Toast.LENGTH_LONG);
- toast13.setGravity(Gravity.TOP | Gravity.LEFT, 0, 0);
- toast13.show();
- break;
- case R.id.run:
- setContentView(R.layout.run);
- break;
- case R.id.hint14:
- Toast toast14 = Toast.makeText(this, "You died! It was by a spider monster. -Fairy", Toast.LENGTH_LONG);
- toast14.setGravity(Gravity.TOP | Gravity.LEFT, 0, 0);
- toast14.show();
- break;
- case R.id.hint15:
- Toast toast15 = Toast.makeText(this, "I see something shiny! -Fairy", Toast.LENGTH_LONG);
- toast15.setGravity(Gravity.TOP | Gravity.LEFT, 0, 0);
- toast15.show();
- break;
- case R.id.rummage:
- setContentView(R.layout.key);
- key = true;
- break;
- case R.id.hint16:
- Toast toast16 = Toast.makeText(this, "What a nice find! -Fairy", Toast.LENGTH_LONG);
- toast16.setGravity(Gravity.TOP | Gravity.LEFT, 0, 0);
- toast16.show();
- break;
- case R.id.hint17:
- Toast toast17 = Toast.makeText(this, "Hmm try moving your device around to drop the bridge. -Fairy", Toast.LENGTH_LONG);
- toast17.setGravity(Gravity.TOP | Gravity.LEFT, 0, 0);
- toast17.show();
- break;
- case R.id.jump:
- setContentView(R.layout.jump);
- break;
- case R.id.throwsword:
- sword = false;
- setContentView(R.layout.throwswordtocuttherope);
- break;
- case R.id.hint18:
- Toast toast18 = Toast.makeText(this, "Master! Why'd you go and do that?!. -Fairy", Toast.LENGTH_LONG);
- toast18.setGravity(Gravity.TOP | Gravity.LEFT, 0, 0);
- toast18.show();
- break;
- case R.id.hint19:
- Toast toast19 = Toast.makeText(this, "It was fun while it lasted. On to a new master! -Fairy", Toast.LENGTH_LONG);
- toast19.setGravity(Gravity.TOP | Gravity.LEFT, 0, 0);
- toast19.show();
- break;
- case R.id.hint20:
- Toast toast20 = Toast.makeText(this, "Good job you can cross the bridge now! -Fairy", Toast.LENGTH_LONG);
- toast20.setGravity(Gravity.TOP | Gravity.LEFT, 0, 0);
- toast20.show();
- break;
- case R.id.walkacross:
- setContentView(R.layout.walkacross);
- setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
- break;
- case R.id.hint21:
- Toast toast21 = Toast.makeText(this, "Look it's a door, wonder what's behind... -Fairy", Toast.LENGTH_LONG);
- toast21.setGravity(Gravity.TOP | Gravity.LEFT, 0, 0);
- toast21.show();
- break;
- case R.id.opendoor:
- setContentView(R.layout.opendoor);
- Button bkey = (Button) findViewById(R.id.usekey);
- if(key == false)
- bkey.setEnabled(false);
- break;
- case R.id.hint22:
- Toast toast22 = Toast.makeText(this, "Do you have the skills to pick the lock? If not, use the key. -Fairy", Toast.LENGTH_LONG);
- toast22.setGravity(Gravity.TOP | Gravity.LEFT, 0, 0);
- toast22.show();
- break;
- case R.id.picklock:
- setContentView(R.layout.picklock);
- break;
- case R.id.usekey:
- setContentView(R.layout.usekey);
- ImageView iv = (ImageView) findViewById(R.id.treasure);
- TextView tv = (TextView) findViewById(R.id.text2);
- if((sword == false && treasure == false) || (sword == false && treasure == true)) {
- iv.setImageResource(R.drawable.sword2);
- tv.setText("You stumble upon a sword.");
- sword = true;
- break;
- }
- if(treasure == false && sword == true) {
- treasure = true; //add 5 points
- break;
- }
- if(sword == true && treasure == true) {
- iv.setImageDrawable(null);
- tv.setText("...");
- break;
- }
- case R.id.hint23:
- Toast toast23 = Toast.makeText(this, "Good thing I can fly. -Fairy", Toast.LENGTH_LONG);
- toast23.setGravity(Gravity.TOP | Gravity.LEFT, 0, 0);
- toast23.show();
- break;
- case R.id.hint24:
- Toast toast24 = Toast.makeText(this, "Wow what a find! -Fairy", Toast.LENGTH_LONG);
- toast24.setGravity(Gravity.TOP | Gravity.LEFT, 0, 0);
- toast24.show();
- break;
- case R.id.hint25:
- Toast toast25 = Toast.makeText(this, "Onwards to our next journey! -Fairy", Toast.LENGTH_LONG);
- toast25.setGravity(Gravity.TOP | Gravity.LEFT, 0, 0);
- toast25.show();
- break;
- case R.id.gotocastle:
- SharedPreferences.Editor editor = progressData.edit();
-
- editor.putInt("points", points);
- editor.putInt("evil-points", evilPoints);
- editor.putBoolean("lantern", lantern);
- editor.putBoolean("sword", sword);
- editor.putBoolean("emerald", emerald);
- editor.putInt("part", 3);
- editor.putInt("storyProgress", R.layout.part3_start);
-
- editor.commit();
-
- Intent startNewGame = new Intent(Cave.this, Part3Castle.class);
- startActivity(startNewGame);
- finish();
- break;
- case R.id.gameover:
- /**
- * game over screen
- */
- break;
- }
- }
-
- public void onConfigurationChanged(Configuration newConfig) {
- super.onConfigurationChanged(newConfig);
- setContentView(R.layout.changeorientation); //add 5 points here
- }
-
- protected void onResume() {
- super.onResume();
- mSensorManager.registerListener(this, mAccelerometer, SensorManager.SENSOR_DELAY_NORMAL);
- }
-
- protected void onPause() {
- super.onPause();
- mSensorManager.unregisterListener(this);
- }
-
- @Override
- public void onSensorChanged(SensorEvent event) {
- curTime = System.currentTimeMillis();
-
- if ((curTime - lastUpdate) > UPDATEPERIOD) {
- long diffTime = (curTime - lastUpdate);
- lastUpdate = curTime;
-
- x = event.values[0];
- y = event.values[1];
- z = event.values[2];
-
- float speed = Math.abs(x + y + z - last_x - last_y - last_z) / diffTime * 10000;
-
- if (speed > SHAKE_THRESHOLD) {
-// Toast toast = Toast.makeText(this, "shook", Toast.LENGTH_SHORT);
-// toast.show();
- RelativeLayout rl = (RelativeLayout) findViewById(R.id.dc);
- TextView tv = (TextView) findViewById(R.id.text1);
- if (lantern == true) {
- rl.setBackgroundResource(R.drawable.ogrecave2);
- tv.setText("It's bright and lit!");
- lit = true;
- }
-
- last_x = x;
- last_y = y;
- last_z = z;
- }
- }
- }
- @Override
- public void onAccuracyChanged(Sensor sensor, int accuracy) {
-
- }
-}
diff --git a/app/src/main/java/com/example/ninaly/adventuregame453/GameOver.java b/app/src/main/java/com/example/ninaly/adventuregame453/GameOver.java
new file mode 100644
index 0000000..e029314
--- /dev/null
+++ b/app/src/main/java/com/example/ninaly/adventuregame453/GameOver.java
@@ -0,0 +1,158 @@
+package com.example.ninaly.adventuregame453;
+
+import android.app.Activity;
+import android.content.Intent;
+import android.content.SharedPreferences;
+import android.graphics.drawable.Drawable;
+import android.os.Bundle;
+import android.view.View;
+import android.widget.ImageView;
+import android.widget.RelativeLayout;
+import android.widget.TextView;
+
+/**
+ * Created by Christian on 12/8/2016.
+ */
+
+public class GameOver extends Activity {
+ public static final String Data = "Progress_Data";
+ SharedPreferences progressData;
+ int points, evilPoints, progress;
+ boolean lantern, sword, emerald, key, treasure;
+ public void onCreate(Bundle savedInstanceState){
+ progressData = getSharedPreferences(Data, 0);
+ points = progressData.getInt("points", 0);
+ evilPoints = progressData.getInt("evilPoints", 0);
+ progress = progressData.getInt("storyProgress", R.layout.cavebeginning);
+ lantern = progressData.getBoolean("lantern", true);
+ sword = progressData.getBoolean("sword", true);
+ emerald = progressData.getBoolean("emerald", false);
+ key = progressData.getBoolean("key", true);
+ treasure = progressData.getBoolean("treasure", false);
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.gameover);
+ Intent intent = getIntent();
+ int gameover = intent.getIntExtra("gameover",13);
+ setDeathScreen(gameover);
+
+ }
+
+ public void setDeathScreen(int death){
+ RelativeLayout layout = (RelativeLayout)findViewById(R.id.gameoverscreen);
+ ImageView image = (ImageView)findViewById(R.id.endingImage);
+ TextView goDesc = (TextView)findViewById(R.id.gameovertext);
+ TextView goPoints = (TextView)findViewById(R.id.gameoverpoints);
+ switch(death){
+ case 1://goblins kill you
+ layout.setBackgroundDrawable(getResources().getDrawable(R.drawable.forest));
+ image.setImageDrawable(getResources().getDrawable(R.drawable.goblingo));
+ goDesc.setText("The goblins tear you and the fairy apart for killing their friend");
+ goPoints.setText("Points: " + points);
+ break;
+ case 2://sword pubishment
+ layout.setBackgroundDrawable(getResources().getDrawable(R.drawable.forest_path));
+ image.setImageDrawable(getResources().getDrawable(R.drawable.swordgo));
+ goDesc.setText("Lightning rained down from the heavens and vaporized you and your evil heart!");
+ goPoints.setText("Points: " + points);
+ break;
+ case 3://ogre kills you
+ layout.setBackgroundDrawable(getResources().getDrawable(R.drawable.ogrecave));
+ image.setImageDrawable(getResources().getDrawable(R.drawable.ogre3));
+ goDesc.setText("The ogre bashed your head in and that was that");
+ goPoints.setText("Points: " + points);
+ break;
+ case 4://jump to your death
+ layout.setBackgroundDrawable(getResources().getDrawable(R.drawable.bridge));
+ image.setImageDrawable(null);
+ goDesc.setText("You fall to the bottom of the pit and leave a giant red stain");
+ goPoints.setText("Points: " + points);
+ break;
+ case 5://eaten by bugs
+ layout.setBackgroundDrawable(getResources().getDrawable(R.drawable.ogrecave2));
+ image.setImageDrawable(getResources().getDrawable(R.drawable.bones));
+ goDesc.setText("You feel a couple of bugs crawling up your legs... then a lot.. they eat your flesh and leave nothing but bone behind");
+ goPoints.setText("Points: " + points);
+ break;
+ case 6://trapped in the cave
+ layout.setBackgroundDrawable(getResources().getDrawable(R.drawable.door));
+ image.setImageDrawable(getResources().getDrawable(R.drawable.bones));
+ goDesc.setText("The bridge has fallen down behind you and you're trapped forever!");
+ goPoints.setText("Points: " + points);
+ break;
+ case 7://eaten by the alligator
+ layout.setBackgroundDrawable(getResources().getDrawable(R.drawable.castle));
+ image.setImageDrawable(getResources().getDrawable(R.drawable.crock));
+ goDesc.setText("You hear the guard yell something at you but you can't understand it over the screams as the aligator rips you apart");
+ goPoints.setText("Points: " + points);
+ break;
+ case 8://too gready in the castle
+ layout.setBackgroundDrawable(getResources().getDrawable(R.drawable.throneroom));
+ image.setImageDrawable(getResources().getDrawable(R.drawable.zeldawalkingaway));
+ goDesc.setText("Suddenly the room is upside down, you see a figure walk away muttering... failure");
+ goPoints.setText("Points: " + points);
+ break;
+ case 9://princess kills you
+ layout.setBackgroundDrawable(getResources().getDrawable(R.drawable.throneroom));
+ image.setImageDrawable(getResources().getDrawable(R.drawable.zelda));
+ goDesc.setText("You may have been evil but you were not strong enough to defeat this princess");
+ goPoints.setText("Points: " + points);
+ break;
+ case 10://wizard kills you
+ layout.setBackgroundDrawable(getResources().getDrawable(R.drawable.castle));
+ image.setImageDrawable(getResources().getDrawable(R.drawable.darkwizard));
+ goDesc.setText("You tried your hardest as the hero but the wizard over powered you vaporizing you with a powerful spell leaving no remains");
+ goPoints.setText("Points: " + points);
+ break;
+ case 11://evil win
+ layout.setBackgroundDrawable(getResources().getDrawable(R.drawable.throneroom));
+ goDesc.setText("The princess has been defeated after taking care of the guards and executing the king you stay in the castle as its ruler");
+ goPoints.setText("Points: " + points);
+ break;
+ case 12:// good win
+ layout.setBackgroundDrawable(getResources().getDrawable(R.drawable.throneroom));
+ image.setImageDrawable(getResources().getDrawable(R.drawable.kingprincess));
+ goDesc.setText("You were able to finally defeat the powerful wizard, You were allowed to stay in the castle and married the princess living the rest of your days out in peace");
+ goPoints.setText("Points: " + points);
+ break;
+ case 13:// boring end
+ layout.setBackgroundDrawable(getResources().getDrawable(R.drawable.castle));
+ image.setImageDrawable(null);
+ goDesc.setText("Wow what a boring story.... you didn't take any risks or anything. geez go home and live your boring life");
+ goPoints.setText("Points: " + points);
+ break;
+ }
+ SharedPreferences points = getSharedPreferences(Data, 0);
+ SharedPreferences.Editor editor = points.edit();
+
+ editor.putInt("points", 0);
+ editor.putInt("evilPoints", 0);
+ editor.putInt("player-health", 10);
+ editor.putInt("princess-health", 7);
+ editor.putInt("wizard-health", 10);
+ editor.putBoolean("lantern", false);
+ editor.putBoolean("sword", false);
+ editor.putBoolean("emerald", false);
+ editor.putBoolean("key", false);
+ editor.putBoolean("treasure", false);
+ editor.putString("magic", "none");
+ editor.putInt("storyProgress", R.layout.part1_intro);
+
+ editor.commit();
+ }
+
+ public void onClick(View view){
+ switch (view.getId()){
+ case R.id.quitGame:
+ Intent intent = new Intent(Intent.ACTION_MAIN);
+ intent.addCategory(Intent.CATEGORY_HOME);
+ startActivity(intent);
+ break;
+ case R.id.mainMenu:
+ Intent mainmenu = new Intent(GameOver.this, StartScreen.class);
+ startActivity(mainmenu);
+ finish();
+ break;
+
+ }
+ }
+}
diff --git a/app/src/main/java/com/example/ninaly/adventuregame453/Part1.java b/app/src/main/java/com/example/ninaly/adventuregame453/Part1.java
deleted file mode 100644
index 417a1e9..0000000
--- a/app/src/main/java/com/example/ninaly/adventuregame453/Part1.java
+++ /dev/null
@@ -1,468 +0,0 @@
-package com.example.ninaly.adventuregame453;
-
-import android.app.Activity;
-import android.content.Intent;
-import android.content.SharedPreferences;
-import android.media.Image;
-import android.os.Bundle;
-import android.provider.Settings;
-import android.view.View;
-import android.widget.Button;
-import android.widget.ImageButton;
-import android.widget.TextView;
-import android.widget.Toast;
-import android.view.Gravity;
-
-import java.lang.reflect.Array;
-import java.util.Random;
-
-public class Part1 extends Activity {
-
- int counter = 0;
-
- public static final String Data = "Progress_Data";
- int points, evilPoints, progress;
- private boolean lantern, sword, emerald, key, treasure;
- SharedPreferences progressData;
-
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
-
- progressData = getSharedPreferences(Data, 0);
- points = progressData.getInt("points", 0);
- evilPoints = progressData.getInt("evilPoints", 0);
- progress = progressData.getInt("storyProgress", R.layout.part1_intro);
- lantern = progressData.getBoolean("lantern", true);
- sword = progressData.getBoolean("sword", true);
- emerald = progressData.getBoolean("emerald", false);
- key = progressData.getBoolean("key", true);
- treasure = progressData.getBoolean("treasure", false);
-
- setContentView(R.layout.part1_intro);
-
- }
-
- @Override
- protected void onResume() {
- super.onResume();
-
- }
-
- @Override
- protected void onPause() {
-
- SharedPreferences.Editor editor = progressData.edit();
-
- editor.putInt("points", points);
- editor.putInt("evil-points", evilPoints);
- editor.putBoolean("lantern", lantern);
- editor.putBoolean("sword", sword);
- editor.putBoolean("emerald", emerald);
- editor.putInt("part", 1);
- editor.putInt("storyProgress", progress);
-
- editor.commit();
-
- super.onPause();
-
- }
-
- public void onClick(View view) {
-
- Button buttonClicked = (Button) view;
- SharedPreferences.Editor editor = progressData.edit();
-
-
- switch (buttonClicked.getId()) {
-
- // From part1_intro.xml
- // Shoos fairy away
- case R.id.swing:
- evilPoints++;
- setContentView(R.layout.part1_take_swing);
- break;
-
- // From part1_intro.xml
- // Asks fairy's purpose
- case R.id.ask1:
- progress = R.layout.part1_ask_fairy;
- setContentView(R.layout.part1_ask_fairy);
- break;
-
- // From part1_take_swing.xml
- // After fairy said it's not harmless, ask for its purpose
- case R.id.ask2:
- setContentView(R.layout.part1_ask_fairy);
- break;
-
- // From part1_walk_away.xml
- // Walk away and ignore fairy
- case R.id.startWalkingButton:
- setContentView(R.layout.part1_walk_away);
- break;
-
- // From part1_walk_away.xml
- // Agree to help fairy guide it home
- case R.id.okButton3:
- setContentView(R.layout.part1_help_fairy);
-
- // From part1_ask_fairy.xml
- // Agree to help fairy guide it home
- case R.id.okButton:
- setContentView(R.layout.part1_help_fairy);
- break;
-
- // From part1_help_fairy.xml
- case R.id.okButton2:
- setContentView(R.layout.part1_choosing_paths);
- break;
-
- // From part1_choosing_paths.xml
- case R.id.sunnyPathButton:
- setContentView(R.layout.part1_sunny_path);
- break;
-
- // From part1_sunny_path
- // Goes directly to part 2 after this button is clicked
- case R.id.part2Button:
-
- editor.putInt("points", points);
- editor.putInt("evil-points", evilPoints);
- editor.putBoolean("lantern", lantern);
- editor.putBoolean("sword", sword);
- editor.putBoolean("emerald", emerald);
- editor.putInt("part", 2);
- editor.putInt("storyProgress", R.layout.cavebeginning);
-
- editor.commit();
- progress = R.layout.cavebeginning;
- Intent intent = new Intent(Part1.this, Cave.class);
- startActivity(intent);
- break;
-
- // From part1_choosing_paths.xml
- case R.id.darkPathButton:
- setContentView(R.layout.part1_dark_path);
- break;
-
- // From part1_dark_path.xml
- case R.id.runAwayButton:
- setContentView(R.layout.part1_run_away_from_goblin);
- break;
-
- // From part1_run_away_from_goblin.xml
- case R.id.pullSwordButton:
- setContentView(R.layout.part1_sword);
- break;
-
- // From part1_dark_path.xml
- case R.id.sayHelloButton:
- progress = R.layout.part1_say_hello;
- setContentView(R.layout.part1_say_hello);
- break;
-
- // From part1_say_hello.xml (spanish xml)
- case R.id.attackHim:
- evilPoints=+2;
- setContentView(R.layout.part1_attack_goblin);
- break;
-
- // From part1_say_hello.xml
- case R.id.yesHelp:
- setContentView(R.layout.part1_goblin_help);
- break;
-
- // From part1_dark_path.xml
- case R.id.attackButton:
- evilPoints=+2;
- setContentView(R.layout.part1_attack_goblin);
- break;
-
- // From part1_say_hello.xml
- case R.id.attackGoblin:
- evilPoints=+2;
- setContentView(R.layout.part1_attack_goblin);
- break;
-
- // From part1_say_hello.xml
- case R.id.leaveButton:
- setContentView(R.layout.part1_sword);
- break;
-
- // From part1_say_hello.xml
- case R.id.nodButton:
- setContentView(R.layout.part1_nod_globin);
- break;
-
- // From part1_attack_globin.xml
- case R.id.leaveNowButton:
- setContentView(R.layout.part1_leave_after_finding_gold);
- break;
-
- // From part1_attack_globin.xml
- case R.id.keepLookingButton:
- setContentView(R.layout.part1_keep_looking);
- break;
-
- // From part1_attack_globin.xml
- case R.id.followPath:
- setContentView(R.layout.part1_sword);
- break;
-
- // From part1_keep_looking.xml
- case R.id.keepLookingButton2:
- setContentView(R.layout.part1_keep_looking_again);
- break;
-
- // From part1_keep_looking.xml
- case R.id.leaveNowButton2:
- setContentView(R.layout.part1_sword);
- break;
-
- // From part1_keep_looking_again.xml
- case R.id.gameOver:
- setContentView(R.layout.part1_gameover);
- break;
-
- // From part1_gameover.xml
- case R.id.mainMenu:
- setContentView(R.layout.activity_start_screen);
- break;
-
- case R.id.quitGame:
- System.exit(0);
-
- // From part1_goblin_help.xml
- case R.id.swordHelpFromGoblin:
- setContentView(R.layout.part1_sword);
- break;
-
- // From part1_sword.xml
- case R.id.pullSword:
- setContentView(R.layout.part1_pull_sword);
- break;
-
- // From part1_sword.xml
- case R.id.readInscription:
- setContentView(R.layout.part1_read_inscription);
- break;
-
- // From part1_sword.xml
- case R.id.keepWalking:
- setContentView(R.layout.part1_keep_walking);
- break;
-
- // From part1_pull_sword.xml
- case R.id.readInscription1:
- setContentView(R.layout.part1_read_inscription);
- break;
-
- // From part1_read_inscription.xml
- case R.id.pullSword1:
- setContentView(R.layout.part1_pull_sword2);
- break;
-
- // From part1_read_inscription.xml
- case R.id.leaveInscription:
- setContentView(R.layout.part1_leave_inscription);
- break;
-
- // From part1_keep_walking.xml
- case R.id.part2Butt:
- editor = progressData.edit();
-
- editor.putInt("points", points);
- editor.putInt("evil-points", evilPoints);
- editor.putBoolean("lantern", lantern);
- editor.putBoolean("sword", sword);
- editor.putBoolean("emerald", emerald);
- editor.putInt("part", 2);
- editor.putInt("storyProgress", R.layout.cavebeginning);
- progress = R.layout.cavebeginning;
- editor.commit();
- Intent part2 = new Intent(Part1.this, Cave.class);
- startActivity(part2);
- break;
-
- // From part1_leave_inscription.xml
- case R.id.goToPart2:
- editor = progressData.edit();
-
- editor.putInt("points", points);
- editor.putInt("evil-points", evilPoints);
- editor.putBoolean("lantern", lantern);
- editor.putBoolean("sword", sword);
- editor.putBoolean("emerald", emerald);
- editor.putInt("part", 2);
- editor.putInt("storyProgress", R.layout.cavebeginning);
-
- editor.commit();
- progress = R.layout.cavebeginning;
- Intent partdos = new Intent(Part1.this, Cave.class);
- startActivity(partdos);
- break;
-
- // From part1_pull_sword2.xml
- case R.id.takeTheSword:
-
- if(evilPoints == 0) {
- setContentView(R.layout.part1_leave_inscription);
- break;
- }
- else if(evilPoints == 1) {
- setContentView(R.layout.part1_punishment1);
- break;
- }
- else if(evilPoints >= 2) {
- setContentView(R.layout.part1_punishment2);
- break;
- }
-
- // From part1_punishment1.xml
- case R.id.lightningStrikes:
- setContentView(R.layout.part1_keep_walking);
- break;
-
-
-
- // From part1_punishment2.xml
- case R.id.gameOverButton:
- setContentView(R.layout.part1_gameover);
- break;
-
-
-
- } //end switch
- } //end onClick
-
-
- public void onImageClick(View view) {
-
- ImageButton imageButtonClicked = (ImageButton) view;
-
- switch (imageButtonClicked.getId()) {
-
- case R.id.helpFairyHint:
- Toast fairyHints = Toast.makeText(Part1.this, "I will help us get home.", Toast.LENGTH_LONG);
- fairyHints.setGravity(Gravity.TOP | Gravity.RIGHT, 0, 110);
- fairyHints.show();
- break;
-
- case R.id.choosingPathFairy:
- Toast choosingPath = Toast.makeText(Part1.this, "I hate the dark, but I am able to light up.", Toast.LENGTH_LONG);
- choosingPath.setGravity(Gravity.TOP | Gravity.RIGHT, 0, 110);
- choosingPath.show();
- break;
-
- case R.id.darkPathFairy:
- Toast darkPath = Toast.makeText(Part1.this, "Why don't you ask him for directions?", Toast.LENGTH_LONG);
- darkPath.setGravity(Gravity.TOP | Gravity.RIGHT, 0, 110);
- darkPath.show();
- break;
-
- case R.id.runAwayFairy:
- Toast runAway = Toast.makeText(Part1.this, "Tap on the sword to try to pull it out of the rock. Keep trying until you get the sword. It could be useful!", Toast.LENGTH_LONG);
- runAway.setGravity(Gravity.TOP | Gravity.RIGHT, 0, 110);
- runAway.show();
- break;
-
- case R.id.attackGoblinFairy:
- Toast jumpHim = Toast.makeText(Part1.this, "I think I heard something... we should get out of here.", Toast.LENGTH_LONG);
- jumpHim.setGravity(Gravity.TOP | Gravity.RIGHT, 0, 110);
- jumpHim.show();
- break;
-
- case R.id.keepLookingFairy:
- Toast kl = Toast.makeText(Part1.this, "Seriously.. we should leave now!", Toast.LENGTH_LONG);
- kl.setGravity(Gravity.TOP | Gravity.RIGHT, 0, 110);
- kl.show();
- break;
-
- case R.id.keepLookingFairy2:
- Toast kla = Toast.makeText(Part1.this, "I told you we should've left! It's too late now.", Toast.LENGTH_LONG);
- kla.setGravity(Gravity.TOP | Gravity.RIGHT, 0, 110);
- kla.show();
- break;
-
- case R.id.leaveAfter:
- Toast leave = Toast.makeText(Part1.this, "Oooo trying pulling the sword.", Toast.LENGTH_LONG);
- leave.setGravity(Gravity.TOP | Gravity.RIGHT, 0, 110);
- leave.show();
- break;
-
- case R.id.spanishFairy:
- Toast spanish = Toast.makeText(Part1.this, "Is he speaking in Spanish? We need to learn spanish to understand. Change the language settings on your phone to Spanish to get the English translation. Pointing is rude so don't upset him.", Toast.LENGTH_LONG);
- spanish.setGravity(Gravity.TOP | Gravity.RIGHT, 0, 110);
- spanish.show();
- break;
-
- case R.id.angryGoblin:
- Toast angry = Toast.makeText(Part1.this, "Uh oh, your pointing upsetted him. Do you still want to look around?", Toast.LENGTH_LONG);
- angry.setGravity(Gravity.TOP | Gravity.RIGHT, 0, 110);
- angry.show();
- break;
-
- case R.id.settingButton:
- startActivityForResult(new Intent(Settings.ACTION_LOCALE_SETTINGS),0);
- break;
-
- case R.id.goblinHelp:
- Toast help = Toast.makeText(Part1.this, "The goblin was very friendly. Let's follow the path.", Toast.LENGTH_LONG);
- help.setGravity(Gravity.TOP | Gravity.RIGHT, 0, 110);
- help.show();
- break;
-
- case R.id.swordFairy:
- Toast sword = Toast.makeText(Part1.this, "Hmm.... trying pulling the sword?", Toast.LENGTH_LONG);
- sword.setGravity(Gravity.TOP | Gravity.RIGHT, 0, 110);
- sword.show();
- break;
-
- case R.id.pullSwordFairy:
- Toast fairy = Toast.makeText(Part1.this, "Try reading the inscription.", Toast.LENGTH_LONG);
- fairy.setGravity(Gravity.TOP | Gravity.RIGHT, 0, 110);
- fairy.show();
- break;
-
- case R.id.readInscriptionFairy:
- Toast rf = Toast.makeText(Part1.this, "Have you done anything bad lately? Maybe we should go.", Toast.LENGTH_LONG);
- rf.setGravity(Gravity.TOP | Gravity.RIGHT, 0, 110);
- rf.show();
- break;
-
- case R.id.walkAwayFairy:
- Toast wa = Toast.makeText(Part1.this, "Yay!!!!", Toast.LENGTH_LONG);
- wa.setGravity(Gravity.TOP | Gravity.RIGHT, 0, 110);
- wa.show();
- break;
-
- case R.id.pullSwordFairy2:
- Toast ps = Toast.makeText(Part1.this, "If you didn't attack the goblin or if you didn't shoo me away, leave with the sword." +
- "If you did attack the goblin or shoo me away, you are about to experience karma.", Toast.LENGTH_LONG);
- ps.setGravity(Gravity.TOP | Gravity.RIGHT, 0, 110);
- ps.show();
- break;
-
- case R.id.leaveFairy:
- Toast leave1 = Toast.makeText(Part1.this, "I think we're almost home!", Toast.LENGTH_LONG);
- leave1.setGravity(Gravity.TOP | Gravity.RIGHT, 0, 110);
- leave1.show();
- break;
-
- case R.id.punishment1:
- Toast p1 = Toast.makeText(Part1.this, "RUN! RUN!", Toast.LENGTH_LONG);
- p1.setGravity(Gravity.TOP | Gravity.RIGHT, 0, 110);
- p1.show();
- break;
-
- case R.id.punishment2:
- Toast p2 = Toast.makeText(Part1.this, "Game over :(", Toast.LENGTH_LONG);
- p2.setGravity(Gravity.TOP | Gravity.RIGHT, 0, 110);
- p2.show();
- break;
-
- } //end switch
- } //end onImageClick
-}
-
diff --git a/app/src/main/java/com/example/ninaly/adventuregame453/Part3Castle.java b/app/src/main/java/com/example/ninaly/adventuregame453/Part3Castle.java
deleted file mode 100644
index edcf2dd..0000000
--- a/app/src/main/java/com/example/ninaly/adventuregame453/Part3Castle.java
+++ /dev/null
@@ -1,153 +0,0 @@
-package com.example.ninaly.adventuregame453;
-
-import android.app.Activity;
-import android.content.SharedPreferences;
-import android.hardware.Sensor;
-import android.hardware.SensorManager;
-import android.os.Bundle;
-import android.view.View;
-
-/**
- * Created by Christian on 11/11/2016.
- */
-
-public class Part3Castle extends Activity {
- public static final String Data = "Progress_Data";
- int points, evilPoints, progress;
- private boolean lantern, sword, emerald, key, treasure;
- private SensorManager mSensorManager;
- private Sensor mAccelerometer;
- private long curTime, lastUpdate;
- private float x, y, z, last_x, last_y, last_z;
- private final static long UPDATEPERIOD = 300;
- private static final int SHAKE_THRESHOLD = 800;
-
-
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- SharedPreferences progressData = getSharedPreferences(Data, 0);
- points = progressData.getInt("points", 0);
- evilPoints = progressData.getInt("evil-points", 0);
- progress = progressData.getInt("storyProgress", 0);
- lantern = progressData.getBoolean("lantern", true);
- sword = progressData.getBoolean("sword", true);
- emerald = progressData.getBoolean("emerald", false);
- key = progressData.getBoolean("key", true);
- treasure = progressData.getBoolean("treasure", false);
- setContentView(R.layout.part3_start);
- mSensorManager = (SensorManager)getSystemService(SENSOR_SERVICE);
- mAccelerometer = mSensorManager.getDefaultSensor(Sensor.TYPE_ACCELEROMETER);
- curTime = lastUpdate = (long) 0.0;
- x = y = z = last_x = last_y = last_z = (float) 0.0;
- }
-
- public void onClick(View view){
- switch(view.getId()){
- case R.id.shoutLoud:
- setContentView(R.layout.part3_shout);
- break;
- case R.id.doorbell:
- if(emerald){
- setContentView(R.layout.part3_doorbell_emerald);
- }
- else if(sword){
- setContentView(R.layout.part3_doorbell_sword);
- }
- else{
- setContentView(R.layout.part3_doorbell_other);
- }
- break;
- case R.id.moat:
- setContentView(R.layout.part3_moat);
- break;
- case R.id.showEmerald:
- setContentView(R.layout.part3_emerald);
- break;
- case R.id.showSword:
- setContentView(R.layout.part3_sword);
- break;
- case R.id.appeal:
-
- break;
- case R.id.threaten:
- setContentView(R.layout.part3_threaten);
- break;
- case R.id.walk:
- setContentView(R.layout.part3_walk);
- break;
- case R.id.greet:
- setContentView(R.layout.part3_greet);
- break;
- case R.id.help:
- setContentView(R.layout.part3_askhelp);
- break;
- case R.id.listen:
- if(evilPoints > 0){
- setContentView(R.layout.part3_listenevil);
- }
- else{
- setContentView(R.layout.part3_listengood);
- }
- break;
- case R.id.ignore:
- setContentView(R.layout.part3_ignore);
- break;
- case R.id.thinkHero1:
- setContentView(R.layout.part3_thinkhero1);
- break;
- case R.id.confidentHero:
- setContentView(R.layout.part3_confidenthero);
- break;
- case R.id.EvilHero:
- setContentView(R.layout.part3_evilhero);
- break;
- case R.id.howGirl:
- setContentView(R.layout.part3_howgirl);
- break;
- case R.id.Yield:
- setContentView(R.layout.part3_yield);
- break;
- case R.id.fightGirl:
- setContentView(R.layout.part3_fightgirl);
- break;
- case R.id.attackGirl:
- setContentView(R.layout.part3_attackgirl);
- break;
- case R.id.aftermagic:
- setContentView(R.layout.part3_aftermagic);
- break;
- case R.id.reward1:
- setContentView(R.layout.part3_reward1);
- break;
- case R.id.moreReward:
- setContentView(R.layout.part3_morereward);
- break;
- case R.id.tooMuchReward:
- setContentView(R.layout.part3_toomuchreward);
- break;
- case R.id.endNoMagic:
- setContentView(R.layout.part3_endnomagic);
- break;
- case R.id.evilFight:
- setContentView(R.layout.part3_fightherevil);
- //register shake listener
- break;
- case R.id.keepFighting:
- setContentView(R.layout.part3_attackgirl);
- break;
- case R.id.redMagic:
- setContentView(R.layout.part3_redmagic);
- break;
- case R.id.greenMagic:
- setContentView(R.layout.part3_greenmagic);
- break;
- case R.id.blueMagic:
- setContentView(R.layout.part3_bluemagic);
- break;
-
-
- }
- }
-
-}
diff --git a/app/src/main/java/com/example/ninaly/adventuregame453/PlayScreen.java b/app/src/main/java/com/example/ninaly/adventuregame453/PlayScreen.java
new file mode 100644
index 0000000..cf2fa7a
--- /dev/null
+++ b/app/src/main/java/com/example/ninaly/adventuregame453/PlayScreen.java
@@ -0,0 +1,1384 @@
+package com.example.ninaly.adventuregame453;
+
+/**
+ * Created by kevin on 12/8/2016.
+ */
+import android.app.Activity;
+import android.content.Intent;
+import android.content.SharedPreferences;
+import android.media.MediaPlayer;
+import android.os.Bundle;
+import android.provider.Settings;
+import android.view.View;
+import android.widget.Button;
+import android.widget.ImageButton;
+import android.widget.TextView;
+import android.widget.Toast;
+import android.view.Gravity;
+import android.content.pm.ActivityInfo;
+import android.content.res.Configuration;
+import android.hardware.Sensor;
+import android.hardware.SensorEvent;
+import android.hardware.SensorEventListener;
+import android.hardware.SensorManager;
+import android.widget.ImageView;
+import android.widget.RelativeLayout;
+import java.util.Calendar;
+import java.util.Random;
+
+public class PlayScreen extends Activity implements SensorEventListener{
+
+
+ public static final String Data = "Progress_Data";
+ private boolean lantern, sword, emerald, key, treasure;
+ private SensorManager mSensorManager;
+ private Sensor mAccelerometer;
+ private long curTime, lastUpdate;
+ private float x, y, z, last_x, last_y, last_z;
+ private final static long UPDATEPERIOD = 300;
+ private static final int SHAKE_THRESHOLD = 800;
+ private boolean lit = false;
+ private int points, evilPoints, progress, wizardHealth, princessHealth, playerHealth;
+ private String magic;
+ private MediaPlayer mp;
+ Intent gameover;
+ SharedPreferences progressData;
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ progressData = getSharedPreferences(Data, 0);
+ points = progressData.getInt("points", 0);
+ evilPoints = progressData.getInt("evilPoints", 0);
+ progress = progressData.getInt("storyProgress", R.layout.part1_intro);
+ playerHealth = progressData.getInt("player-health", 0);
+ princessHealth = progressData.getInt("princess-health", 0);
+ wizardHealth = progressData.getInt("wizard-health", 0);
+ lantern = progressData.getBoolean("lantern", false);
+ sword = progressData.getBoolean("sword", false);
+ emerald = progressData.getBoolean("emerald", false);
+ key = progressData.getBoolean("key", false);
+ treasure = progressData.getBoolean("treasure", false);
+ magic = progressData.getString("magic", "none");
+ setContentView(progress);
+ mSensorManager = (SensorManager)getSystemService(SENSOR_SERVICE);
+ mAccelerometer = mSensorManager.getDefaultSensor(Sensor.TYPE_ACCELEROMETER);
+ curTime = lastUpdate = (long) 0.0;
+ x = y = z = last_x = last_y = last_z = (float) 0.0;
+ playerHealth = 10;
+ wizardHealth = 10;
+ princessHealth = 7;
+ mp = MediaPlayer.create(this, R.raw.forest);
+ mp.start();
+ mp.setLooping(true);
+// setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
+ }
+
+ @Override
+ protected void onResume() {
+ super.onResume();
+ progressData = getSharedPreferences(Data, 0);
+ points = progressData.getInt("points", 0);
+ evilPoints = progressData.getInt("evilPoints", 0);
+ progress = progressData.getInt("storyProgress", R.layout.part1_intro);
+ playerHealth = progressData.getInt("player-health", 0);
+ princessHealth = progressData.getInt("princess-health", 0);
+ wizardHealth = progressData.getInt("wizard-health", 0);
+ lantern = progressData.getBoolean("lantern", false);
+ sword = progressData.getBoolean("sword", false);
+ emerald = progressData.getBoolean("emerald", false);
+ key = progressData.getBoolean("key", false);
+ treasure = progressData.getBoolean("treasure", false);
+ magic = progressData.getString("magic", "none");
+ if(progress == R.layout.ogrecave || progress == R.layout.sneakaround || progress == R.layout.keepsneaking || progress == R.layout.attackogrewithsword){
+ progress = R.layout.night;
+ }
+ setContentView(progress);
+ mp.start();
+ mp.setLooping(true);
+ mSensorManager.registerListener(this, mAccelerometer, SensorManager.SENSOR_DELAY_NORMAL);
+ }
+
+ @Override
+ protected void onPause() {
+ SharedPreferences point = getSharedPreferences(Data,0);
+ SharedPreferences.Editor editor = point.edit();
+
+ editor.putInt("points", points);
+ editor.putInt("evilPoints", evilPoints);
+ editor.putInt("player-health", playerHealth);
+ editor.putInt("princess-health", princessHealth);
+ editor.putInt("wizard-health", wizardHealth);
+ editor.putBoolean("lantern", lantern);
+ editor.putBoolean("sword", sword);
+ editor.putBoolean("emerald", emerald);
+ editor.putBoolean("key", key);
+ editor.putBoolean("treasure", treasure);
+ editor.putString("magic", magic);
+ editor.putInt("storyProgress", progress);
+
+ editor.commit();
+ super.onPause();
+ mp.stop();
+ mSensorManager.unregisterListener(this);
+
+ }
+
+ public void checkIfItsNight() {//Kevin Nguyen
+ int currentHour = Calendar.getInstance().get(Calendar.HOUR_OF_DAY);
+ if(currentHour >= 18) {
+ setContentView(R.layout.night);
+ }
+ }
+
+ public void onClick(View view) {//Nina Ly
+// SharedPreferences.Editor editor = progressData.edit();
+
+
+ switch (view.getId()) {
+
+ // From part1_intro.xml
+ // Shoos fairy away
+ case R.id.swing:
+ evilPoints++;
+ progress = R.layout.part1_take_swing;
+ break;
+
+ // From part1_intro.xml
+ // Asks fairy's purpose
+ case R.id.ask1:
+ progress = R.layout.part1_ask_fairy;
+ break;
+
+ // From part1_take_swing.xml
+ // After fairy said it's not harmless, ask for its purpose
+ case R.id.ask2:
+ progress = R.layout.part1_ask_fairy;
+ break;
+
+ // From part1_walk_away.xml
+ // Walk away and ignore fairy
+ case R.id.startWalkingButton:
+ progress = R.layout.part1_walk_away;
+ break;
+
+ // From part1_walk_away.xml
+ // Agree to help fairy guide it home
+ case R.id.okButton3:
+ progress = R.layout.part1_help_fairy;
+
+ // From part1_ask_fairy.xml
+ // Agree to help fairy guide it home
+ case R.id.okButton:
+ progress = R.layout.part1_help_fairy;
+ break;
+
+ // From part1_help_fairy.xml
+ case R.id.okButton2:
+ progress = R.layout.part1_choosing_paths;
+ break;
+
+ // From part1_choosing_paths.xml
+ case R.id.sunnyPathButton:
+ progress = R.layout.part1_sunny_path;
+ break;
+
+ // From part1_sunny_path
+ // Goes directly to part 2 after this button is clicked
+ case R.id.part2Button:
+
+// editor.putInt("points", points);
+// editor.putInt("evil-points", evilPoints);
+// editor.putBoolean("lantern", lantern);
+// editor.putBoolean("sword", sword);
+// editor.putBoolean("emerald", emerald);
+// editor.putInt("part", 2);
+// editor.putInt("storyProgress", R.layout.cavebeginning);
+//
+// editor.commit();
+ progress = R.layout.cavebeginning;
+ break;
+
+ // From part1_choosing_paths.xml
+ case R.id.darkPathButton:
+ progress = R.layout.part1_dark_path;
+ break;
+
+ // From part1_dark_path.xml
+ case R.id.runAwayButton:
+ progress = R.layout.part1_run_away_from_goblin;
+ break;
+
+ // From part1_run_away_from_goblin.xml
+ case R.id.pullSwordButton:
+ progress = R.layout.part1_sword;
+ break;
+
+ // From part1_dark_path.xml
+ case R.id.sayHelloButton:
+ progress = R.layout.part1_say_hello;
+ break;
+
+ // From part1_say_hello.xml (spanish xml)
+ case R.id.attackHim:
+ evilPoints++;
+ points +=5;
+ progress = R.layout.part1_attack_goblin;
+ break;
+
+ // From part1_say_hello.xml
+ case R.id.yesHelp:
+ lantern = true;
+ points+=5;
+ progress = R.layout.part1_goblin_help;
+ break;
+
+ // From part1_dark_path.xml
+ case R.id.attackButton:
+ evilPoints++;
+ points +=5;
+ progress = R.layout.part1_attack_goblin;
+ break;
+
+ // From part1_say_hello.xml
+ case R.id.attackGoblin:
+ evilPoints++;
+ points +=5;
+ progress = R.layout.part1_attack_goblin;
+ break;
+
+ // From part1_say_hello.xml
+ case R.id.leaveButton:
+ progress = R.layout.part1_sword;
+ break;
+
+ // From part1_say_hello.xml
+ case R.id.nodButton:
+ progress = R.layout.part1_nod_globin;
+ break;
+
+ // From part1_attack_globin.xml
+ case R.id.leaveNowButton:
+ progress = R.layout.part1_leave_after_finding_gold;
+ break;
+
+ // From part1_attack_globin.xml
+ case R.id.keepLookingButton:
+ progress = R.layout.part1_keep_looking;
+ break;
+
+ // From part1_attack_globin.xml
+ case R.id.followPath:
+ progress = R.layout.part1_sword;
+ break;
+
+ // From part1_keep_looking.xml
+ case R.id.keepLookingButton2:
+ gameover = new Intent(PlayScreen.this, GameOver.class);
+ gameover.putExtra("gameover", 1);
+ startActivity(gameover);
+ finish();
+ break;
+
+ // From part1_keep_looking.xml
+ case R.id.leaveNowButton2:
+ progress = R.layout.part1_sword;
+ break;
+
+// // From part1_keep_looking_again.xml
+// case R.id.gameOver:
+// Intent gameover = new Intent(PlayScreen.this, GameOver.class);
+// gameover.putExtra("gameover", 7);
+// startActivity(gameover);
+// break;
+//
+// // From part1_gameover.xml
+// case R.id.mainMenu:
+// progress = R.layout.activity_start_screen;
+// break;
+//
+// case R.id.quitGame:
+// System.exit(0);
+//
+// // From part1_goblin_help.xml
+ case R.id.swordHelpFromGoblin:
+ progress = R.layout.part1_sword;
+ break;
+
+ // From part1_sword.xml
+ case R.id.pullSword:
+ progress = R.layout.part1_pull_sword;
+ break;
+
+ // From part1_sword.xml
+ case R.id.readInscription:
+ progress = R.layout.part1_read_inscription;
+ break;
+
+ // From part1_sword.xml
+ case R.id.keepWalking:
+ progress = R.layout.part1_keep_walking;
+ break;
+
+ // From part1_pull_sword.xml
+ case R.id.readInscription1:
+ progress = R.layout.part1_read_inscription;
+ break;
+
+ // From part1_read_inscription.xml
+ case R.id.pullSword1:
+
+ progress = R.layout.part1_pull_sword2;
+ break;
+
+ // From part1_read_inscription.xml
+ case R.id.leaveInscription:
+ progress = R.layout.part1_leave_inscription;
+ break;
+
+ // From part1_keep_walking.xml
+ case R.id.part2Butt:
+// editor = progressData.edit();
+//
+// editor.putInt("points", points);
+// editor.putInt("evil-points", evilPoints);
+// editor.putBoolean("lantern", lantern);
+// editor.putBoolean("sword", sword);
+// editor.putBoolean("emerald", emerald);
+// editor.putInt("part", 2);
+// editor.putInt("storyProgress", R.layout.cavebeginning);
+ progress = R.layout.cavebeginning;
+// editor.commit();
+ break;
+
+ // From part1_leave_inscription.xml
+ case R.id.goToPart2:
+// editor = progressData.edit();
+//
+// editor.putInt("points", points);
+// editor.putInt("evil-points", evilPoints);
+// editor.putBoolean("lantern", lantern);
+// editor.putBoolean("sword", sword);
+// editor.putBoolean("emerald", emerald);
+// editor.putInt("part", 2);
+// editor.putInt("storyProgress", R.layout.cavebeginning);
+//
+// editor.commit();
+ progress = R.layout.cavebeginning;
+// Intent partdos = new Intent(PlayScreen.this, PlayScreen.class);
+// startActivity(partdos);
+ break;
+
+ // From part1_pull_sword2.xml
+ case R.id.takeTheSword:
+
+ if(evilPoints == 0) {
+ sword = true;
+ points +=5;
+ progress = R.layout.part1_leave_inscription;
+ break;
+ }
+ else if(evilPoints == 1) {
+ progress = R.layout.part1_punishment1;
+ break;
+ }
+ else if(evilPoints == 2) {
+ gameover = new Intent(PlayScreen.this, GameOver.class);
+ gameover.putExtra("gameover", 2);
+ startActivity(gameover);
+ finish();
+ break;
+ }
+
+ // From part1_punishment1.xml
+ case R.id.lightningStrikes:
+ progress = R.layout.part1_keep_walking;
+ break;
+
+
+
+// // From part1_punishment2.xml
+// case R.id.gameOverButton:
+// gameover = new Intent(PlayScreen.this, GameOver.class);
+// gameover.putExtra("gameover", 7);
+// startActivity(gameover);
+// break;
+ //beginning of part 3 by Christian Gumacal
+ case R.id.shoutLoud:
+ progress = R.layout.part3_shout;
+ break;
+ case R.id.doorbell:
+ if(emerald){
+ progress = R.layout.part3_doorbell_emerald;
+ }
+ else if(sword){
+ progress = R.layout.part3_doorbell_sword;
+ }
+ else{
+ progress = R.layout.part3_doorbell_other;
+ }
+ break;
+ case R.id.moat:
+ gameover = new Intent(PlayScreen.this, GameOver.class);
+ gameover.putExtra("gameover", 7);
+ startActivity(gameover);
+ finish();
+ break;
+ case R.id.showEmerald:
+ progress = R.layout.part3_emerald;
+ break;
+ case R.id.showSword:
+ progress = R.layout.part3_sword;
+ break;
+ case R.id.appeal:
+ gameover = new Intent(PlayScreen.this, GameOver.class);
+ gameover.putExtra("gameover", 13);
+ startActivity(gameover);
+ finish();
+ break;
+ case R.id.threaten:
+ progress = R.layout.part3_threaten;
+ break;
+ case R.id.walk:
+ progress = R.layout.part3_walk;
+ break;
+ case R.id.greet:
+ progress = R.layout.part3_greet;
+ break;
+ case R.id.help:
+ progress = R.layout.part3_askhelp;
+ break;
+ case R.id.listen:
+ if(evilPoints > 0){
+ progress = R.layout.part3_listenevil;
+ }
+ else{
+ progress = R.layout.part3_listengood;
+ }
+ break;
+ case R.id.ignore:
+ gameover = new Intent(PlayScreen.this, GameOver.class);
+ gameover.putExtra("gameover", 13);
+ startActivity(gameover);
+ finish();
+ break;
+ case R.id.thinkHero1:
+ progress = R.layout.part3_thinkhero1;
+ break;
+ case R.id.confidentHero:
+ progress = R.layout.part3_confidenthero;
+ break;
+ case R.id.EvilHero:
+ progress = R.layout.part3_evilhero;
+ break;
+ case R.id.Yield:
+ progress = R.layout.part3_yield;
+ break;
+ case R.id.aftermagic:
+ points += 5;
+ progress = R.layout.part3_aftermagic;
+ break;
+ case R.id.reward1:
+ points += 5;
+ progress = R.layout.part3_reward1;
+ break;
+ case R.id.moreReward:
+ progress = R.layout.part3_morereward;
+ break;
+ case R.id.tooMuchReward:
+ gameover = new Intent(PlayScreen.this, GameOver.class);
+ gameover.putExtra("gameover", 8);
+ startActivity(gameover);
+ finish();
+ break;
+ case R.id.evilFight:
+ progress = R.layout.part3_fightherevil;
+ break;
+ case R.id.evilFightM:
+ princessHealth = 7;
+ progress = R.layout.part3_fightherevil_m;
+ break;
+ case R.id.redMagic:
+ progress = R.layout.part3_redmagic;
+ magic = "red";
+ break;
+ case R.id.greenMagic:
+ progress = R.layout.part3_greenmagic;
+ magic = "green";
+ break;
+ case R.id.blueMagic:
+ progress = R.layout.part3_bluemagic;
+ magic = "blue";
+ break;
+ case R.id.wizard:
+ wizardHealth = 10;
+ progress = R.layout.part3_wizard_appears;
+ break;
+ case R.id.fightM:
+ mSensorManager.registerListener(this, mAccelerometer, SensorManager.SENSOR_DELAY_NORMAL);
+ progress = R.layout.part3_fight_m;
+ break;
+
+ } //end switch
+ setContentView(progress);
+ } //end onClick
+
+ public void onClickCave(View view){//Part 2 Cave by Kevin Nguyen
+ switch(view.getId()){
+ case R.id.ogrecave:
+ progress = R.layout.ogrecave;
+ setContentView(R.layout.ogrecave);
+ checkIfItsNight();
+ break;
+ case R.id.regularcave:
+ progress = R.layout.regularcave;
+ setContentView(R.layout.regularcave);
+ Button button = (Button) findViewById(R.id.highupcave);
+ break;
+ case R.id.sneakaround:
+ progress = R.layout.sneakaround;
+ setContentView(R.layout.sneakaround);
+ checkIfItsNight();
+ break;
+ case R.id.keepsneaking:
+ progress = R.layout.keepattacking;
+ setContentView(R.layout.keepsneaking);
+ checkIfItsNight();
+ break;
+ case R.id.attackogre:
+ checkIfItsNight();
+ if(sword == true) {
+ progress = R.layout.attackogrewithsword;
+ setContentView(R.layout.attackogrewithsword);}
+ else {
+ gameover = new Intent(PlayScreen.this, GameOver.class);
+ gameover.putExtra("gameover", 3);
+ startActivity(gameover);}
+ finish();
+ break;
+ case R.id.keepattacking:
+ gameover = new Intent(PlayScreen.this, GameOver.class);
+ gameover.putExtra("gameover", 3);
+ startActivity(gameover);
+ finish();
+ break;
+ case R.id.giveup:
+ progress = R.layout.regularcave;
+ setContentView(R.layout.regularcave);
+ break;
+ case R.id.sneakintocave:
+ progress = R.layout.sneakintothecave;
+ setContentView(R.layout.sneakintothecave);
+ break;
+ case R.id.killogre:
+ evilPoints++;
+ progress = R.layout.killtheogreinhissleep;
+ setContentView(R.layout.killtheogreinhissleep);
+ break;
+ case R.id.takeit:
+ progress = R.layout.regularcave;
+ emerald = true;
+ points+=5;
+ setContentView(R.layout.regularcave);
+ break;
+ case R.id.leaveit:
+ progress = R.layout.regularcave;
+ setContentView(R.layout.regularcave);
+ break;
+ case R.id.checkthecave:
+ progress = R.layout.sneakintothecave;
+ setContentView(R.layout.sneakintothecave);
+ break;
+ case R.id.leave:
+ progress = R.layout.regularcave;
+ setContentView(R.layout.regularcave);
+ break;
+ case R.id.darkcave:
+ progress = R.layout.darkcave;
+ setContentView(R.layout.darkcave);
+ mSensorManager.registerListener(this, mAccelerometer, SensorManager.SENSOR_DELAY_NORMAL);
+ break;
+ case R.id.highupcave:
+ progress = R.layout.highupcave;
+ setContentView(R.layout.highupcave);
+ setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED);
+ Button throwsword = (Button) findViewById(R.id.throwsword);
+ if(sword == false)
+ throwsword.setEnabled(false);
+ break;
+ case R.id.cavewithabreeze:
+ progress = R.layout.cavewithbreeze;
+ setContentView(R.layout.cavewithbreeze);
+ break;
+ case R.id.goback:
+ progress = R.layout.regularcave;
+ setContentView(R.layout.regularcave);
+ setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
+ break;
+ case R.id.travelforward:
+ if(lit == true) {
+ progress = R.layout.travelforwardwithlight;
+ setContentView(R.layout.travelforwardwithlight);}
+ else {
+ gameover = new Intent(PlayScreen.this, GameOver.class);
+ gameover.putExtra("gameover", 5);
+ startActivity(gameover);
+ finish();
+ }
+ break;
+ case R.id.run:
+ progress = R.layout.run;
+ setContentView(R.layout.run);
+ break;
+ case R.id.rummage:
+ progress = R.layout.key;
+ setContentView(R.layout.key);
+ points+=5;
+ key = true;
+ break;
+ case R.id.jump:
+ gameover = new Intent(PlayScreen.this, GameOver.class);
+ gameover.putExtra("gameover", 4);
+ startActivity(gameover);
+ finish();
+ break;
+ case R.id.throwsword:
+ sword = false;
+ progress = R.layout.throwswordtocuttherope;
+ setContentView(R.layout.throwswordtocuttherope);
+ break;
+ case R.id.walkacross:
+ progress = R.layout.walkacross;
+ setContentView(R.layout.walkacross);
+ setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
+ break;
+ case R.id.opendoor:
+ progress = R.layout.opendoor;
+ setContentView(R.layout.opendoor);
+ Button bkey = (Button) findViewById(R.id.usekey);
+ if(key == false)
+ bkey.setEnabled(false);
+ break;
+ case R.id.picklock:
+ gameover = new Intent(PlayScreen.this, GameOver.class);
+ gameover.putExtra("gameover", 6);
+ startActivity(gameover);
+ finish();
+ break;
+ case R.id.usekey:
+ progress = R.layout.usekey;
+ setContentView(R.layout.usekey);
+ ImageView iv = (ImageView) findViewById(R.id.treasure);
+ TextView tv = (TextView) findViewById(R.id.text2);
+ if((sword == false && treasure == false) || (sword == false && treasure == true)) {
+ iv.setImageResource(R.drawable.sword2);
+ tv.setText("You stumble upon a sword.");
+ sword = true;
+ break;
+ }
+ if(treasure == false && sword == true) {
+ points+=5;
+ treasure = true;
+ break;
+ }
+ if(sword == true && treasure == true) {
+ iv.setImageDrawable(null);
+ tv.setText("...");
+ break;
+ }
+
+ case R.id.gotocastle:
+ progress = R.layout.part3_start;
+ setContentView(progress);
+ break;
+ case R.id.gameover:
+ gameover = new Intent(PlayScreen.this, GameOver.class);
+ gameover.putExtra("gameover", 7);
+ startActivity(gameover);
+ finish();
+ setContentView(progress);
+ break;
+ }
+ }
+
+ public void onImageClick(View view) {
+
+ ImageButton imageButtonClicked = (ImageButton) view;
+
+ switch (imageButtonClicked.getId()) {//hints for part 1 by Nina Ly
+
+ case R.id.helpFairyHint:
+ Toast fairyHints = Toast.makeText(PlayScreen.this, "I will help us get home.", Toast.LENGTH_LONG);
+ fairyHints.setGravity(Gravity.TOP | Gravity.RIGHT, 0, 110);
+ fairyHints.show();
+ break;
+
+ case R.id.choosingPathFairy:
+ Toast choosingPath = Toast.makeText(PlayScreen.this, "I hate the dark, but I am able to light up.", Toast.LENGTH_LONG);
+ choosingPath.setGravity(Gravity.TOP | Gravity.RIGHT, 0, 110);
+ choosingPath.show();
+ break;
+
+ case R.id.darkPathFairy:
+ Toast darkPath = Toast.makeText(PlayScreen.this, "Why don't you ask him for directions?", Toast.LENGTH_LONG);
+ darkPath.setGravity(Gravity.TOP | Gravity.RIGHT, 0, 110);
+ darkPath.show();
+ break;
+
+ case R.id.runAwayFairy:
+ Toast runAway = Toast.makeText(PlayScreen.this, "Tap on the sword to try to pull it out of the rock. Keep trying until you get the sword. It could be useful!", Toast.LENGTH_LONG);
+ runAway.setGravity(Gravity.TOP | Gravity.RIGHT, 0, 110);
+ runAway.show();
+ break;
+
+ case R.id.attackGoblinFairy:
+ Toast jumpHim = Toast.makeText(PlayScreen.this, "I think I heard something... we should get out of here.", Toast.LENGTH_LONG);
+ jumpHim.setGravity(Gravity.TOP | Gravity.RIGHT, 0, 110);
+ jumpHim.show();
+ break;
+
+ case R.id.keepLookingFairy:
+ Toast kl = Toast.makeText(PlayScreen.this, "Seriously.. we should leave now!", Toast.LENGTH_LONG);
+ kl.setGravity(Gravity.TOP | Gravity.RIGHT, 0, 110);
+ kl.show();
+ break;
+
+ case R.id.keepLookingFairy2:
+ Toast kla = Toast.makeText(PlayScreen.this, "I told you we should've left! It's too late now.", Toast.LENGTH_LONG);
+ kla.setGravity(Gravity.TOP | Gravity.RIGHT, 0, 110);
+ kla.show();
+ break;
+
+ case R.id.leaveAfter:
+ Toast leave = Toast.makeText(PlayScreen.this, "Oooo trying pulling the sword.", Toast.LENGTH_LONG);
+ leave.setGravity(Gravity.TOP | Gravity.RIGHT, 0, 110);
+ leave.show();
+ break;
+
+ case R.id.spanishFairy:
+ Toast spanish = Toast.makeText(PlayScreen.this, "Is he speaking in Spanish? We need to learn spanish to understand. Change the language settings on your phone to Spanish to get the English translation. Pointing is rude so don't upset him.", Toast.LENGTH_LONG);
+ spanish.setGravity(Gravity.TOP | Gravity.RIGHT, 0, 110);
+ spanish.show();
+ break;
+
+ case R.id.angryGoblin:
+ Toast angry = Toast.makeText(PlayScreen.this, "Uh oh, your pointing upsetted him. Do you still want to look around?", Toast.LENGTH_LONG);
+ angry.setGravity(Gravity.TOP | Gravity.RIGHT, 0, 110);
+ angry.show();
+ break;
+
+ case R.id.settingButton:
+ startActivityForResult(new Intent(Settings.ACTION_LOCALE_SETTINGS),0);
+ break;
+
+ case R.id.goblinHelp:
+ Toast help = Toast.makeText(PlayScreen.this, "The goblin was very friendly. Let's follow the path.", Toast.LENGTH_LONG);
+ help.setGravity(Gravity.TOP | Gravity.RIGHT, 0, 110);
+ help.show();
+ break;
+
+ case R.id.swordFairy:
+ Toast sword = Toast.makeText(PlayScreen.this, "Hmm.... trying pulling the sword?", Toast.LENGTH_LONG);
+ sword.setGravity(Gravity.TOP | Gravity.RIGHT, 0, 110);
+ sword.show();
+ break;
+
+ case R.id.pullSwordFairy:
+ Toast fairy = Toast.makeText(PlayScreen.this, "Try reading the inscription.", Toast.LENGTH_LONG);
+ fairy.setGravity(Gravity.TOP | Gravity.RIGHT, 0, 110);
+ fairy.show();
+ break;
+
+ case R.id.readInscriptionFairy:
+ Toast rf = Toast.makeText(PlayScreen.this, "Have you done anything bad lately? Maybe we should go.", Toast.LENGTH_LONG);
+ rf.setGravity(Gravity.TOP | Gravity.RIGHT, 0, 110);
+ rf.show();
+ break;
+
+ case R.id.walkAwayFairy:
+ Toast wa = Toast.makeText(PlayScreen.this, "Yay!!!!", Toast.LENGTH_LONG);
+ wa.setGravity(Gravity.TOP | Gravity.RIGHT, 0, 110);
+ wa.show();
+ break;
+
+ case R.id.pullSwordFairy2:
+ Toast ps = Toast.makeText(PlayScreen.this, "If you didn't attack the goblin or if you didn't shoo me away, leave with the sword." +
+ "If you did attack the goblin or shoo me away, you are about to experience karma.", Toast.LENGTH_LONG);
+ ps.setGravity(Gravity.TOP | Gravity.RIGHT, 0, 110);
+ ps.show();
+ break;
+
+ case R.id.leaveFairy:
+ Toast leave1 = Toast.makeText(PlayScreen.this, "I think we're almost home!", Toast.LENGTH_LONG);
+ leave1.setGravity(Gravity.TOP | Gravity.RIGHT, 0, 110);
+ leave1.show();
+ break;
+
+ case R.id.punishment1:
+ Toast p1 = Toast.makeText(PlayScreen.this, "RUN! RUN!", Toast.LENGTH_LONG);
+ p1.setGravity(Gravity.TOP | Gravity.RIGHT, 0, 110);
+ p1.show();
+ break;
+
+ case R.id.punishment2:
+ Toast p2 = Toast.makeText(PlayScreen.this, "Game over :(", Toast.LENGTH_LONG);
+ p2.setGravity(Gravity.TOP | Gravity.RIGHT, 0, 110);
+ p2.show();
+ break;
+
+ } //end switch
+ } //end onImageClick
+
+ public void onClick2(View view){// hints for part 2 by Kevin Nguyen
+ switch(view.getId()) {
+ case R.id.hint1:
+ Toast toast = Toast.makeText(this, "I sense the presense of a vile being in one of the caves. ", Toast.LENGTH_LONG);
+ toast.setGravity(Gravity.TOP | Gravity.RIGHT, 0, 110);
+ toast.show();
+ break;
+ case R.id.hint2:
+ Toast toast2 = Toast.makeText(this, "You can pause and resume gameplay later. ", Toast.LENGTH_LONG);
+ toast2.setGravity(Gravity.TOP | Gravity.RIGHT, 0, 110);
+ toast2.show();
+ break;
+ case R.id.hint3:
+ Toast toast3 = Toast.makeText(this, "He saw us, I'd recommend fighting him. ", Toast.LENGTH_LONG);
+ toast3.setGravity(Gravity.TOP | Gravity.RIGHT, 0, 110);
+ toast3.show();
+ break;
+ case R.id.hint4:
+ Toast toast4 = Toast.makeText(this, "My master, you have died! ", Toast.LENGTH_LONG);
+ toast4.setGravity(Gravity.TOP | Gravity.RIGHT, 0, 110);
+ toast4.show();
+ break;
+ case R.id.hint5:
+ Toast toast5 = Toast.makeText(this, "We're doing pretty well, lets keep going at it. ", Toast.LENGTH_LONG);
+ toast5.setGravity(Gravity.TOP | Gravity.RIGHT, 0, 110);
+ toast5.show();
+ break;
+ case R.id.hint6:
+ Toast toast6 = Toast.makeText(this, "Oh no we have no choice but to fight without the sword. ", Toast.LENGTH_LONG);
+ toast6.setGravity(Gravity.TOP | Gravity.RIGHT, 0, 110);
+ toast6.show();
+ break;
+ case R.id.hint7:
+ Toast toast7 = Toast.makeText(this, "He was just too strong for us. ", Toast.LENGTH_LONG);
+ toast7.setGravity(Gravity.TOP | Gravity.RIGHT, 0, 110);
+ toast7.show();
+ break;
+ case R.id.hint8:
+ Toast toast8 = Toast.makeText(this, "He seems to be asleep from 6PM to 12AM. ", Toast.LENGTH_LONG);
+ toast8.setGravity(Gravity.TOP | Gravity.RIGHT, 0, 110);
+ toast8.show();
+ break;
+ case R.id.hint9:
+ Toast toast9 = Toast.makeText(this, "Wow! A shiny emerald! We should take it! ", Toast.LENGTH_LONG);
+ toast9.setGravity(Gravity.TOP | Gravity.RIGHT, 0, 110);
+ toast9.show();
+ break;
+ case R.id.hint10:
+ Toast toast10 = Toast.makeText(this, "Sometimes you have to play smart! Let's explore! ", Toast.LENGTH_LONG);
+ toast10.setGravity(Gravity.TOP | Gravity.RIGHT, 0, 110);
+ toast10.show();
+ break;
+ case R.id.hint11:
+ Toast toast11 = Toast.makeText(this, "Sorry, even I don't know where to go! ", Toast.LENGTH_LONG);
+ toast11.setGravity(Gravity.TOP | Gravity.RIGHT, 0, 110);
+ toast11.show();
+ break;
+ case R.id.hint12:
+ if(lantern == false) {
+ Toast toast12 = Toast.makeText(this, "It's dark... Im scared! We should go back... ", Toast.LENGTH_LONG);
+ toast12.setGravity(Gravity.TOP | Gravity.RIGHT, 0, 110);
+ toast12.show();
+ }
+ else {
+ Toast toast12 = Toast.makeText(this, "You have a flashlight, shake your device to turn it on! ", Toast.LENGTH_LONG);
+ toast12.setGravity(Gravity.TOP | Gravity.RIGHT, 0, 110);
+ toast12.show();
+ }
+ break;
+ case R.id.hint13:
+ Toast toast13 = Toast.makeText(this, "This dark room is dark and creepy, lets leave! ", Toast.LENGTH_LONG);
+ toast13.setGravity(Gravity.TOP | Gravity.RIGHT, 0, 110);
+ toast13.show();
+ break;
+ case R.id.hint14:
+ Toast toast14 = Toast.makeText(this, "You died! It was by a spider monster. ", Toast.LENGTH_LONG);
+ toast14.setGravity(Gravity.TOP | Gravity.RIGHT, 0, 110);
+ toast14.show();
+ break;
+ case R.id.hint15:
+ Toast toast15 = Toast.makeText(this, "I see something shiny! ", Toast.LENGTH_LONG);
+ toast15.setGravity(Gravity.TOP | Gravity.RIGHT, 0, 110);
+ toast15.show();
+ break;
+ case R.id.hint16:
+ Toast toast16 = Toast.makeText(this, "What a nice find! ", Toast.LENGTH_LONG);
+ toast16.setGravity(Gravity.TOP | Gravity.RIGHT, 0, 110);
+ toast16.show();
+ break;
+ case R.id.hint17:
+ Toast toast17 = Toast.makeText(this, "Hmm try moving your device around to drop the bridge. ", Toast.LENGTH_LONG);
+ toast17.setGravity(Gravity.TOP | Gravity.RIGHT, 0, 110);
+ toast17.show();
+ break;
+ case R.id.hint18:
+ Toast toast18 = Toast.makeText(this, "Master! Why'd you go and do that?!. ", Toast.LENGTH_LONG);
+ toast18.setGravity(Gravity.TOP | Gravity.RIGHT, 0, 110);
+ toast18.show();
+ break;
+ case R.id.hint19:
+ Toast toast19 = Toast.makeText(this, "It was fun while it lasted. On to a new master! ", Toast.LENGTH_LONG);
+ toast19.setGravity(Gravity.TOP | Gravity.RIGHT, 0, 110);
+ toast19.show();
+ break;
+ case R.id.hint20:
+ Toast toast20 = Toast.makeText(this, "Good job you can cross the bridge now! ", Toast.LENGTH_LONG);
+ toast20.setGravity(Gravity.TOP | Gravity.RIGHT, 0, 110);
+ toast20.show();
+ break;
+ case R.id.hint21:
+ Toast toast21 = Toast.makeText(this, "Look it's a door, wonder what's behind... ", Toast.LENGTH_LONG);
+ toast21.setGravity(Gravity.TOP | Gravity.RIGHT, 0, 110);
+ toast21.show();
+ break;
+ case R.id.hint22:
+ Toast toast22 = Toast.makeText(this, "Do you have the skills to pick the lock? If not, use the key. ", Toast.LENGTH_LONG);
+ toast22.setGravity(Gravity.TOP | Gravity.RIGHT, 0, 110);
+ toast22.show();
+ break;
+ case R.id.hint23:
+ Toast toast23 = Toast.makeText(this, "Good thing I can fly. ", Toast.LENGTH_LONG);
+ toast23.setGravity(Gravity.TOP | Gravity.RIGHT, 0, 110);
+ toast23.show();
+ break;
+ case R.id.hint24:
+ Toast toast24 = Toast.makeText(this, "Wow what a find! ", Toast.LENGTH_LONG);
+ toast24.setGravity(Gravity.TOP | Gravity.RIGHT, 0, 110);
+ toast24.show();
+ break;
+ case R.id.hint25:
+ Toast toast25 = Toast.makeText(this, "Onwards to our next journey! ", Toast.LENGTH_LONG);
+ toast25.setGravity(Gravity.TOP | Gravity.RIGHT, 0, 110);
+ toast25.show();
+ break;
+ }
+ }
+
+ public void onClickHint(View view){// part 3 hints by Christian Gumacal
+ Toast toast;
+ switch(progress){
+ case R.layout.part3_start:
+ toast = Toast.makeText(this, "Dang thats a big castle! be careful of that moat", Toast.LENGTH_LONG);
+ toast.setGravity(Gravity.TOP | Gravity.RIGHT, 0, 110);
+ toast.show();
+ break;
+ case R.layout.part3_shout:
+ toast = Toast.makeText(this, "Seriously you tried to yell? just ring the door bell.", Toast.LENGTH_LONG);
+ toast.setGravity(Gravity.TOP | Gravity.RIGHT, 0, 110);
+ toast.show();
+ break;
+ case R.layout.part3_doorbell_emerald:
+ toast = Toast.makeText(this, "Hey did't you find an emerald? why don't you show that to him?", Toast.LENGTH_LONG);
+ toast.setGravity(Gravity.TOP | Gravity.RIGHT, 0, 110);
+ toast.show();
+ break;
+ case R.layout.part3_doorbell_sword:
+ toast = Toast.makeText(this, "Wow this guy is having a bad day... maybe you can help him with that sword of yours", Toast.LENGTH_LONG);
+ toast.setGravity(Gravity.TOP | Gravity.RIGHT, 0, 110);
+ toast.show();
+ break;
+ case R.layout.part3_doorbell_other:
+ toast = Toast.makeText(this, "Wow maybe we should just leave? I guess theres no harm in asking for help though.", Toast.LENGTH_LONG);
+ toast.setGravity(Gravity.TOP | Gravity.RIGHT, 0, 110);
+ toast.show();
+ break;
+ case R.layout.part3_moat:
+ toast = Toast.makeText(this, "Seriously did I not say be careful of the moat? no one ever listens to the fairy.", Toast.LENGTH_LONG);
+ toast.setGravity(Gravity.TOP | Gravity.RIGHT, 0, 110);
+ toast.show();
+ break;
+ case R.layout.part3_emerald:
+ toast = Toast.makeText(this, "See I told you he would listen.", Toast.LENGTH_LONG);
+ toast.setGravity(Gravity.TOP | Gravity.RIGHT, 0, 110);
+ toast.show();
+ break;
+ case R.layout.part3_sword:
+ toast = Toast.makeText(this, "See I told you he would listen.", Toast.LENGTH_LONG);
+ toast.setGravity(Gravity.TOP | Gravity.RIGHT, 0, 110);
+ toast.show();
+ break;
+ case R.layout.part3_threaten:
+ toast = Toast.makeText(this, "Why would you yell at the king!?.", Toast.LENGTH_LONG);
+ toast.setGravity(Gravity.TOP | Gravity.RIGHT, 0, 110);
+ toast.show();
+ break;
+ case R.layout.part3_walk:
+ toast = Toast.makeText(this, "This castle looks even bigger on the inside! oh theres the king better show some respect.", Toast.LENGTH_LONG);
+ toast.setGravity(Gravity.TOP | Gravity.RIGHT, 0, 110);
+ toast.show();
+ break;
+ case R.layout.part3_greet:
+ toast = Toast.makeText(this, "Very nice, very nice.", Toast.LENGTH_LONG);
+ toast.setGravity(Gravity.TOP | Gravity.RIGHT, 0, 110);
+ toast.show();
+ break;
+ case R.layout.part3_askhelp:
+ toast = Toast.makeText(this, "Wow the king needs our help! it would be rude not to at least hear him out.", Toast.LENGTH_LONG);
+ toast.setGravity(Gravity.TOP | Gravity.RIGHT, 0, 110);
+ toast.show();
+ break;
+ case R.layout.part3_listenevil:
+ toast = Toast.makeText(this, "Wow what a predicament, oh no whats that look in your eye?", Toast.LENGTH_LONG);
+ toast.setGravity(Gravity.TOP | Gravity.RIGHT, 0, 110);
+ toast.show();
+ break;
+ case R.layout.part3_listengood:
+ toast = Toast.makeText(this, "Wow what a predicament, I bet we could help if we really try.", Toast.LENGTH_LONG);
+ toast.setGravity(Gravity.TOP | Gravity.RIGHT, 0, 110);
+ toast.show();
+ break;
+ case R.layout.part3_confidenthero:
+ toast = Toast.makeText(this, "Damn straight show him that you're the hero they need!", Toast.LENGTH_LONG);
+ toast.setGravity(Gravity.TOP | Gravity.RIGHT, 0, 110);
+ toast.show();
+ break;
+ case R.layout.part3_thinkhero1:
+ toast = Toast.makeText(this, "Cmon don't sell yourself short, I've seen you do some impressive stuff.", Toast.LENGTH_LONG);
+ toast.setGravity(Gravity.TOP | Gravity.RIGHT, 0, 110);
+ toast.show();
+ break;
+ case R.layout.part3_evilhero:
+ toast = Toast.makeText(this, "of course... how'd I end up getting paired with this psycho.", Toast.LENGTH_LONG);
+ toast.setGravity(Gravity.TOP | Gravity.RIGHT, 0, 110);
+ toast.show();
+ break;
+ case R.layout.part3_ignore:
+ toast = Toast.makeText(this, "Wow you suck but I guess thats fine.", Toast.LENGTH_LONG);
+ toast.setGravity(Gravity.TOP | Gravity.RIGHT, 0, 110);
+ toast.show();
+ break;
+ case R.layout.part3_attackgirl:
+ toast = Toast.makeText(this, "I told you she was strong and now youre dead.", Toast.LENGTH_LONG);
+ toast.setGravity(Gravity.TOP | Gravity.RIGHT, 0, 110);
+ toast.show();
+ break;
+ case R.layout.part3_yield:
+ toast = Toast.makeText(this, "Smart choice! alright time to pick our magic.", Toast.LENGTH_LONG);
+ toast.setGravity(Gravity.TOP | Gravity.RIGHT, 0, 110);
+ toast.show();
+ break;
+ case R.layout.part3_aftermagic:
+ toast = Toast.makeText(this, "I sense the presense of a vile being in one of the caves.", Toast.LENGTH_LONG);
+ toast.setGravity(Gravity.TOP | Gravity.RIGHT, 0, 110);
+ toast.show();
+ break;
+ case R.layout.part3_reward1:
+ toast = Toast.makeText(this, "Alright well at least you got a reward out of it.", Toast.LENGTH_LONG);
+ toast.setGravity(Gravity.TOP | Gravity.RIGHT, 0, 110);
+ toast.show();
+ break;
+ case R.layout.part3_morereward:
+ toast = Toast.makeText(this, "Cmon don't get greedy.", Toast.LENGTH_LONG);
+ toast.setGravity(Gravity.TOP | Gravity.RIGHT, 0, 110);
+ toast.show();
+ break;
+ case R.layout.part3_toomuchreward:
+ toast = Toast.makeText(this, "Holy dang! she killed you... shoulda listened when I said walk away.", Toast.LENGTH_LONG);
+ toast.setGravity(Gravity.TOP | Gravity.RIGHT, 0, 110);
+ toast.show();
+ break;
+ case R.layout.part3_endnomagic:
+ toast = Toast.makeText(this, "I sense the presense of a vile being in one of the caves.", Toast.LENGTH_LONG);
+ toast.setGravity(Gravity.TOP | Gravity.RIGHT, 0, 110);
+ toast.show();
+ break;
+ case R.layout.part3_fightherevil:
+ toast = Toast.makeText(this, "Hey I know you're an evil badass and all but be careful she's strong.", Toast.LENGTH_LONG);
+ toast.setGravity(Gravity.TOP | Gravity.RIGHT, 0, 110);
+ toast.show();
+ break;
+ case R.layout.part3_redmagic:
+ toast = Toast.makeText(this, "This is very powerful against someone who is defending.", Toast.LENGTH_LONG);
+ toast.setGravity(Gravity.TOP | Gravity.RIGHT, 0, 110);
+ toast.show();
+ break;
+ case R.layout.part3_greenmagic:
+ toast = Toast.makeText(this, "This is very powerful against an enemy's physical attacks.", Toast.LENGTH_LONG);
+ toast.setGravity(Gravity.TOP | Gravity.RIGHT, 0, 110);
+ toast.show();
+ break;
+ case R.layout.part3_bluemagic:
+ toast = Toast.makeText(this, "this is very powerful against an enemy's magical attacks.", Toast.LENGTH_LONG);
+ toast.setGravity(Gravity.TOP | Gravity.RIGHT, 0, 110);
+ toast.show();
+ break;
+ case R.layout.part3_fightherevil_d:
+ toast = Toast.makeText(this, "She must be scared but while she is defending we are at a stale mate.", Toast.LENGTH_LONG);
+ toast.setGravity(Gravity.TOP | Gravity.RIGHT, 0, 110);
+ toast.show();
+ break;
+ case R.layout.part3_fightherevil_m:
+ toast = Toast.makeText(this, "She is readying a spell take advantage and attack.", Toast.LENGTH_LONG);
+ toast.setGravity(Gravity.TOP | Gravity.RIGHT, 0, 110);
+ toast.show();
+ break;
+ case R.layout.part3_fightherevil_p:
+ toast = Toast.makeText(this, "that looks strong but slow you should defend and counter!.", Toast.LENGTH_LONG);
+ toast.setGravity(Gravity.TOP | Gravity.RIGHT, 0, 110);
+ toast.show();
+ break;
+ case R.layout.part3_fight_d:
+ toast = Toast.makeText(this, "He must be scared but while he is defending we are at a stale mate.", Toast.LENGTH_LONG);
+ toast.setGravity(Gravity.TOP | Gravity.RIGHT, 0, 110);
+ toast.show();
+ break;
+ case R.layout.part3_fight_m:
+ toast = Toast.makeText(this, "He is readying a spell take advantage and attack.", Toast.LENGTH_LONG);
+ toast.setGravity(Gravity.TOP | Gravity.RIGHT, 0, 110);
+ toast.show();
+ break;
+ case R.layout.part3_fight_p:
+ toast = Toast.makeText(this, "that looks strong but slow you should defend and counter!.", Toast.LENGTH_LONG);
+ toast.setGravity(Gravity.TOP | Gravity.RIGHT, 0, 110);
+ toast.show();
+ break;
+ case R.layout.part3_wizard_appears:
+ toast = Toast.makeText(this, "Be careful he seems strong!", Toast.LENGTH_LONG);
+ toast.setGravity(Gravity.TOP | Gravity.RIGHT, 0, 110);
+ toast.show();
+ break;
+
+ }
+ }
+
+ public void onClickFight(View view){//fight sequence by Christian Gumacal
+ switch(progress){
+ case R.layout.part3_fight_d:
+ case R.layout.part3_fightherevil_d:
+ switch(view.getId()){
+ case R.id.Defend:
+ nextFight();
+ Toast.makeText(this, "Player Health:" + playerHealth + " Enemy Health: " + wizardHealth, Toast.LENGTH_LONG).show();
+ break;
+ case R.id.physicalAttack:
+ playerHealth--;
+ checkDeath();
+ nextFight();
+ break;
+ case R.id.Dodge:
+ Toast.makeText(this, "Player Health:" + playerHealth + " Enemy Health: " + wizardHealth, Toast.LENGTH_LONG).show();
+ nextFight();
+ break;
+ case R.id.DefendE:
+ Toast.makeText(this, "Player Health:" + playerHealth + " Enemy Health: " + princessHealth, Toast.LENGTH_LONG).show();
+ nextFight();
+ break;
+ case R.id.physicalAttackE:
+ playerHealth--;
+ Toast.makeText(this, "Player Health:" + playerHealth + " Enemy Health: " + princessHealth, Toast.LENGTH_LONG).show();
+ checkDeath();
+ nextFight();
+ break;
+ case R.id.DodgeE:
+ Toast.makeText(this, "Player Health:" + playerHealth + " Enemy Health: " + princessHealth, Toast.LENGTH_LONG).show();
+ nextFight();
+ break;
+ }
+ break;
+ case R.layout.part3_fight_p:
+ case R.layout.part3_fightherevil_p:
+ switch(view.getId()){
+ case R.id.Defend:
+ wizardHealth--;
+ Toast.makeText(this, "Player Health:" + playerHealth + " Enemy Health: " + wizardHealth, Toast.LENGTH_LONG).show();
+ checkDeath();
+ nextFight();
+ break;
+ case R.id.physicalAttack:
+ playerHealth--;
+ Toast.makeText(this, "Player Health:" + playerHealth + " Enemy Health: " + wizardHealth, Toast.LENGTH_LONG).show();
+ checkDeath();
+ nextFight();
+ break;
+ case R.id.Dodge:
+ Toast.makeText(this, "Player Health:" + playerHealth + " Enemy Health: " + wizardHealth, Toast.LENGTH_LONG).show();
+ nextFight();
+ break;
+ case R.id.DefendE:
+ princessHealth--;
+ Toast.makeText(this, "Player Health:" + playerHealth + " Enemy Health: " + princessHealth, Toast.LENGTH_LONG).show();
+ checkDeath();
+ nextFight();
+ break;
+ case R.id.physicalAttackE:
+ playerHealth--;
+ Toast.makeText(this, "Player Health:" + playerHealth + " Enemy Health: " + princessHealth, Toast.LENGTH_LONG).show();
+ checkDeath();
+ nextFight();
+ break;
+ case R.id.DodgeE:
+ Toast.makeText(this, "Player Health:" + playerHealth + " Enemy Health: " + princessHealth, Toast.LENGTH_LONG).show();
+ nextFight();
+ break;
+ }
+ break;
+ case R.layout.part3_fight_m:
+ case R.layout.part3_fightherevil_m:
+ switch(view.getId()){
+ case R.id.Defend:
+ playerHealth--;
+ Toast.makeText(this, "Player Health:" + playerHealth + " Enemy Health: " + wizardHealth, Toast.LENGTH_LONG).show();
+ checkDeath();
+ nextFight();
+ break;
+ case R.id.physicalAttack:
+ wizardHealth--;
+ Toast.makeText(this, "Player Health:" + playerHealth + " Enemy Health: " + wizardHealth, Toast.LENGTH_LONG).show();
+ checkDeath();
+ nextFight();
+ break;
+ case R.id.Dodge://next sequence
+ Toast.makeText(this, "Player Health:" + playerHealth + " Enemy Health: " + wizardHealth, Toast.LENGTH_LONG).show();
+ nextFight();
+ break;
+ case R.id.DefendE:
+ playerHealth--;
+ Toast.makeText(this, "Player Health:" + playerHealth + " Enemy Health: " + princessHealth, Toast.LENGTH_LONG).show();
+ checkDeath();
+ nextFight();
+ break;
+ case R.id.physicalAttackE:
+ princessHealth--;
+ Toast.makeText(this, "Player Health:" + playerHealth + " Enemy Health: " + princessHealth, Toast.LENGTH_LONG).show();
+ checkDeath();
+ nextFight();
+ break;
+ case R.id.DodgeE:
+ Toast.makeText(this, "Player Health:" + playerHealth + " Enemy Health: " + princessHealth, Toast.LENGTH_LONG).show();
+ nextFight();
+ break;
+ }
+ break;
+ }
+ }
+
+ void nextFight(){//next random sequence
+ Random rand = new Random();
+ int next = rand.nextInt(10);
+
+ if(progress == R.layout.part3_fight_d || progress == R.layout.part3_fight_p || progress == R.layout.part3_fight_m){
+ if(next <=2){
+ progress = R.layout.part3_fight_d;
+ }else if (next >2 && next <= 6){
+ progress = R.layout.part3_fight_m;
+ }else{
+ progress = R.layout.part3_fight_p;
+ }
+ }
+ else{
+ if(next <=2){
+ progress = R.layout.part3_fightherevil_d;
+ }else if (next >2 && next <= 6){
+ progress = R.layout.part3_fightherevil_m;
+ }else{
+ progress = R.layout.part3_fightherevil_p;
+ }
+ }
+ setContentView(progress);
+ }
+
+
+
+ void checkDeath(){//check death
+ if(wizardHealth <= 0){
+ points += 10;
+ gameover = new Intent(PlayScreen.this, GameOver.class);
+ gameover.putExtra("gameover", 12);
+ startActivity(gameover);
+ finish();
+ }
+ if(princessHealth <= 0){
+ points += 10;
+ gameover = new Intent(PlayScreen.this, GameOver.class);
+ gameover.putExtra("gameover", 11);
+ startActivity(gameover);
+ finish();
+ }
+ if(playerHealth <= 0){
+ gameover = new Intent(PlayScreen.this, GameOver.class);
+ if(wizardHealth < 10){
+ gameover.putExtra("gameover", 10);
+ }else{
+ gameover.putExtra("gameover", 9);
+ }
+ startActivity(gameover);
+ finish();
+ }
+ }
+
+ public void onConfigurationChanged(Configuration newConfig) {//orientation change for part 2 by Kevin
+ super.onConfigurationChanged(newConfig);
+ setContentView(R.layout.changeorientation); //add 5 points here
+ }
+
+ @Override
+ public void onSensorChanged(SensorEvent event) {//Shake sensors for part 2 and 3 used by Kevin and Christian
+ curTime = System.currentTimeMillis();
+
+ if ((curTime - lastUpdate) > UPDATEPERIOD) {
+ long diffTime = (curTime - lastUpdate);
+ lastUpdate = curTime;
+
+ x = event.values[0];
+ y = event.values[1];
+ z = event.values[2];
+
+ float speed = Math.abs(x + y + z - last_x - last_y - last_z) / diffTime * 10000;
+
+ if (speed > SHAKE_THRESHOLD) {
+// Toast toast = Toast.makeText(this, "shook", Toast.LENGTH_SHORT);
+// toast.show();
+ RelativeLayout rl = (RelativeLayout) findViewById(R.id.dc);
+ TextView tv = (TextView) findViewById(R.id.text1);
+ if (progress == R.layout.darkcave && lantern == true) {
+ rl.setBackgroundResource(R.drawable.ogrecave2);
+ tv.setText("It's bright and lit!");
+ lit = true;
+ }
+
+ if(progress == R.layout.part3_fight_d && magic == "red"){
+ wizardHealth-=2;
+ Toast.makeText(this, "Player Health:" + playerHealth + " Enemy Health: " + wizardHealth, Toast.LENGTH_LONG).show();
+ checkDeath();
+ nextFight();
+ }
+ if(progress == R.layout.part3_fight_m && magic == "blue"){
+ wizardHealth-=2;
+ Toast.makeText(this, "Player Health:" + playerHealth + " Enemy Health: " + wizardHealth, Toast.LENGTH_LONG).show();
+ checkDeath();
+ nextFight();
+ }
+ if(progress == R.layout.part3_fight_p && magic == "green"){
+ wizardHealth-=2;
+ Toast.makeText(this, "Player Health:" + playerHealth + " Enemy Health: " + wizardHealth, Toast.LENGTH_LONG).show();
+ checkDeath();
+ nextFight();
+ }
+
+
+
+ last_x = x;
+ last_y = y;
+ last_z = z;
+ }
+ }
+ }
+ @Override
+ public void onAccuracyChanged(Sensor sensor, int accuracy) {
+
+ }
+
+}
+
diff --git a/app/src/main/java/com/example/ninaly/adventuregame453/StartScreen.java b/app/src/main/java/com/example/ninaly/adventuregame453/StartScreen.java
index 89a431f..b595744 100644
--- a/app/src/main/java/com/example/ninaly/adventuregame453/StartScreen.java
+++ b/app/src/main/java/com/example/ninaly/adventuregame453/StartScreen.java
@@ -3,6 +3,7 @@
import android.app.Activity;
import android.content.Intent;
import android.content.SharedPreferences;
+import android.media.MediaPlayer;
import android.os.Bundle;
import android.view.View;
import android.widget.Toast;
@@ -10,12 +11,27 @@
public class StartScreen extends Activity {
public static final String progressData = "Progress_Data";
+ private MediaPlayer mp;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_start_screen);
+ mp = MediaPlayer.create(this, R.raw.instrumental);
+ mp.start();
+ }
+
+ @Override
+ protected void onPause() {
+ super.onPause();
+ mp.stop();
+ }
+
+ @Override
+ protected void onResume() {
+ super.onResume();
+ mp.start();
}
public void onNewGameClick(View view){
@@ -23,39 +39,36 @@ public void onNewGameClick(View view){
SharedPreferences.Editor editor = points.edit();
editor.putInt("points", 0);
- editor.putInt("evil-points", 0);
- editor.putBoolean("lantern", true);
- editor.putBoolean("sword", true);
- editor.putBoolean("emerald", true);
- editor.putInt("part", 1);
+ editor.putInt("evilPoints", 0);
+ editor.putInt("player-health", 10);
+ editor.putInt("princess-health", 7);
+ editor.putInt("wizard-health", 10);
+ editor.putBoolean("lantern", false);
+ editor.putBoolean("sword", false);
+ editor.putBoolean("emerald", false);
+ editor.putBoolean("key", false);
+ editor.putBoolean("treasure", false);
+ editor.putString("magic", "none");
editor.putInt("storyProgress", R.layout.part1_intro);
editor.commit();
- Intent startNewGame = new Intent(StartScreen.this, Part1.class);
+ Intent startNewGame = new Intent(StartScreen.this, PlayScreen.class);
startActivity(startNewGame);
}
public void onContinueClick(View view){
- SharedPreferences points = getSharedPreferences(progressData, 0);
- Intent resumeGame;
- if(points.getInt("part",1) == 1){
- resumeGame = new Intent(StartScreen.this, Part1.class);
- startActivity(resumeGame);
- }else if (points.getInt("part",1) == 2){
- resumeGame = new Intent(StartScreen.this, Cave.class);
- startActivity(resumeGame);
+ Intent resumeGame = new Intent(StartScreen.this, PlayScreen.class);
+ startActivity(resumeGame);
- }else{
- resumeGame = new Intent(StartScreen.this, Part3Castle.class);
- startActivity(resumeGame);
-
- }
}
public void onExitClick(View view){
- System.exit(0);
+ Intent intent = new Intent(Intent.ACTION_MAIN);
+ intent.addCategory(Intent.CATEGORY_HOME);
+ startActivity(intent);
+
}
}
diff --git a/app/src/main/res/drawable/ash.png b/app/src/main/res/drawable/ash.png
new file mode 100644
index 0000000..376123e
Binary files /dev/null and b/app/src/main/res/drawable/ash.png differ
diff --git a/app/src/main/res/drawable/darkwizard.png b/app/src/main/res/drawable/darkwizard.png
new file mode 100644
index 0000000..fdb1cf9
Binary files /dev/null and b/app/src/main/res/drawable/darkwizard.png differ
diff --git a/app/src/main/res/drawable/goblingo.png b/app/src/main/res/drawable/goblingo.png
new file mode 100644
index 0000000..7189129
Binary files /dev/null and b/app/src/main/res/drawable/goblingo.png differ
diff --git a/app/src/main/res/drawable/kingprincess.png b/app/src/main/res/drawable/kingprincess.png
index b00d26f..8797932 100644
Binary files a/app/src/main/res/drawable/kingprincess.png and b/app/src/main/res/drawable/kingprincess.png differ
diff --git a/app/src/main/res/drawable/lightning.jpeg b/app/src/main/res/drawable/lightning.jpeg
new file mode 100644
index 0000000..b0d9d13
Binary files /dev/null and b/app/src/main/res/drawable/lightning.jpeg differ
diff --git a/app/src/main/res/drawable/swordgo.png b/app/src/main/res/drawable/swordgo.png
new file mode 100644
index 0000000..fba0151
Binary files /dev/null and b/app/src/main/res/drawable/swordgo.png differ
diff --git a/app/src/main/res/drawable/zelda.png b/app/src/main/res/drawable/zelda.png
index 72a77ea..2d0d0c9 100644
Binary files a/app/src/main/res/drawable/zelda.png and b/app/src/main/res/drawable/zelda.png differ
diff --git a/app/src/main/res/drawable/zeldamagic.png b/app/src/main/res/drawable/zeldamagic.png
index 8c4bd6a..678cb8a 100644
Binary files a/app/src/main/res/drawable/zeldamagic.png and b/app/src/main/res/drawable/zeldamagic.png differ
diff --git a/app/src/main/res/layout-es/part1_say_hello.xml b/app/src/main/res/layout-es/part1_say_hello.xml
index 147c2e3..ab2287f 100644
--- a/app/src/main/res/layout-es/part1_say_hello.xml
+++ b/app/src/main/res/layout-es/part1_say_hello.xml
@@ -30,12 +30,11 @@
android:layout_height="wrap_content"
android:text="@string/hello"
android:id="@+id/text1"
- android:textStyle="bold"
+ android:textSize="16sp"
+ android:background="@color/black"
android:gravity="center"
android:textColor="@color/white"
- android:layout_alignBottom="@+id/imageView"
- android:layout_alignParentLeft="true"
- android:layout_alignParentStart="true" />
+ android:layout_above="@+id/yesHelp" />
diff --git a/app/src/main/res/layout/cavebeginning.xml b/app/src/main/res/layout/cavebeginning.xml
index b5f1360..a88a8ed 100644
--- a/app/src/main/res/layout/cavebeginning.xml
+++ b/app/src/main/res/layout/cavebeginning.xml
@@ -25,7 +25,7 @@
android:layout_height="wrap_content"
android:text="Regular Cave"
android:id="@+id/regularcave"
- android:onClick="onClick"
+ android:onClick="onClickCave"
android:layout_alignParentBottom="true"/>
diff --git a/app/src/main/res/layout/gameover.xml b/app/src/main/res/layout/gameover.xml
new file mode 100644
index 0000000..586bf7e
--- /dev/null
+++ b/app/src/main/res/layout/gameover.xml
@@ -0,0 +1,65 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/highupcave.xml b/app/src/main/res/layout/highupcave.xml
index 1d602d8..d0de59b 100644
--- a/app/src/main/res/layout/highupcave.xml
+++ b/app/src/main/res/layout/highupcave.xml
@@ -40,7 +40,7 @@
android:text="Go Back"
android:id="@+id/goback"
android:layout_gravity="bottom"
- android:onClick="onClick"
+ android:onClick="onClickCave"
android:layout_above="@+id/jump" />
diff --git a/app/src/main/res/layout/jump.xml b/app/src/main/res/layout/jump.xml
index 4f61823..9573371 100644
--- a/app/src/main/res/layout/jump.xml
+++ b/app/src/main/res/layout/jump.xml
@@ -41,7 +41,7 @@
android:text="Game Over"
android:id="@+id/gameover"
android:layout_gravity="bottom"
- android:onClick="onClick"
+ android:onClick="onClickCave"
android:layout_alignParentBottom="true" />
diff --git a/app/src/main/res/layout/keepattacking.xml b/app/src/main/res/layout/keepattacking.xml
index 1559931..ccb4121 100644
--- a/app/src/main/res/layout/keepattacking.xml
+++ b/app/src/main/res/layout/keepattacking.xml
@@ -50,7 +50,7 @@
android:text="Attack Without Sword"
android:id="@+id/giveup"
android:layout_gravity="bottom"
- android:onClick="onClick"
+ android:onClick="onClickCave"
android:layout_alignParentBottom="true"/>
diff --git a/app/src/main/res/layout/keepsneaking.xml b/app/src/main/res/layout/keepsneaking.xml
index 9a0a7f3..87b518b 100644
--- a/app/src/main/res/layout/keepsneaking.xml
+++ b/app/src/main/res/layout/keepsneaking.xml
@@ -50,7 +50,7 @@
android:text="Game Over"
android:id="@+id/gameover"
android:layout_gravity="bottom"
- android:onClick="onClick"
+ android:onClick="onClickCave"
android:layout_alignParentBottom="true"/>
diff --git a/app/src/main/res/layout/key.xml b/app/src/main/res/layout/key.xml
index 3eedbec..fd6b34d 100644
--- a/app/src/main/res/layout/key.xml
+++ b/app/src/main/res/layout/key.xml
@@ -50,7 +50,7 @@
android:text="Regular Cave"
android:id="@+id/regularcave"
android:layout_gravity="bottom"
- android:onClick="onClick"
+ android:onClick="onClickCave"
android:layout_alignParentBottom="true"/>
diff --git a/app/src/main/res/layout/killtheogreinhissleep.xml b/app/src/main/res/layout/killtheogreinhissleep.xml
index 0595565..e226fb6 100644
--- a/app/src/main/res/layout/killtheogreinhissleep.xml
+++ b/app/src/main/res/layout/killtheogreinhissleep.xml
@@ -35,7 +35,7 @@
android:layout_height="wrap_content"
android:text="Leave"
android:id="@+id/leave"
- android:onClick="onClick"
+ android:onClick="onClickCave"
android:layout_alignParentBottom="true"/>
@@ -36,7 +36,7 @@
android:layout_height="wrap_content"
android:text="Attack Ogre"
android:id="@+id/attackogre"
- android:onClick="onClick"
+ android:onClick="onClickCave"
android:layout_above="@+id/giveup" />
@@ -46,7 +46,7 @@
android:text="Sneak Around"
android:id="@+id/sneakaround"
android:layout_gravity="bottom"
- android:onClick="onClick"
+ android:onClick="onClickCave"
android:layout_above="@+id/attackogre"/>
diff --git a/app/src/main/res/layout/opendoor.xml b/app/src/main/res/layout/opendoor.xml
index 89fb210..8f469ba 100644
--- a/app/src/main/res/layout/opendoor.xml
+++ b/app/src/main/res/layout/opendoor.xml
@@ -27,7 +27,7 @@
android:layout_height="wrap_content"
android:text="Go Back"
android:id="@+id/goback"
- android:onClick="onClick"
+ android:onClick="onClickCave"
android:layout_alignParentBottom="true" />
@@ -45,7 +45,7 @@
android:text="Pick Lock"
android:id="@+id/picklock"
android:layout_gravity="bottom"
- android:onClick="onClick"
+ android:onClick="onClickCave"
android:layout_above="@+id/usekey" />
diff --git a/app/src/main/res/layout/part1_pull_sword.xml b/app/src/main/res/layout/part1_pull_sword.xml
index b087101..cbe7430 100644
--- a/app/src/main/res/layout/part1_pull_sword.xml
+++ b/app/src/main/res/layout/part1_pull_sword.xml
@@ -20,8 +20,7 @@
android:layout_height="100dp"
android:background="@drawable/sword"
android:layout_below="@+id/textView"
- android:layout_centerHorizontal="true"
- android:layout_marginTop="35dp" />
+ android:layout_centerHorizontal="true" />
-
-
-
+ android:layout_above="@+id/text"
+ android:layout_alignParentLeft="true"
+ android:layout_alignParentStart="true" />
+ android:textAlignment="center"
+ android:layout_above="@+id/wizard"
+ android:layout_alignParentLeft="true"
+ android:layout_alignParentStart="true" />
diff --git a/app/src/main/res/layout/part3_askhelp.xml b/app/src/main/res/layout/part3_askhelp.xml
index 8c1a814..59d9d1b 100644
--- a/app/src/main/res/layout/part3_askhelp.xml
+++ b/app/src/main/res/layout/part3_askhelp.xml
@@ -17,7 +17,7 @@
android:layout_height= "100dp"
android:id="@+id/hint"
android:layout_alignParentRight="true"
- android:onClick="onClick"
+ android:onClick="onClickHint"
/>
diff --git a/app/src/main/res/layout/part3_bluemagic.xml b/app/src/main/res/layout/part3_bluemagic.xml
index 9e8720f..644d6e3 100644
--- a/app/src/main/res/layout/part3_bluemagic.xml
+++ b/app/src/main/res/layout/part3_bluemagic.xml
@@ -17,7 +17,7 @@
android:layout_height= "100dp"
android:id="@+id/hint"
android:layout_alignParentRight="true"
- android:onClick="onClick"
+ android:onClick="onClickHint"
/>
@@ -35,7 +35,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/text"
- android:text="will give you a perfect explanation about how to get through extremely tricky situations but will cost you points "
+ android:text="This is the magic of magic reflection and is activated by a shake of your device"
android:textColor="@color/white"
android:textSize="16sp"
android:paddingTop="10dp"
diff --git a/app/src/main/res/layout/part3_confidenthero.xml b/app/src/main/res/layout/part3_confidenthero.xml
index 136df2b..21046cd 100644
--- a/app/src/main/res/layout/part3_confidenthero.xml
+++ b/app/src/main/res/layout/part3_confidenthero.xml
@@ -17,7 +17,7 @@
android:layout_height= "100dp"
android:id="@+id/hint"
android:layout_alignParentRight="true"
- android:onClick="onClick"
+ android:onClick="onClickHint"
/>
@@ -35,7 +35,7 @@
diff --git a/app/src/main/res/layout/part3_endnomagic.xml b/app/src/main/res/layout/part3_endnomagic.xml
index 18ef9b9..e03fd8f 100644
--- a/app/src/main/res/layout/part3_endnomagic.xml
+++ b/app/src/main/res/layout/part3_endnomagic.xml
@@ -17,7 +17,7 @@
android:layout_height= "100dp"
android:id="@+id/hint"
android:layout_alignParentRight="true"
- android:onClick="onClick"
+ android:onClick="onClickHint"
/>
diff --git a/app/src/main/res/layout/part3_evilhero.xml b/app/src/main/res/layout/part3_evilhero.xml
index c3b26e4..a3f99ae 100644
--- a/app/src/main/res/layout/part3_evilhero.xml
+++ b/app/src/main/res/layout/part3_evilhero.xml
@@ -17,7 +17,7 @@
android:layout_height= "100dp"
android:id="@+id/hint"
android:layout_alignParentRight="true"
- android:onClick="onClick"
+ android:onClick="onClickHint"
/>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/src/main/res/layout/part3_fight_m.xml b/app/src/main/res/layout/part3_fight_m.xml
new file mode 100644
index 0000000..35b63ef
--- /dev/null
+++ b/app/src/main/res/layout/part3_fight_m.xml
@@ -0,0 +1,70 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/src/main/res/layout/part3_fight_p.xml b/app/src/main/res/layout/part3_fight_p.xml
new file mode 100644
index 0000000..d6c8273
--- /dev/null
+++ b/app/src/main/res/layout/part3_fight_p.xml
@@ -0,0 +1,70 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/src/main/res/layout/part3_fightherevil.xml b/app/src/main/res/layout/part3_fightherevil.xml
index e47f1d4..4907e4e 100644
--- a/app/src/main/res/layout/part3_fightherevil.xml
+++ b/app/src/main/res/layout/part3_fightherevil.xml
@@ -17,24 +17,24 @@
android:layout_height= "100dp"
android:id="@+id/hint"
android:layout_alignParentRight="true"
- android:onClick="onClick"
+ android:onClick="onClickHint"
/>
+ android:layout_centerHorizontal="true"
+ android:layout_alignParentBottom="true" />
-
-
-
+ android:layout_below="@+id/hint" />
-
+
+
+
+
+
+
diff --git a/app/src/main/res/layout/part3_howgirl.xml b/app/src/main/res/layout/part3_fightherevil_m.xml
similarity index 63%
rename from app/src/main/res/layout/part3_howgirl.xml
rename to app/src/main/res/layout/part3_fightherevil_m.xml
index a71d0ae..746dd4b 100644
--- a/app/src/main/res/layout/part3_howgirl.xml
+++ b/app/src/main/res/layout/part3_fightherevil_m.xml
@@ -17,52 +17,54 @@
android:layout_height= "100dp"
android:id="@+id/hint"
android:layout_alignParentRight="true"
- android:onClick="onClick"
+ android:onClick="onClickHint"
/>
-
-
-
+ android:layout_below="@+id/hint" />
-
+
+
+
+
+
+
diff --git a/app/src/main/res/layout/part3_fightherevil_p.xml b/app/src/main/res/layout/part3_fightherevil_p.xml
new file mode 100644
index 0000000..6dc0849
--- /dev/null
+++ b/app/src/main/res/layout/part3_fightherevil_p.xml
@@ -0,0 +1,70 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/src/main/res/layout/part3_greenmagic.xml b/app/src/main/res/layout/part3_greenmagic.xml
index f4c14c9..78a1199 100644
--- a/app/src/main/res/layout/part3_greenmagic.xml
+++ b/app/src/main/res/layout/part3_greenmagic.xml
@@ -17,7 +17,7 @@
android:layout_height= "100dp"
android:id="@+id/hint"
android:layout_alignParentRight="true"
- android:onClick="onClick"
+ android:onClick="onClickHint"
/>
@@ -35,7 +35,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/text"
- android:text="may activate as many time throughout the game and will get you through certain tricky situations "
+ android:text="This is the magic of wind barrier and is activated a shake of your device"
android:textColor="@color/white"
android:textSize="16sp"
android:paddingTop="10dp"
diff --git a/app/src/main/res/layout/part3_greet.xml b/app/src/main/res/layout/part3_greet.xml
index 2abddc5..f192d77 100644
--- a/app/src/main/res/layout/part3_greet.xml
+++ b/app/src/main/res/layout/part3_greet.xml
@@ -17,7 +17,7 @@
android:layout_height= "100dp"
android:id="@+id/hint"
android:layout_alignParentRight="true"
- android:onClick="onClick"
+ android:onClick="onClickHint"
/>
@@ -47,4 +47,13 @@
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true" />
+
+
diff --git a/app/src/main/res/layout/part3_ignore.xml b/app/src/main/res/layout/part3_ignore.xml
index 747c827..c65708c 100644
--- a/app/src/main/res/layout/part3_ignore.xml
+++ b/app/src/main/res/layout/part3_ignore.xml
@@ -17,7 +17,7 @@
android:layout_height= "100dp"
android:id="@+id/hint"
android:layout_alignParentRight="true"
- android:onClick="onClick"
+ android:onClick="onClickHint"
/>
@@ -61,7 +61,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/text"
- android:text="The King: There was a prophecy that a hero holding the sword of a king would come and save us, We believe you to be hero and we would like to ask your help and offer what assistance we can "
+ android:text="The King: There has been word of a great evil looming over our kingdom we need help from you great hero!"
android:textColor="@color/white"
android:textSize="16sp"
android:paddingTop="10dp"
diff --git a/app/src/main/res/layout/part3_listengood.xml b/app/src/main/res/layout/part3_listengood.xml
index 4f3a6db..6f8ae9c 100644
--- a/app/src/main/res/layout/part3_listengood.xml
+++ b/app/src/main/res/layout/part3_listengood.xml
@@ -17,7 +17,7 @@
android:layout_height= "100dp"
android:id="@+id/hint"
android:layout_alignParentRight="true"
- android:onClick="onClick"
+ android:onClick="onClickHint"
/>
@@ -25,7 +25,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Accept"
- android:id="@+id/endNoMagic"
+ android:id="@+id/aftermagic"
android:onClick="onClick"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
@@ -38,7 +38,7 @@
android:id="@+id/tooMuchReward"
android:layout_gravity="bottom"
android:onClick="onClick"
- android:layout_above="@+id/endNoMagic"
+ android:layout_above="@+id/aftermagic"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true" />
@@ -46,7 +46,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/text"
- android:text="we will give you 1000 gold coins "
+ android:text="we will give you 1000 gold coins but no more"
android:textColor="@color/white"
android:textSize="16sp"
android:paddingTop="10dp"
diff --git a/app/src/main/res/layout/part3_redmagic.xml b/app/src/main/res/layout/part3_redmagic.xml
index 5c81dd1..d22caa8 100644
--- a/app/src/main/res/layout/part3_redmagic.xml
+++ b/app/src/main/res/layout/part3_redmagic.xml
@@ -18,7 +18,7 @@
android:layout_height= "100dp"
android:id="@+id/hint"
android:layout_alignParentRight="true"
- android:onClick="onClick"
+ android:onClick="onClickHint"
/>
@@ -48,7 +48,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/text"
- android:text="may activate as many times throughout the game and will get you out of fighting once it has started"
+ android:text="This is the magic of grand fireball very powerful and is activated by a shake of your device"
android:textColor="@color/white"
android:textSize="16sp"
android:paddingTop="10dp"
diff --git a/app/src/main/res/layout/part3_reward1.xml b/app/src/main/res/layout/part3_reward1.xml
index 0888655..bb17599 100644
--- a/app/src/main/res/layout/part3_reward1.xml
+++ b/app/src/main/res/layout/part3_reward1.xml
@@ -18,7 +18,7 @@
android:layout_height= "100dp"
android:id="@+id/hint"
android:layout_alignParentRight="true"
- android:onClick="onClick"
+ android:onClick="onClickHint"
/>
diff --git a/app/src/main/res/layout/part3_thinkhero1.xml b/app/src/main/res/layout/part3_thinkhero1.xml
index 5996e55..71001c1 100644
--- a/app/src/main/res/layout/part3_thinkhero1.xml
+++ b/app/src/main/res/layout/part3_thinkhero1.xml
@@ -17,41 +17,31 @@
android:layout_height= "100dp"
android:id="@+id/hint"
android:layout_alignParentRight="true"
- android:onClick="onClick"
+ android:onClick="onClickHint"
/>
-
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/src/main/res/layout/part3_yield.xml b/app/src/main/res/layout/part3_yield.xml
index 4e96fd8..d161b6b 100644
--- a/app/src/main/res/layout/part3_yield.xml
+++ b/app/src/main/res/layout/part3_yield.xml
@@ -18,7 +18,7 @@
android:layout_height= "100dp"
android:id="@+id/hint"
android:layout_alignParentRight="true"
- android:onClick="onClick"
+ android:onClick="onClickHint"
/>
diff --git a/app/src/main/res/layout/regularcave.xml b/app/src/main/res/layout/regularcave.xml
index af5b26d..2728dfc 100644
--- a/app/src/main/res/layout/regularcave.xml
+++ b/app/src/main/res/layout/regularcave.xml
@@ -27,7 +27,7 @@
android:layout_height="wrap_content"
android:text="Cave With a Breeze"
android:id="@+id/cavewithabreeze"
- android:onClick="onClick"
+ android:onClick="onClickCave"
android:layout_alignParentBottom="true" />
@@ -45,7 +45,7 @@
android:text="Dark Cave"
android:id="@+id/darkcave"
android:layout_gravity="bottom"
- android:onClick="onClick"
+ android:onClick="onClickCave"
android:layout_above="@+id/highupcave"/>
diff --git a/app/src/main/res/layout/sneakaround.xml b/app/src/main/res/layout/sneakaround.xml
index 6236dbf..aaf1692 100644
--- a/app/src/main/res/layout/sneakaround.xml
+++ b/app/src/main/res/layout/sneakaround.xml
@@ -26,7 +26,7 @@
android:layout_height="wrap_content"
android:text="Attack Ogre"
android:id="@+id/attackogre"
- android:onClick="onClick"
+ android:onClick="onClickCave"
android:layout_above="@+id/giveup" />
@@ -47,7 +47,7 @@
android:text="Take It And Leave"
android:id="@+id/takeit"
android:layout_gravity="bottom"
- android:onClick="onClick"
+ android:onClick="onClickCave"
android:layout_above="@id/leaveit"/>
diff --git a/app/src/main/res/layout/travelforwardwithlight.xml b/app/src/main/res/layout/travelforwardwithlight.xml
index aafa422..42e16c8 100644
--- a/app/src/main/res/layout/travelforwardwithlight.xml
+++ b/app/src/main/res/layout/travelforwardwithlight.xml
@@ -38,7 +38,7 @@
android:text="Rummage Through The Bones."
android:id="@+id/rummage"
android:layout_gravity="bottom"
- android:onClick="onClick"
+ android:onClick="onClickCave"
android:layout_alignParentBottom="true"/>
diff --git a/app/src/main/res/layout/walkacross.xml b/app/src/main/res/layout/walkacross.xml
index 5b5cbb2..1f874c6 100644
--- a/app/src/main/res/layout/walkacross.xml
+++ b/app/src/main/res/layout/walkacross.xml
@@ -27,7 +27,7 @@
android:layout_height="wrap_content"
android:text="Go Back"
android:id="@+id/goback"
- android:onClick="onClick"
+ android:onClick="onClickCave"
android:layout_alignParentBottom="true" />
#303F9F
#FF4081
#FFFFFF
- #000000
+ #A6000000
#80000000
+ #000000
diff --git a/app/src/main/treasureclip-web.png b/app/src/main/treasureclip-web.png
new file mode 100644
index 0000000..aaac1f6
Binary files /dev/null and b/app/src/main/treasureclip-web.png differ