Last days I’ve spent some time making some tests with collision detection on Android. It could be easy to use the simple approach to test if two circles overlap on each frame using the simplest game loop:

while (playing)
{
  updateGame();
  draw();
}

But I’ve bought my phone for fun, to enjoy doing hard things :D or at least trying to make them in the good way. So I started to read about proper game loop design.

I must say it’s quite hard to find nice articles, most of them just present a buggy deltatime based model, but fortunately I found two very nice articles about it:

Regarding the collision detection I also found two articles, quite old but still useful: Pool Hall Lessons: Fast, Accurate Collision Detection Between Circles or Spheres and Simple Intersection Tests For Games

When you try to check on each frame if two objects collide, you could get into error very easy if the objects move at high speed. It happens if the distance they’ll move from one frame to another is bigger than the size of then so they just jump/pass through each other like a ghost :)

To prevent it I check the movement from the last frame to the current one to to see if the objects collide between the frames.

It has been a week since I got my android phone, and I’ve already manage to create a little application trying to fit together basic functionality on it

It’s just a game where you should touch the last circle that appears on the screen. Quite simple but enough for the beginning :)

It features:

  • Basic canvas drawing
  • Sound playing and vibration on success or fail
  • Save game preferences: username, play sounds, vibration
  • Download and upload hiscores from an online server

As I said it’s quite enough to start playing with it.

I hope you’ll enjoy it (and also I hope to beat Dubito score :)

Here you’ll go directly to the android market, otherwise you could try to find Visual memory from bitkore (More about that in the future :))

After being reading few chapters from Learn Android in 24 Hours-kinda books, I couldn’t resist so I jumped to Canvas graphics. Just a panel to draw whatever you want and be able to control basic events.

Today in the job a friend of mine showed me a simple visual game so I decided that this could be a good hello world application.

Of course is still just a draft but I’m quite happy with the programming experience while coding it and reading about the SDK

More tests coming soon :)

Android screenshots

Last days I decided to get a new toy :) (I really deserved it). The toy is the amazing Samsung Galaxy S with the, more amazing even, Android OS.

I should confess I’m quite impress with the usability of this device. Just plug in your computer and copy your files, pdf, docx, pptx, mp3, avi (divx). You dont need any disgusting software (itunes) or any converter for those file formats, just really plug and play.

And speaking about the phone itself, it’s quite beautiful, lightweight and the screen is very big and with bright colours (AMOLED 4”). It has also quite good perfomance as you can see on this video compared with HTC Desire and Nexus One. Using this phone I’ve change my feelings while using other Android phones from: “Yeah… it’s good, it’s almost similar than iphone” to: “Omg, iphone is crap”.

Anway the most interesting part, and the main reason why I bought it, is to code something for it, so I’ve just found few books and I’ll try to make something funny with it!!.

Samsung galaxy S

Few days ago I was speaking with mrdoob about 3d engines and he showed me one of the projects he’s working on: three.js it’s a javascript framework to be able to use the browser canvas to paint 3D stuff :)

Its sounded funny: 3D… optimization… it’s looks “just” like other demoscene plataform.

So I’m trying to help to improve it and while getting use of the js syntax and so on, here you have a little test I’ve made (just click on it):

Geosphere render

Btw, the effect is based on the code of one of our Stravaganza productions: This way (64kb version also available here)