KS0108 graphic LCD game

This took me about 2 days of tinkering.

Basically, a pot connected to A5 controls the height of the rocket (player) and if theres a collision with a rock the player looses a life, simples...

At some point I'd like to add extra lives every 100 points, and a bonus object that adds 10 points if you pick it up.

http://www.youtube.com/watch?v=TMAJQY-tLas http://www.youtube.com/watch?v=TMAJQY-tLas

http://www.beigematchbox.co.uk/forums/arduino/rocket/rocket_1_0.pde http://www.beigematchbox.co.uk/forums/arduino/rocket/bitmaps.h



very cool, linear asteroids! are you planning to be able to shoot the rocks?

+5 :) It needs sound!

dang i was hoping for sumin like this on the GLCD lib XD i got a WG12864 lcd.

please tell me its an easy conversion :3

I've been thinking about something like this, except using an ATMega328 as a controller - with 2K of RAM, there is enough space to store an entire buffer. Add sprite handling commands and such, interface to it with I2C. Draw on the buffer with a separate microcontroller (Arduino or whatnot), then command it to send the buffer to the screen in one shot. It would be kinda like a poor-man's double-buffering system. Doing it this way could free up the Arduino for other things (input/sound effects/music); you could easily create an entire Arduino "gameboy" if you wanted to.

I wish I had the time to play with this, but I have other projects in the queue, unfortunately.

Great job showing this demo, though!

Very cool! But I have to ask:

Why does everyone always leave that protective film on their LCDs? It's starting to bug me ;D!

Why does everyone always leave that protective film on their LCDs?

At home, I left the protective film around the edges of my LCD monitors on my dual-headed workstation.

I do it to bug my wife (j/k, honey)!


Nice game for a simple device. I have the same display so I thought I would give it try. I am running it on a Mega.

In the routine drawRock, there is a reference to "bitmap" and it gives an error. It needs to be removed, i

The line is GLCD.DrawBitmap(rocks[tracker[entity][0]][bitmap],

It should read, (get rid of the "[bitmap]"


I also had to add the following at the top of the program

void getControls(); void drawFrame(); void drawLives(); void drawScore(); void drawRock(char entity); void gameOver(); void resetTracker(); void BLOWUP(); boolean collision(char entity); void explosionAnim(char xPos, char yPos);

Thanks Mark

( i forgot to have the ks0108 lib installed since my reinstall hence my previos problem >_> )

but now when compiling it says:

 In function 'void drawRock(char)':
error: 'bitmap' was not declared in this scope

(edit) dont mind me i am failing at reading today XD

beige, very impressive, would you mind if I included it as a demo with the download?

@bongmaster, MarkS posted the fix in the post above yours

thnx i really need to try these things wen im not about to go to bed XD mebe i would read more ;)

beige, here is a very simple noise generator you can add for the explosions

*  make noise for the given
*  duration in milliseconds
void noise(int duration)
  unsigned long start = millis();
  while( millis() - start < duration)
    int period = random(8,25); 
    digitalWrite(speakerPin, HIGH);
    digitalWrite(speakerPin, LOW);      

Define speakerPin to any unused digital pin and set this pin to output mode in setup.

In the explosionAnim function change the three calls:

beige, very impressive, would you mind if I included it as a demo with the download?

Sure thing :)

I'll have a look at making some noise with it at some point 8-)