Home of the Squeezebox™ & Transporter® network music players.
Results 1 to 9 of 9

Hybrid View

  1. #1
    Junior Member
    Join Date
    Jul 2007
    Posts
    12

    Jive and the Space Invaders

    A friend of mine pointed me to this new mystery project.
    Looks very interesting. Can't wait to see on what platform this will actually run in the end.

    I started to play around with programming a new applet and this is what I came up with...

    A simple Space Invaders clone. Coded and tested on SVN r167.

    Some things I didn't figure out yet:

    - Is it possible to have multiple applets use a single top level menu entry? ie. Games > Space Invaders, Breakout, Tetris etc.
    - All the created Images and Surfaces are automatically Garbage Collected. Is it also possible to clean unused surfaces up from the Lua code?

    - There are some applets to control the SlimServer which for some reason weren't loaded correctly on my build haven't figure out why yet. Didn't see any errors in the console. (Could be current SVN r167 has this problem?)

    That's all for now. Back to try some other stuff. :-)
    Attached Files Attached Files

  2. #2
    Senior Software Engineer - Logitech/Slim Devices
    Join Date
    Apr 2005
    Location
    Ipswich, UK
    Posts
    1,394
    Quote Originally Posted by eibwen View Post
    A simple Space Invaders clone. Coded and tested on SVN r167.
    This is very cool :-D

    Quote Originally Posted by eibwen View Post
    - Is it possible to have multiple applets use a single top level menu entry? ie. Games > Space Invaders, Breakout, Tetris etc.
    Yes, I'll post an update version that adds a Game sub-menu, and a few other changes later.

    Quote Originally Posted by eibwen View Post
    - All the created Images and Surfaces are automatically Garbage Collected. Is it also possible to clean unused surfaces up from the Lua code?
    Sorry I don't understand what you are trying to do? For a games applet it would be better to preallocate all the objects to minimize garbage collection while it's running.

    Quote Originally Posted by eibwen View Post
    - There are some applets to control the SlimServer which for some reason weren't loaded correctly on my build haven't figure out why yet. Didn't see any errors in the console. (Could be current SVN r167 has this problem?)
    You need to be running slimserver 7.0 and have at least one Squeezebox/Softsqueeze connected, otherwise you won't see much.

    Quote Originally Posted by eibwen View Post
    That's all for now. Back to try some other stuff. :-)
    Great :-)

  3. #3
    Senior Software Engineer - Logitech/Slim Devices
    Join Date
    Apr 2005
    Location
    Ipswich, UK
    Posts
    1,394
    A screenshot for people how don't have Jive working yet.
    Attached Images Attached Images  

  4. #4
    Senior Software Engineer - Logitech/Slim Devices
    Join Date
    Apr 2005
    Location
    Ipswich, UK
    Posts
    1,394
    Attached is an updated Invaders, in three parts as the zip file was too big for the forum. The changes are:
    - Added a Games sub-menu.
    - Added support for scroll wheel and Go button.
    - Added sounds.
    - Fixed window transitions at the end of the game (you'll need svn r168).

    I am not sure these are the right sounds for this version of the game, but it demonstrates what's possible. I just found them after a quick web search here: http://www.planetalia.com/cursos/Jav...RS-27.tutorial. At the moment Jive only supports two channels for sounds, but this might be limiting for games. Do you think more channels should be supported by the platform?

    The game runs a little slow on the target platform, but it is still playable (my 8 year old son has been playing it this afternoon ). It also blocks on occasion. I have not checked why this is yet, but it may be related to the garbage collector. Preallocating the objects used would help here. It would be good if you could use the lua profiler (included in the jive application) to see what areas need optimization. If necessary we can add additional methods in C to the jive framework for specific functions that are slow, for example the collision detection.

    Keep up the good work!
    Attached Files Attached Files
    Last edited by rtitmuss; 2007-07-22 at 15:38. Reason: Zip file was too big.

  5. #5
    Junior Member
    Join Date
    Jul 2007
    Posts
    12
    Wow.
    Thanks for the feedback and improvements.

    I played around a bit more and Slim Server integration works now.

    I hopefully will have some time later today to look at some possible optimizations using luap.

    I am also working on a Breakout/Arkanoid clone but it isn't nearly as polished as Space Invaders.

  6. #6
    Senior Member
    Join Date
    Jun 2005
    Location
    Switzerland
    Posts
    610
    Very nice. Playing it brings back old memories

    Re. optimization, be aware class:method() is about 2x slower than procedure and 4x slower than _local_procedure(). Try to use local functions as much as you can, potentially using closures.

    Fred

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •