Flappy Wormy

For the BackSpace workshop, I’ve created another worksheet which is slightly easier (I think) than the Gem Gem worksheet. It simply reuses the Wormy game, to produce a Flappy Bird style game in python.

Here is a link to the worksheet.

Advertisements

Gem Gem Saga

I’m giving a workshop at the Royal Leamington Spa Backspace event on Sunday 26th October. So that the attendees have something to try out I’ve created a worksheet which will turn Al Sweigart’s Gem Gem game into the much more exciting Gem Gem Saga !

Here is a link to that worksheet if you’d like to give it a go.

Drop me a comment if you find any mistakes with the worksheet and I’ll correct them.

Raspberry Pi and me

image

 

Received my Raspberry Pi on Friday; thanks Myra.  Tried Fedora on it (too many bugs) and then Debian (but I had the Feb version, Doh!).  The February version didn’t have all the software I needed so this morning I’m getting just released April version.  Wooo..

 

 

SantaNav uploaded.

Just uploaded my first Android app. My neighbour’s daughter couldn’t put it down.

 

https://market.android.com/details?id=com.everytale.santanav

 

 

Designed by me, suggested features by my sons.  Free artwork and music from the web and programming in Java by me.

Computing in the UK – it is more exciting than ever

After reading Eric Schmidt’s criticism of computing education in the UK, there is now a wave of enthusiasm to remind people that the UK is a exciting place to learn how the technology of our present really works.

Here are a few links which you need to read if you too are interesting in UK Computer (video games and robots!)

Google’s Eric Schmidt criticises education in the UK

I haven’t posted for a while.  I’ve been busy on a new project but I thought this article too important to avoid posting.

http://www.bbc.co.uk/news/uk-14683133

 Schmidt said the country that invented the computer was “throwing away your great computer heritage” by failing to teach programming in schools. “I was flabbergasted to learn that today computer science isn’t even taught as standard in UK schools,” he said. “Your IT curriculum focuses on teaching how to use software, but gives no insight into how it’s made.”

Here is the full lecture:

http://live.mgeitf.co.uk/eventVideos/1130968839001

His comments about education are about 43 minutes into it.

How to set a transparent GLSurfaceView

If you want to set a GLSurfaceView to be transparent, the solution is quite simple but takes quite a bit of trial and error
to get there. Here is my trial and error to save you doing it too.

In the android documentation it states that it is possible to make a GLSurfaceView transparent by a call to

getHolder().setFormat(PixelFormat.TRANSLUCENT);

This might have been true once but on my device (HTC Desire, with API 8) this can cause the rendering to just look corrupted. It basically appears to be two badly coloured images of what I’m drawing.

Most of the material I found on the web states that you need to use setEGLConfigChooser to select the correct surface format that includes transparency. I guess calling setFormat(PixelFormat.TRANSLUCENT) isn’t doing anything to the OpenGL surface.

Common consent appears to say that the desired format is as follows:default
glSurfaceView.setEGLConfigChooser(8, 8, 8, 8, 16, 0);

This gives 32 bits, 8 bits per channel including alpha although the default is 16 bits without alpha (RGB656)

However just calling this will cause my phone to crash. This is because the format is now out of sync with whatever getHolder().setFormat(PixelFormat.TRANSLUCENT) gave us. So instead I needed to call

glSurfaceView.getHolder().setFormat(PixelFormat.RGBA_8888);

Finally, the last and least documented requirement is to call

glSurfaceView.setZOrderOnTop(true);

You can easily check this works for you by modifying the SurfaceViewOverlay example in the APIDemos that are supplied with the SDK.

Before it calls

glSurfaceView.setRenderer(new CubeRenderer(false));

Add the lines

 glSurfaceView.setZOrderOnTop(true);
 glSurfaceView.setEGLConfigChooser(8, 8, 8, 8, 16, 0);
 glSurfaceView.getHolder().setFormat(PixelFormat.RGBA_8888);

So, the cubes will appear on top of the hideme buttons when you make them visible.

I hope this helps anyone struggling with a transparent GLSurfaceView.

%d bloggers like this: