Category Archives: Android

WikiWar

WikiWar Download
WikiWar is now finished and is available to download on the app store. I have also had my code interview for the app with my lecturer and received an A1 for the project. I am very happy with how the project has turned out and this post is going to talk about the final game and what I worked on.

The purpose of the game is to use Wikipedia to get from one page to another. You are rated by speed or skill depending on the game mode you chose. The game modes are:

wikiwar1
Standard
: Get from a set start to a set end point and you are rated on how few clicks you use

Timed: Similar to standard but with different presets and you are rated on how fast you complete the levle

Random: Gets a random starting point from Wikipedia (it can be ANYTHING) and picks from a large random list of preset pages as your end

Multiplayer: Pass-and-Play between two people. One chooses the start and the other chooses the end. The winner is whoever uses fewer clicks

The variety of modes adds lots of different ways to play and keeps people interested longer.

While playing there are a few things that the player can do. They can read through the Wikipedia page looking for a relevant link on the webview. They also can click the question mark at the top to remind themself of where they are trying to get to. For a faster game you can use the search feature which allows you to search for a word on the page that you feel may help you complete the level.
wikiwar5

My main work was focused on the modes themselves. I started off by making the basic game activity and created the Standard mode. The menu and game activity were used by others to make the random mode and timed modes. They used the template and added in the appropriate code. I also worked on the multiplayer mode (previous post on this). I also worked on creating the win screen and displaying the stars to rate your performance.
wikiwar2 wikiwar3wikiwar4

Advertisements
Tagged , , ,

Wikiwar Complete

WikiWar Download

We have finished the project and I am quite pleased with the result. I may do a further write up on the complete app but for now here is a link to download and try it yourself.

 

Tagged , , ,

WikiWar: Multiplayer

I have been working on a multiplayer mode for the app WikiWar. We decided that a “pass and play” mode could be added into the game quite easily. Its base is still the same as a normal mode but there is some more stuff added. Before the game starts each player will get to select a wikipedia page from a lot of options. Player One will select the starting point and Player Two will select the end point. The game will then start.

First Player One will play through the game. When they reach the end point, the game will reset and Player Two will get to play through the game. A Popup box appears informing Player One to hand over the device. Each score is saved and then checks which is higher. The Activity that runs when a game ends now will display the winner.

private void showPopUp() {

AlertDialog.Builder helpBuilder = new AlertDialog.Builder(this);
helpBuilder.setTitle("Round Over");
helpBuilder.setMessage("Pass the device to Player Two");
helpBuilder.setPositiveButton("Ok",
new DialogInterface.OnClickListener() {

public void onClick(DialogInterface dialog, int which) {
stack.clear();
stack.push(startPoint);

loadWebView();
}
});

// Remember, create doesn't show the dialog
AlertDialog helpDialog = helpBuilder.create();
helpDialog.show();
}

 

if(url.equals(endPoint))
			{
				if(playerOne)
				{
					playerOne = false;
					countP1 = count;
					count = 0;
					current = startPoint;
					showPopUp();
				}
				else
				{
					String winner;
					countText.setText("You win");
					countP2 = count;
					if(countP1 > countP2)
					{
						winner = "Player One";
					}
					else if (countP2 > countP1)
					{
						winner = "Player Two";
					} else
					{
						winner = "NO ONE!! It's a draw!";
					}

					Intent intent = new Intent(MultiActivity.this, WinActivity.class);
					intent.putExtra("winner", winner);
					intent.putExtra("single", false);
					System.out.println("Working4");
	        		startActivity(intent);
				}

			}
Tagged , , ,

Android Development: Wikiwar

My latest project that Im working on is an app for a college project. Its a group project with two other people. Its called Wikiwar and its a game that users must navigate through wikipedia linking different pages together. I think it works well for the project as it combines some nice android development techniques with a fun game mechanic. My work has started on creating a leveled mode. The mode consists of a number of preset starting and ending points on wikipedia and the player is rated by how few “clicks” or links they use to get from start to end. Android development is somewhat different to normal programming but I enjoy it quite a bit.

I started by storing the urls to the pages in the strings.xml file. Then I created buttons on the menu activity. Then in the xml for the button I use android:onClick and load a method in the java file. This method starts the game activity and and passes in the two relevant urls from the strings.xml. Each button will have its own method to load the correct data to start the game.

public void loadFour(View v)
{
Resources res = getResources();
String start = res.getString(R.string.nfl); //load string from xml file
String end = res.getString(R.string.nhl);
Intent intent = new Intent(this,StandardActivity.class);// creating an intent to launch the about activity
intent.putExtra("start_url",start); // pass in url strings to activity
intent.putExtra("end_url", end);
startActivity(intent);
}

<Button
 android:id="@+id/levelFour"
 android:layout_width="wrap_content"
 android:layout_height="wrap_content"
 android:layout_alignLeft="@+id/levelTwo"
 android:layout_below="@+id/levelThree"
 android:onClick="loadFour"
 android:text="@string/four" />

Tagged , , ,