I’ve been asked about “how to lock levels” many times, and have seen that question over and over on the forums. It’s a legit question, but hasn’t had a “simple to implement” answer until now.
It does have a simple answer which goes like this: You don’t lock the actual level — you keep a list around of your levels that show which are locked and which are unlocked. You just continually update that list. Simple to say, but more complex than that to implement. :)
I’ve created a code library called OGT Level Manager that makes it wicked easy to implement locking and unlocking levels in Corona SDK. It also handles earning stars per level and keeping track of scores per level (both of those are optional in case your game doesn’t use those elements).
OGT Level Manager is available now for just $29 and comes with a complete set of tutorial videos.