Hi again ok I'm having a problem with global variable. I know people say stay away from it yeah I know but is there a way to control a global variable. Like unlocking levels using global var how do I control global var doing level unlock
Label: corona android iphone ipad building error inmobi problem display screen View image tableView failed object physics touch button game lua config event listener |
_G Variable problem
why do you want to use globals to unlock levels? just save and load table
global vars will be useful just inside app, next run they will reset, no point in them
Can you show me how to check that someone beat that and then save it. All the levels are never locked there always unlocked.
I use ICE to achieve the same. Very easy ...
Its explained here http://developer.anscamobile.com/code/ice
can @mygamingproject you show me an example of using ice for checking that a level is won or anybody volunteer I get lots of help but somehow especially for how to save and I hope the last people that helped me don't get offended your help is awesome especially peach. I'm just asking other people If they have other alternatives way to do it.
In your game design what determines that a level should be unlocked?
An example of how it could work
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | require( "ice" ) -- initialise your best score scores = ice:loadBox( "scores" ) scores:storeIfNew( "best", 0 ) scores:save() -- initialise your score to be used in game myscore = scores:retrieve( "best" ) -- Then do a simple conditional to see if the score is big enough to make level available if(myscore > 1000) then -- make level 1 available end if(myscore > 5000) then -- make level 2 available end -- Presumably you would have some local score being incremented myscore = <do something here in your game to update score> -- Later in your game update your score back to ice so its remembered on next load scores:storeIfHigher("best", myscore) scores:save() |
send message and call to a person
Forum: Report Spam + PM
[INSTALL_PARSE_FAILED_NO_CERTIFICATES]
[SOLVED] Director ERROR: Failed to execute new( params ) function on 'screen1'
Too many (200) local variables
Corona SVG Level Builder released. Drag and drop physics level editor with Inkscape and SVG.
Small bug in Collectible Items example
Pivot Joints and apparent elasticity
Can't make removeSelf() delayed
tableview list superimposed on the old one
Endless runner game...
Rush_Breaker game for iOS released!
A valid provisioning profile for this executable was not found. Can't add built app to iPhone
Cannot find docs for Universal apps!
numerous complaints that my app is freezing
Extensions fail to install
Need a good name for my game
Question about porting