Looking to Pay for lessons/help if anyone is interested

Hey guys, here is my situation. I am using a quiz game template as a way of learning lua, and programing in general. I learn best by deconstructing examples of working things, then modifying and seeing what happens. 

I have been learning a ton on my own, but there are a few concepts and problems I have been getting stuck on. I am looking to pay a skilled person to look at my current code and help me solve one or two problems to help me grasp the concepts I am stuck on. If anyone is interested, please contact me and we can work out the details. My email address is shawn@spawndesignsolutions.com.

Thanks!

I’m happy to advise as long as it is not too time consuming… post your code

Basically I have played around with and changed things to learn how it all works. Below are the things I really want to learn next. I am sure there are very basic things that I don’t understand, but I am just trying to learn any way I can. 

  1. Use a shuffleBag to be able to randomly grab a set umber of questions, then end the game for that category(go to gameOver scene) . Ex: “bag” contains 50 questions — shuffleBag grabs first question, on answer, next question randomly selected from bag — repeats until set number is reached (7questions for example) —  then score is given.
  2. Have the gameOver screen present a button that goes to a URL, in place of the “share” button. 
  3. Learn how to set where the game.lua starts. I would like to have the start button go directly to a specific category and load the first question, not to the category select list. 

Here is a link to the code and a link to a zip of the entire game in it’s current state. 

https://drive.google.com/open?id=0B9cC_rWL1aPqMkNFLTlId1Rvdms

https://gist.github.com/salfenito/7c2fa85f1eb051e9805b50fcd12b2ec1

Firstly, I would implement your questions as JSON and not code.  This way you can change the questions independent of the app - via network.request() for example.

You will need to store what questions have been shown to the player to ensure you don’t repeat questions until the list of questions have been exhausted.  With enough questions you could just read them sequentially and that would appear to be random to the player.

If you want a button to display a URL then do something like this and call it on a tap event

local function showURL(URL) local webView = native.newWebView( centreX, centreY, width, height ) webView:request( URL ) end

I’ve done a quick code review and I would say your structure is very OOP and overly complicated.  You really only need a mainmenu.lua and a game.lua and the questions loaded into game.lua at runtime.

I appreciate you taking the time to look at it and reply. I think perhaps I am getting in over my head lol. I have no idea how to do anything with JSON. I would like to get the basics of LUA down before adding a whole other set of things in to the problem. I have been going back and doing the basic getting started tutorials from the corona SDK page so that I can build a better understanding of the structure, API’s and best practices. Thanks for your help!

