Rockbox

Tasklist

FS#2864 - Asteroids! (astroRocks?)

Attached to Project: Rockbox
Opened by mat holton (matholton) - Thursday, 22 December 2005, 14:36 GMT
Last edited by mat holton (matholton) - Thursday, 05 January 2006, 00:12 GMT
Task Type Patches
Category Games
Status Closed
Assigned To No-one
Operating System
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

First submission of my asteroids game loosely (not)
based on the classic 1979 Atari arcade game of the same
name.
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:

This task depends upon

Closed by  Linus Nielsen Feltzing (linusnielsen)
Friday, 31 March 2006, 12:00 GMT
Reason for closing:  Accepted
Additional comments about closing:  Code policed and committed. Thank you!
Comment by Anonymous Submitter - Thursday, 22 December 2005, 23:29 GMT

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
Comment by mat holton (matholton) - Friday, 23 December 2005, 09:56 GMT

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.
Comment by mat holton (matholton) - Friday, 23 December 2005, 10:02 GMT

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!
Comment by mat holton (matholton) - Friday, 23 December 2005, 10:49 GMT

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!
Comment by mat holton (matholton) - Friday, 23 December 2005, 14:53 GMT

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...
Comment by mat holton (matholton) - Friday, 23 December 2005, 14:58 GMT

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.
Comment by mat holton (matholton) - Friday, 23 December 2005, 15:41 GMT

right, definatly the final submission before my break
(maybe). Fixed some more bugs and made the ship look
prettier and hopefully easier to control.
Comment by mat holton (matholton) - Wednesday, 04 January 2006, 23:47 GMT

Should compile and work on iRiver now! Yipee!!
Comment by mat holton (matholton) - Thursday, 05 January 2006, 00:11 GMT

at the request of Matze41, added repeat mode for thrusting.
Comment by mat holton (matholton) - Thursday, 23 February 2006, 16:49 GMT
Made the collision detection actually work. And probably some other stuff too.
There is still a couple of little problems in there though...
Comment by mat holton (matholton) - Thursday, 23 February 2006, 21:37 GMT
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...

Comment by Linus Nielsen Feltzing (linusnielsen) - Monday, 20 March 2006, 19:38 GMT
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.
Comment by Karl Lurman (Dent) - Wednesday, 22 March 2006, 00:10 GMT
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:

#elif (CONFIG_KEYPAD == IPOD_4G_PAD)
#define AST_PAUSE (BUTTON_SELECT | BUTTON_PLAY)
#define AST_QUIT (BUTTON_SELECT | BUTTON_MENU)
#define AST_THRUST BUTTON_MENU
#define AST_THRUST_REP (BUTTON_MENU | BUTTON_REPEAT)
#define AST_HYPERSPACE BUTTON_PLAY
#define AST_LEFT BUTTON_LEFT
#define AST_LEFT_REP (BUTTON_LEFT | BUTTON_REPEAT)
#define AST_RIGHT BUTTON_RIGHT
#define AST_RIGHT_REP (BUTTON_RIGHT | BUTTON_REPEAT)
#define AST_FIRE BUTTON_SELECT
#define AST_FIRE_REP (BUTTON_SELECT | BUTTON_REPEAT)

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?

Karl
Comment by mat holton (matholton) - Wednesday, 22 March 2006, 09:17 GMT
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.

Comment by Karl Lurman (Dent) - Wednesday, 22 March 2006, 21:59 GMT
Hell of a lot easier than I thought it would be...

#elif (CONFIG_KEYPAD == IPOD_4G_PAD)
#define AST_PAUSE (BUTTON_SELECT | BUTTON_PLAY)
#define AST_QUIT (BUTTON_SELECT | BUTTON_MENU)
#define AST_THRUST BUTTON_MENU
#define AST_THRUST_REP (BUTTON_MENU | BUTTON_REPEAT)
#define AST_HYPERSPACE BUTTON_PLAY
#define AST_LEFT BUTTON_SCROLL_BACK
#define AST_LEFT_REP (BUTTON_SCROLL_BACK | BUTTON_REPEAT)
#define AST_RIGHT BUTTON_SCROLL_FWD
#define AST_RIGHT_REP (BUTTON_SCROLL_FWD | BUTTON_REPEAT)
#define AST_FIRE BUTTON_SELECT
#define AST_FIRE_REP (BUTTON_SELECT | BUTTON_REPEAT)
#endif

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.

Karl
Comment by mat holton (matholton) - Wednesday, 22 March 2006, 22:23 GMT
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...
Comment by Karl Lurman (Dent) - Thursday, 23 March 2006, 00:07 GMT
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!
Comment by mat holton (matholton) - Thursday, 30 March 2006, 21:13 GMT
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 :-)

Loading...