Uncategorized

Splorr! (Opening and Closing Doors)

Splorr! Now has the ability to open and close doors!

And I think I’m doing to stick with the tap-fest that is my UI.

At first, I was thinking that I wanted to be able to have the player accomplish tasks with a low number of taps, ideally 1 tap for each action.

Then I realized that I don’t, actually. Let the player tap seven times to perform an action. It’ll make him feel like he’s accomplished something.

For example, I’ll take you through a typical action sequence upon entering a room.

In the following image, I’ve just entered a room:

At the moment, I’m facing a wall, the door I just opened and went through is behind me, and there is a passageway to the right.

I don’t want to go back to the room I was just in, so I decide to turn right and go through the passageway.

First, I tap the “Move/Turn” button.

Now I tap turn right to get the following:

Now that I am facing the right way, I move forward in two taps, first by tapping “Move/Turn”:

And then by tapping “Move Forward”, whereupon I will see the following status:

And now there is a closed door in front of me.  To open it, I need three taps.  First, I tap “Room”

Then I tap “Doors/Walls”

And finally tap “Open Door”.

And so, the game becomes a bit of a micro-managing tapfest, but I think that’s what I want.

 

Uncategorized

Stock Market Game Released

Today I finally got Stock Market published.

You can find the support page here.  It has a the googl play badge.

While still a long way from being highly engaging, these games are getting more complex as they get more “sophisticated”.

However, I’m still not done with the “show some text and push buttons” genre.

I am, however, rather sick of the games where the outcome of the game is totally random.

I might as well be making a slot machine game (which is actually on the list, btw, but as a graphical game).

In stock market, I have so far not seen any reason not to do the following:

Buy one stock of each type.

Click “end turn” until the game is over.

It isn’t like there is some data upon which to base how well a stock can do.

Which means I may as well not bother making a choice at all.

Games are about choices.  Well, compelling games are about choices.  Sometimes the only winning move is not to play.

Next on the docket: Splore!  Of course, it may not come out next, but I want to work on it next.

I don’t really want to say too to describe Splore, or I’ll tend to have a lot of text written about a game that doesn’t exist.  The basic idea is a text based HamQuest.

Uncategorized

Russian Roulette Completed

So, I managed to get RR done today.

Rather than my “one activity=one game state” idea that I used for GMN and RSP, I went with a single activity for everything, and using setContentView to change the UI for the states.

Generally, it worked extremely well.

Except.

The one edit text I was using (the one where you type in the number) first wouldn’t cause the soft keyboard to come up.

Fixed that.

Then the soft keyboard wouldn’t hide unless the “back” key was pressed.

No good.

Eventually, figured it out, mostly by googling code until finding something suitable at stackexchange.

Had to hide it myself.

Not a big deal, but it was not something I had to deal with when it was one activity per page.

Maybe that was the better way?

Dunno.

Uncategorized

A Few Things, Mostly Android Related

First, I “finished” Rock, Scissors, Paper.  Here’s the support page.

A few post-mortem items about RSP:

  • Subclasses of Activity do not make good game states.
  • I’ve officially outgrown LinearLayout.
  • “There Has Got To Be A Better Way”™ to manage strings.

The next game is either Russian Roulette or Feed the Fish, dunno which.

After another quick game or two, I’m going to need to put a link or something on the about page to my “publisher page”.

Also, after a few days of being up there, GMN has had three whole installs.  One was me. Another was my wife.  A third was from somebody in the UK.  Thanks, guy in the UK. Eventually I’ll get to making something worth playing on this platform.

In my current projects, I’m taking a page from the publishers of my books: build a vast array of craptacular titles so that on your two or three good titles, you can mention that you have a large number of titles available.

However, I will be sticking with free until I actually make something worth paying for.

Uncategorized

Android Development Day Two

Today, learned a few things.

How to move from one Activity to another.

A bit more about the xml layout for controls, specifically layout weights.

The eclipse built-in way to take a screen shot from the emulator.

Even a simple game like “Guess My Number” needs things like a Main Menu, an Instructions page, and an About page.

I also bought myself a developer registration for the Google Play store.

Yes, I’m actually planning to publish the craptacular “Guess My Number”.

And I’m doing it in Java, not a cross platform hoop-de-hoo.

Why?

I already know Eclipse.

I’ve already been working in Java relatively steadily for Minecraft Plugins and other side projects.

The android UI stuff isn’t very hard.

And I’m already time constrained. Church, house, job, kid, marriage (alphabetical order).

And the entry fee was only $25.

Basically, if I do nothing more than release GMN for free in Google Play, then the $25 I spent was worth it, because I get an accomplishment badge – “Published Android App”.

If I go on to do a bunch of other craptacular games: Russian Roulette; Rock, Scissors, Paper; a turn based “Stock Market” simulator; and things akin to old David Ahl games, then all the better.

If I improve in my command of the platform, and decide to go more sophisticated, I can do that.

If one day I find something sell-able, I can do that, too.

And if I don’t…. $25.

 

Uncategorized

A Complete Android Game

And here’s the source code:

package com.pdg.android.sandbox;

import java.util.Random;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.widget.EditText;
import android.widget.TextView;

public class SandboxActivity extends Activity {
    private static final int INITIAL_GUESS_COUNT = 0;
	private static final int NUMBER_MAXIMUM = 100;
	private static final int NUMBER_MINIMUM = 1;
	private int guessCount;
	private Random random = new Random();
	private int number;

	/** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        startGame();
    }

    private void startGame() {
    	pickNumber();
    	setGuessCount(INITIAL_GUESS_COUNT);
    	setPrompt(getString(R.string.guess_my_number));
    	updateGuessStatus();
	}

	private void pickNumber() {
		setNumber(random.nextInt(NUMBER_MAXIMUM-NUMBER_MINIMUM+1)+NUMBER_MINIMUM);
	}

	private void setNumber(int theNumber) {
		number = theNumber;
	}

	private int getNumber(){
		return number;
	}

	private void updateGuessStatus() {
    	setGuessStatus(String.format(getString(R.string.guess_count_format), getGuessCount()));
	}

	private void setGuessStatus(String theGuessStatus) {
		TextView tv = (TextView)findViewById(R.id.guessCount);
		tv.setText(theGuessStatus);
	}

	private int getGuessCount() {
		return guessCount;
	}

	private void setGuessCount(int theGuessCount) {
		guessCount = theGuessCount;
	}

	private void setPrompt(String thePrompt) {
		TextView tv = (TextView)findViewById(R.id.prompt);
		tv.setText(thePrompt);
	}

	public void guessButtonPressed(View view){
		EditText et = (EditText)findViewById(R.id.currentGuess);
		int theGuess = Integer.parseInt(et.getText().toString());
		setGuessCount(getGuessCount()+1);
		updateGuessStatus();
		if(theGuessgetNumber()){
			setPrompt(getString(R.string.guess_too_high));
		}else{
			setPrompt(getString(R.string.guess_correct));
			setGuessCount(INITIAL_GUESS_COUNT);
			pickNumber();
		}
    }
}

Yes, it is the perennial classic “Guess My Number 1 to 100” game that just about everyone has written.

Why did I write this?

Mainly, I’m teaching myself the view based xml ui for android.

This is how I do it.

By writing an entirely too simplistic game.

But now I know how to put resources correctly into xml files, how to grab widgets by id, and how to set text values on TextViews.

Of course, the thing still blows up if you don’t put anything into the edit box and press “Guess!”, but that’s a feature!