JSON is just a way of storing and passing data between systems.  So in your case you would store all your questions in a JSON file; either locally or on the internet somewhere.  JSON is easy to use in Lua and can easily be turned into a table (much like your current structures.  Read some more on JSON hereand here.

Personally, I would play around with the sample Corona provides to try and understand the basics and then try your own small app.  I’ve just trying to steer you in the right direction to avoid a lot of wasted time…

I noticed you were making your code very complicated for something relatively trivial which is fine on small apps but gets progressively more complicated and time consuming as your projects grow in complexity.  

Remember this acronym KISS and always practise it.  Good luck

So i tried this, and I get an error anytime I fill in the URL. If I leave the URL empty, it does run with a text button “Register”, bur tapping it gives me the following error:

Error loading module ‘scenes.menu’ from file ‘/Users/salfenito/Desktop/Lua Lesson/StarExplorer/scenes/menu.lua’:

/Users/salfenito/Desktop/Lua Lesson/StarExplorer/scenes/menu.lua:17: ‘<name>’ expected near ‘/’

 

File: error loading module ‘scenes.menu’ from file ‘scenes/menu.lua’

Line 17 would be the webView:request

local composer = require( "composer" ) local scene = composer.newScene() -- ----------------------------------------------------------------------------------- -- Code outside of the scene event functions below will only be executed ONCE unless -- the scene is removed entirely (not recycled) via "composer.removeScene()" -- ----------------------------------------------------------------------------------- local function gotoGame(URL) composer.gotoScene( "game" ) end local function showURL() local webView = native.newWebView( display.contentCenterX, display.contentCenterY, 800, 1400 ) webView:request( http://spawndesignsolutions.com ) end -- ----------------------------------------------------------------------------------- -- Scene event functions -- ----------------------------------------------------------------------------------- -- create() function scene:create( event ) local sceneGroup = self.view -- Code here runs when the scene is first created but has not yet appeared on screen local background = display.newImageRect( sceneGroup, "background.png", 800, 1400 ) background.x = display.contentCenterX background.y = display.contentCenterY local title = display.newImageRect( sceneGroup, "title.png", 500, 80 ) title.x = display.contentCenterX title.y = 200 local playButton = display.newText( sceneGroup, "Play", display.contentCenterX, 700, native.systemFont, 44 ) playButton:setFillColor( 0.82, 0.86, 1 ) local regButton = display.newText( sceneGroup, "Register", display.contentCenterX, 810, native.systemFont, 44 ) regButton:setFillColor( 0.75, 0.78, 1 ) playButton:addEventListener( "tap", gotoGame ) regButton:addEventListener( "tap", showURL ) end
webView:request( http://spawndesignsolutions.com )

should be

webView:request( "http://spawndesignsolutions.com" )

Awesome. Can’t believe I couldn’t figure that out. Now how would you make it so you could close this web view window and go back to the app? 

Either have a close button in html (and then trap the click in the callback function) or put a Corona close image/button that will close the webview.

I’m happy to advise as long as it is not too time consuming… post your code

Basically I have played around with and changed things to learn how it all works. Below are the things I really want to learn next. I am sure there are very basic things that I don’t understand, but I am just trying to learn any way I can. 

  1. Use a shuffleBag to be able to randomly grab a set umber of questions, then end the game for that category(go to gameOver scene) . Ex: “bag” contains 50 questions — shuffleBag grabs first question, on answer, next question randomly selected from bag — repeats until set number is reached (7questions for example) —  then score is given.
  2. Have the gameOver screen present a button that goes to a URL, in place of the “share” button. 
  3. Learn how to set where the game.lua starts. I would like to have the start button go directly to a specific category and load the first question, not to the category select list. 

Here is a link to the code and a link to a zip of the entire game in it’s current state. 

https://drive.google.com/open?id=0B9cC_rWL1aPqMkNFLTlId1Rvdms

https://gist.github.com/salfenito/7c2fa85f1eb051e9805b50fcd12b2ec1

Firstly, I would implement your questions as JSON and not code.  This way you can change the questions independent of the app - via network.request() for example.

You will need to store what questions have been shown to the player to ensure you don’t repeat questions until the list of questions have been exhausted.  With enough questions you could just read them sequentially and that would appear to be random to the player.

If you want a button to display a URL then do something like this and call it on a tap event

local function showURL(URL) local webView = native.newWebView( centreX, centreY, width, height ) webView:request( URL ) end

I’ve done a quick code review and I would say your structure is very OOP and overly complicated.  You really only need a mainmenu.lua and a game.lua and the questions loaded into game.lua at runtime.

I appreciate you taking the time to look at it and reply. I think perhaps I am getting in over my head lol. I have no idea how to do anything with JSON. I would like to get the basics of LUA down before adding a whole other set of things in to the problem. I have been going back and doing the basic getting started tutorials from the corona SDK page so that I can build a better understanding of the structure, API’s and best practices. Thanks for your help!

JSON is just a way of storing and passing data between systems.  So in your case you would store all your questions in a JSON file; either locally or on the internet somewhere.  JSON is easy to use in Lua and can easily be turned into a table (much like your current structures.  Read some more on JSON hereand here.

Personally, I would play around with the sample Corona provides to try and understand the basics and then try your own small app.  I’ve just trying to steer you in the right direction to avoid a lot of wasted time…

I noticed you were making your code very complicated for something relatively trivial which is fine on small apps but gets progressively more complicated and time consuming as your projects grow in complexity.  

Remember this acronym KISS and always practise it.  Good luck

So i tried this, and I get an error anytime I fill in the URL. If I leave the URL empty, it does run with a text button “Register”, bur tapping it gives me the following error:

Error loading module ‘scenes.menu’ from file ‘/Users/salfenito/Desktop/Lua Lesson/StarExplorer/scenes/menu.lua’:

/Users/salfenito/Desktop/Lua Lesson/StarExplorer/scenes/menu.lua:17: ‘<name>’ expected near ‘/’

 

File: error loading module ‘scenes.menu’ from file ‘scenes/menu.lua’

Line 17 would be the webView:request

local composer = require( "composer" ) local scene = composer.newScene() -- ----------------------------------------------------------------------------------- -- Code outside of the scene event functions below will only be executed ONCE unless -- the scene is removed entirely (not recycled) via "composer.removeScene()" -- ----------------------------------------------------------------------------------- local function gotoGame(URL) composer.gotoScene( "game" ) end local function showURL() local webView = native.newWebView( display.contentCenterX, display.contentCenterY, 800, 1400 ) webView:request( http://spawndesignsolutions.com ) end -- ----------------------------------------------------------------------------------- -- Scene event functions -- ----------------------------------------------------------------------------------- -- create() function scene:create( event ) local sceneGroup = self.view -- Code here runs when the scene is first created but has not yet appeared on screen local background = display.newImageRect( sceneGroup, "background.png", 800, 1400 ) background.x = display.contentCenterX background.y = display.contentCenterY local title = display.newImageRect( sceneGroup, "title.png", 500, 80 ) title.x = display.contentCenterX title.y = 200 local playButton = display.newText( sceneGroup, "Play", display.contentCenterX, 700, native.systemFont, 44 ) playButton:setFillColor( 0.82, 0.86, 1 ) local regButton = display.newText( sceneGroup, "Register", display.contentCenterX, 810, native.systemFont, 44 ) regButton:setFillColor( 0.75, 0.78, 1 ) playButton:addEventListener( "tap", gotoGame ) regButton:addEventListener( "tap", showURL ) end
webView:request( http://spawndesignsolutions.com )

should be

webView:request( "http://spawndesignsolutions.com" )

Awesome. Can’t believe I couldn’t figure that out. Now how would you make it so you could close this web view window and go back to the app? 

Either have a close button in html (and then trap the click in the callback function) or put a Corona close image/button that will close the webview.