Results 1 to 2 of 2

Thread: whats wrong with this code?

                  
   
  1. #1
    Wii User shiftybill's Avatar
    Join Date
    Nov 2005
    Location
    The dark side of the moon
    Posts
    221
    Rep Power
    68

    Default whats wrong with this code?

    hiya all im new to this Lua thing and cant get my 1st program running

    help me or i may give up
    pls
    System.usbDiskModeActivate()
    GameHeart = true
    screenWidth = 480
    screenHeight = 272
    Blue = Color.new(0,0,255)
    Background = Image.load("Background.png")
    function Game()
    screen:blit(0,0, Background, false)
    screenrint(screenWidth/2, screenHeight - 20, "Bouncing Demo!!!", Blue)
    end
    while GameHeart do
    screen:flip()
    if Controls.read():start() then
    break
    end
    end

  2. #2

    Default

    If you defined a function you have to call it to run it.
    You don't have any Game() in your script.
    It is also good to call the screen:waitVblankStart() before the screen:flip()
    Also or you call the screen:blit function with 3 parameters (0,0, Background) or with all of them (0, 0, Background, Background:width(), Background:height(), false).

    Instead of the break in the
    if Controls.read():start() then
    break
    end
    It would be nicer to set the GameHeart to false.

    I'm also not a Lua master so....

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Bookmarks

Posting Permissions

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