Friday, May 24, 2013

Android Football!

Allow me to announce my latest Android game: Android Football!


I've always wanted to create a football game, and with touchscreen controls it gets round the problem that old-style football games have in deciding which football player is under control.

But before kick off, the first thing to do is choose your teams formation.  One aspect I'm quite please with is the AI of the players.  They always seem to be in the right place at the right time.



Once the game has kicked off, you control the players by dragging a line from the player to where you want them to go.


The players will automatically kick the ball when they hit it.  The direction is determined by the angle the touch the ball at, in the same way as a game of air-hockey (though this game is thankfully not quite as frenetic!).


The free version only has friendly games, but gives you all the features of the actual match so you decide if you like the game.  In the full version you can also play in a league, and choose the number of other teams.  If it proves a success, I'll be adding a Knockout Tournament option to.

Thursday, May 09, 2013

I've had a great idea!

I know, I'll add the Google+ API to my game Stellar Forces!  That way, new players will be able to sign up quickly and easily!

[3 hours later, after jumping through lots of Google-shaped hoops...]

What a waste of time.  I think I'll keep it the way it was.

Friday, April 26, 2013

When is Normal not Normal?

Say you've got a vector that you want to normalize:-

Vector v = new Vector([a number], [another number]);
v.normalize();

What would you expect to happen if both your numbers (maybe the movement vector of your space invader) were 0?

I would hope it would return a vector of (0, 0), so that when you added this vector to your sprite's co-ords, it didn't move.  Which, with a vector of 0, 0, would be correct.

Unfortunately, in Android Java (and maybe normal Java as well), it returns (NaN, NaN), which is no use to anyone.  I'd prefer an error at least (failfast?) so that I knew something unexpected was happening.  With NaN, all your sums suddenly go awry, and until you know the above piece of information, you'll spend ages trying to work out just how your vector is turning into garbage and why your sprite has decided to move to infinity on both axis.

Wednesday, March 06, 2013

Was making money harder then or now? [Android]

I'm at that common stage of Android development where I'm wondering what my next project should be.  I'm tempted to do something in 3D, but it always turns into a maths nightmare.  Note to self: Don't do it!

I've recently finished my last app, a platformer called "Ninja!".  It's pretty good, and I might use the engine for something a little more complex - I'm thinking a Bladerunner-y / Judge Dredd.  However, I am put off by the sheer number of other platform games available on Android (not that the platform genre is any more saturated than any other genre on Android).  Who would even notice my game?  I guess that's why marketing is so important on Android now, probably more so than the programming.

But then I look back to the golden age of gaming (in Thatcher's Britain anyway): the mid-80's, when it was predominatly the Spectrum that everyone played on (and maybe the C64 if desperate).  How do conditions now compare to then?  There may be thousands of platform games available for Android, but there are also millions of users playing them.  What was it like in the 80's?  According to Wikipedia, 5 million Spectrums were sold and 24,000 programs were released.  According to some random website I found after Googling, there are 295 million Android phones and 460,000 Android apps.  Despite the fact that these numbers are untrustworthy and vague, lets work out the average:-

Spectrum:-
5,000,000 devices and 24,000 programs = 208 customers per program.

Android
295,000,000 devices and 460,000 apps = 641 customers per app.

So it seems that despite the competition, we've got it over 3 times better than they did in the 80's.  Still, it doesn't seem like it.  Maybe I should stop programming and do marketing for the time being.

Monday, February 11, 2013

New Android Game: Ninja!


It's a platformer.  Avoid the enemy ninjas (or throw shurikens at them) and negotiate the fiendish levels.

One of the great things about creating a "platformer engine" is that once it's created, it's simply a case of having fun designing levels.  Going through historically classic platformers and implementing your own version of their ideas, and being able to play it straight away, makes all the hard work worthwhile.

I've also written the code for moving platforms, but I'm still trying to work out how to include them in the map data; the map data only handles a block type in each "cell", whereas moving platforms require data on the direction to move in, and the distance.  More on that in a future post.

Anyway, find Ninja! here!


Tuesday, February 05, 2013

Eclipse Hangs or Freezes on Startup

Try this:-

  1. cd .metadata/.plugins
  2. mv org.eclipse.core.resources org.eclipse.core.resources.bak
  3. Start eclipse. (It should show an error message or an empty workspace because no project is found.)
  4. Close all open editors tabs.
  5. Exit eclipse.
  6. rm -rf org.eclipse.core.resources (Delete the newly created directory.)
  7. mv org.eclipse.core.resources.bak/ org.eclipse.core.resources (Restore the original directory.)
  8. Start eclipse and start working
 (Thanks to Olaf)

Monday, November 12, 2012

Installing Java for Applets

I've blogged before about the fact that Sun (and now Oracle) like to make it as difficult as possible to get Java working, especially for applets.  You can spend hours trawling the new for soutions, but often they don't work due to differing versions of your OS, of Java and your browser.

However, for future reference I've found this page which seems to wort and is incredibly simple:-

http://www.webupd8.org/2012/01/install-oracle-java-jdk-7-in-ubuntu-via.html