• Status Closed
  • Percent Complete
  • Task Type Patches
  • Category Games
  • Assigned To No-one
  • Operating System
  • Severity Low
  • Priority Very Low
  • Reported Version
  • Due in Version Undecided
  • Due Date Undecided
  • Votes
  • Private
Attached to Project: Rockbox
Opened by matholton - 2005-12-22
Last edited by matholton - 2006-01-05

FS#2864 - Asteroids! (astroRocks?)

First submission of my asteroids game loosely (not)
based on the classic 1979 Atari arcade game of the same
I havn’t made a diff file yet, as I still havn’t
figured it out, I just wanted to get something in
before christmas, as I won’t be able to work on it over
the festive period (boo hoo). I would like to know if
a: it’s fun b: it’s too easy or too difficult and c: and d:

Closed by  linusnielsen
2006-03-31 12:00
Reason for closing:  Accepted
Additional comments about closing:  

Code policed and committed. Thank you!

Anonymous Submitter commented on 2005-12-22 23:29

Looks great. I’ve modified for iRiver and tested on my
H100. Could you please add the #defines for the different
keymaps (as in solitaire, rockblox, …).
a: it is fun
b: it’s perfect
c: go on

I’ve tidied up the code a hell of a lot, and tweaked the
game settings slighltly to make it more difficult, slowed
down the repeat rate for the missiles.

I’ve only just read your response, thaks ‘nobody’. I will
have to sort the controls out for other players (iRiver
etc.) after christmas now, as I have to ‘do’ christmas with
the family :-)

merry christmas!

I’ve only just read your response, thaks ‘nobody’. I will
have to sort the controls out for other players (iRiver
etc.) after christmas now, as I have to ‘do’ christmas with
the family :-)

merry christmas!

One more update. Fixed a few bugs, made screen a bit
prettier and added a pause mode. Still no controls for any
other players other than Archos…

Oh damn, noticed a bug just after checking in. The enemy
spacehsip was appearing in the bottom left of the screen,
when the ship hadn’t moved.

right, definatly the final submission before my break
(maybe). Fixed some more bugs and made the ship look
prettier and hopefully easier to control.

Should compile and work on iRiver now! Yipee!!

at the request of Matze41, added repeat mode for thrusting.

Made the collision detection actually work. And probably some other stuff too.
There is still a couple of little problems in there though…

Fixed an annoying bug whereby the enemies missile would still be on the screen but not moving or visible after the enmey had been shot, so you were getting random asteroids blowing up and the ship if he moved into it…

Project Manager

Quick comments:

- Cooooool game!

- Please read the CONTRIBUTING text and try to comply with the coding style guidelines. You are using mixed case identifiers and C++ comments.

- Also, we would appreciate if you didn’t use Hungarian Type notation.

Dent commented on 2006-03-22 00:10

Nice conversion!

I noticed that it didn’t seem to build for my 5g Ipod. Examining the code revealed your key mapping for (all?) Ipods was incomplete. Here is a new key mapping which allows a complete build for my Ipod:


Everything seems to work. My C is rusty and this is my first experiment with compiling new rocks outside of the standard set…

Perhaps I could look at introducing stuff to get the scroll wheel working?


Great stuff, Yeah I really wanted to see it working with the scroll wheel on iPods - so yeah go ahead and do it!
I have some other fixes and changes to check in but my linux install is dead at the moment, so it will be a few days before I can get them in but I can will merge any changes you do.

Dent commented on 2006-03-22 21:59

Hell of a lot easier than I thought it would be…


I originally tried the above, but with out the BUTTON_REPEAT masking. Didn’t work too well :)

I might have a little bit of a play with the scale for large LCDs and perhaps have a look at increasing the framerate (for specific platforms). How easy would it be to introduce an ‘graphics-invert’ feature that made space black and asteroids white (or even green for authenticity) lines? My knowledge of the inner workings of the Rockbox graphics API are fairly crude at this stage.


Cool, can’t wait to try it out(my missis has an ipod nano!).
AS for LCD inversion, the rockbox on the archos has the function built in, so it should be a case of setting it when the plugin starts and resetting when it finishes. The one thing I really wanted to do before it gets into CVS is have a variable ‘wait between frames’ so that the framerate remains constant for all platforms and for any number of asteroids. Like, Time_to_wait = Max_wait - Time_taken_to_draw_frame. It’s slightly more complicated actually, more like wait_time = MAX(max_wait, Time_taken_to_draw-max_wait). I dunno, I forget, i’ve done it before but would have to fiddle a bit to remember.

It’s all good fun though.

One bit i’ve added (but not checked in here yet, so no need to do em) are drawing each asteroid 8 times, so that if one is half out of the screen, it appears on the other side of the screen as well (if that makes sense). It makes the game much more playable on the tiny Archos LCD.

My debian install’s nearly (re)done so I should be able to submit my updates soon…

Dent commented on 2006-03-23 00:07

Yeah I noticed that the asteroids disappear and reappear, rather than emerge from the playing field borders. Without getting into checking each point of the asteroid, I guess drawing them 8 times is a good way of doing it :)

I had a look over your code for a time_to_wait or FPS type feature with no success. Which begs the question, how are you slowing it down? Or is that simply due to Rockbox?

I have a feeling that LCD inversion doesn’t work for IPOD yet, so I am assuming that function is unavailable for us. Might be ok to stick it in though. How easy would it be to set up a config file for this sort of thing?

Im usually a Linux user, but as of late the only computer I have thats worth doing this stuff on, is here at work… therefore im behind a cygwin environment… sigh.

Looking forward to seeing your latest submit!

Final version…

Added Karls bits for iPod control (havn’t tested it though)
Ripped the fps code from brickmania, so it doesn’t slow down when there’s loads of asteroids.
Tidied up the code to conform with rockbox standards (I think)
and some other stuff…

Please add to CVS now :-)


Available keyboard shortcuts


Task Details

Task Editing