beige
February 1, 2010, 11:39pm
1
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.beigematchbox.co.uk/forums/arduino/rocket/rocket_1_0.pde
http://www.beigematchbox.co.uk/forums/arduino/rocket/bitmaps.h
http://www.beigematchbox.co.uk/forums/arduino/rocket/rocket_1_0.zip
system
February 2, 2010, 4:54pm
3
very cool, linear asteroids! are you planning to be able to shoot the rocks?
system
February 2, 2010, 8:32pm
5
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
system
February 2, 2010, 10:25pm
6
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!
system
February 3, 2010, 4:14am
7
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!
system
February 3, 2010, 10:23pm
8
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)!
;D
system
February 7, 2010, 9:02pm
9
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]"
GLCD.DrawBitmap(rocks[tracker[entity][0]],
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
system
February 8, 2010, 2:11am
10
( 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
mem
February 8, 2010, 6:18am
11
beige, very impressive, would you mind if I included it as a demo with the download?
mem
February 8, 2010, 6:19am
12
@bongmaster , MarkS posted the fix in the post above yours
system
February 8, 2010, 6:49am
13
thnx i really need to try these things wen im not about to go to bed XD mebe i would read more
mem
February 8, 2010, 12:08pm
14
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);
delay(period);
digitalWrite(speakerPin, LOW);
delay(period);
}
}
Define speakerPin to any unused digital pin and set this pin to output mode in setup.
In the explosionAnim function change the three calls:
delay(175);
to
noise(175);
beige
February 8, 2010, 3:39pm
15
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