small medium large xlarge

04 Jan 2014, 19:44
Dan Kosek (4 posts)

Hi Siliva,

Thanks for writing the book … Very helpful.

The source code for Planet defender appears to not included in the source download for the book. This is because it is under the “GameLoop/Gameloop” directory. Either state that our put it in a directory labeled “PlanetDefender”. This took me a while to find.

As such I was manually working my way thru building it and have a couple issues I am struggling to resolve to draw the background.

1st … you must create a new “scene” app as its no longer called a multiscreen app”.

Changing the scenetemplate to game and modifying the main.lua file works fine.

2nd … There is a fare amount of code stubbed out in the game.lua file and when adding display.newImage( ‘images/space_background.jpg’ ), you need to specify where it should be put.

3rd … The screen image is not stretched to fill the screen. How to do that should be added here.



08 Jan 2014, 01:41
Dan Kosek (4 posts)

It would be nice to get some sort of reply letting me know you’ve at least seen my post.

Alos, I forgot to mention I’m using the newest version (2013.2100).

Best Regards,


10 Jan 2014, 07:00
Frank Schmitt (1 post)

Hello Dan,

I couldn’t agree more. The book is indeed very helpful, but some stuff is simply missing. Some things that should be improved in the PlanetDefender section:

  • Please explain the coordinate system used by Corona (x/y, upper left corner = (0,0) ?)

  • “Background” group:insert causes an error message - commenting it seems a viable workaround

  • “Background” The background image is too small (at least when running under Mac OS X); to correctly scale it, replace local image = display.newImage( “images/space_background.jpg” ) with local image = display.newImageRect(“images/space_background.jpg”, display.contentWidth, display.contentHeight) image.x = display.contentWidth / 2 image.y = display.contentHeight / 2

  • “Configuring the frame rate” It should be mentioned where in build.settings the fps settings can be configured:

settings = {

orientation = {
    default = "portrait",
    supported = { "portrait", }
content = {
    -- START:fpsEdit
    -- Change our game's frame rate to 30 or 60 (30 in this case)
    fps = 30,
    -- END:fpsEdit
  • spriteanims.lua The declaration for spriteSequences seems to be missing: local spriteSequences = {}

Kind regards, Frank

22 Jan 2014, 00:19
Dan Kosek (4 posts)

Frank, thanks for the feedback.

BTW, you have to use single quotes in display.newImageRect(‘images/space_background.jpg’, not the display.newImageRect(“images/space_background.jpg”,

Otherwise you will get an error.