Basic Bingo App

There were two tutorials, so we have no idea which one you’re using. It would be really helpful if you copy/paste the entire error message from the Corona console log. It would also be helpful if you posted the code around where you’re getting the error and let us know what line number is causing the error in your code.

Rob

It was the first video of the tick tac toe game.  Just pulled it up again here is the log. 

07:33:12.953  

07:33:12.953  Corona Simulator 2018.3326 (Jun 25 2018 12:39:46)

07:33:12.953  

07:33:19.964  

07:33:19.964  Copyright © 2009-2018  C o r o n a   L a b s   I n c .

07:33:19.964  Version: 3.0.0

07:33:19.964  Build: 2018.3326

07:33:19.964  Platform: iPhone / x64 / 6.1 / Quadro FX 1700/PCIe/SSE2 / 3.3.0 / 2018.3326 / en_US | US | en_US | en

07:33:19.964  Loading project from:   C:\Users\BoiseTV\Documents\Corona Projects\tic tac toe

07:33:19.964  Project sandbox folder: C:\Users\BoiseTV\AppData\Local\Corona Labs\Corona Simulator\Sandbox\tic tac toe-46C25ED27892F80D745EBD09C07086B4\Documents

07:33:19.980  ERROR: Syntax error

07:33:19.980  C:\Users\BoiseTV\Documents\Corona Projects\tic tac toe\main.lua:14: unexpected symbol near ‘+’

Here is the code:


– main.lua


– Your code here I copied it exact from the tutorial.  Tried it with the correct spelling of Horizontal but still the same error.

local title= display.newText(“Tick-Tac-Toe”, display.contentCenterX, 25, native.systemFontBold, 20)

local leftVerticalLine = display.newRect( display.contentCenterX -50, display.contentCenterY, 5, 300)

local rightVerticalLine = display.newRect( display.contentCenterX +50, display.contentCenterY, 5, 300)

local topHorzontalLine = display.newRect( display.contentCenterX, display.contentCenterY, - 50, 300,5)

local bottomHorizontalLine = display.newRect( display.contentCenterX, display.contentCenterY, + 50, 300,5)

There shouldn’t be a comma after display.contentCenterY in the lines where it says -50 and +50.

Wow, sorry for that. I missed it. I appreciate your help.

Is there a way to set the reset button for this tutorial on always.  It resets only when someone wins or loses.  Can it show on always.  I can turn off the remove reset button but it still doesn’t show initially. Thanks

Looking at the code, you will see it only creates a widget.newButton() inside the gameOver function. Because the creator for the widget.newButton() is inside the gameOver function, that command is only executed when gameOver is called. 

If you want the button always on in the UI, simply move the button creator command outside of the gameOver function. Perhaps you should move it above the gameOver function but below the resetGame game function. 

Rob

Is this what you are talking about

<resetButton = widget.newButton({

        label = “Reset”,

        x = display.contentCenterX +120,

        y = display.contentHeight -320,

        font = native.systemFontBold,

        fontSize = 20,

        labelColor = { default = { 1,1,1}, over = { 1, 0, 0 } },

        onPress = resetGame

    })

>

I have tried to move it where you said and many other locations both above and below,  the game no longer functions.  I get an error message. 

Found a way to do it.  

Thanks

What error were you getting?

Can you share your code that’s not working? (Please use code formatting)

Thanks

Rob