Results 1 to 5 of 5
  1. #1
    DarkJedi is offline Member
    Join Date
    Jul 2013
    Posts
    6
    Rep Power
    0

    Default Can anyone help me with my menu code?

    I am trying to learn by scratch on how to script and the code in the book I am using "corona SDK" for mobile gaming is confusing me on an area in my code. It is the menu that I am having an issue with. Here is my code:

    function main() end
    function mainMenu()
    --[[function main() mainMenu]]--
    function main()
    mainMenu()
    end
    function mainMenu()
    end
    playBtn:addEventListener("tap",loadGame)
    menuScreenGroup=display.newGroup()
    mmScreen=display.newImage("mmScreen.png",0,0,true) mmScreen.x=_W mmScreen.y=_H
    playBtn=display.newImage("playbtn.png")
    playBtn:setReferencePoint(display.CenterReferenceP oint)
    playBtn.x=_W; playBtn.y=_H+50 playBtn.name="playbutton"
    menuScreenGroup:insert(mmScreen) menuScreenGroup:insert(playBtn)
    function loadGame(event) if event.target.name=="playbutton" then transition.to(menuScreenGroup,{time=0,alpha=0,onCo mplete=addGameScreen})
    playBtn:removeEventListener("tap",loadGame) end
    end

    Can someone please fix it and let me know where I went wrong on it. Thank you in advance!

  2. #2
    DarrylBurke's Avatar
    DarrylBurke is online now Forum Police
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,423
    Rep Power
    20

    Default Re: Can anyone help me with my menu code?

    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

  3. #3
    DarrylBurke's Avatar
    DarrylBurke is online now Forum Police
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,423
    Rep Power
    20

    Default Re: Can anyone help me with my menu code?

    That's not Java. What is it?

    db
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

  4. #4
    DarkJedi is offline Member
    Join Date
    Jul 2013
    Posts
    6
    Rep Power
    0

    Default Re: Can anyone help me with my menu code?

    Quote Originally Posted by DarrylBurke View Post
    That's not Java. What is it?

    db
    Lua is what I think it is called. I am learning from the book Corona SDK Mobile Game Development. I got the menu I think to work, but my last bit of code is not working.

    function loadGame(event)if event.target.name=="playbutton" then
    transition.to(menuScreenGroup,{time =0,alpha=0,onComplete=addGameScreen})
    playBtn:removeEventListener("tap",loadGame)
    end
    end

  5. #5
    DarrylBurke's Avatar
    DarrylBurke is online now Forum Police
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,423
    Rep Power
    20

    Default Re: Can anyone help me with my menu code?

    Moved from New to Java.

    Quote Originally Posted by DarkJedi View Post
    Lua is what I think it is called.
    Then I think you need to find a Lua forum. This isn't one.

    db
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

Similar Threads

  1. Java Script context menu into JAVA Context Menu...
    By cnu.nandhikonda@gmail.com in forum AWT / Swing
    Replies: 1
    Last Post: 08-22-2012, 09:14 AM
  2. Fill a menu dynamically when menu is shown
    By Java Tip in forum SWT Tips
    Replies: 0
    Last Post: 07-07-2008, 04:47 PM
  3. How to use SWT menu and menu event
    By Java Tip in forum SWT Tips
    Replies: 0
    Last Post: 07-07-2008, 04:46 PM
  4. React to menu action and checkbox menu
    By Java Tip in forum javax.swing
    Replies: 0
    Last Post: 06-27-2008, 07:50 PM
  5. Replies: 7
    Last Post: 05-09-2008, 07:54 AM

Posting Permissions

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