Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

A few ideas from Monkey Coder that might be nice in Codea

edited February 2012 in Suggestions Posts: 2,820

Hello,
I originally started my iOS game in Monkey Coder, when I discovered Codea and TLL's plan to allow Xcode export. So I started my game in Codea. It sped up my coding by about 2 - 3x, which is wonderful, but a few features were missing that might be nice... Here are a few of the functions called in Main():

onAppLoading()
onLoading() -- When draw() cant be called when the app is slow
onSuspend()

Monkey Coder also has these functions which might be nice too:

saveState() -- Usually put in onSuspend()
loadState()
setUpdateRate()
error() -- creates a virtual error
findInArray()
-- And obviousely, these file reading functions that are easier to use than file IO
AppArgs
AppPath
ChangeDir
CopyDir
CopyFile
CreateDir
CurrentDir
DeleteDir
DeleteFile
Execute
ExitApp
ExtractDir
FileSize
FileTime
FileType
GetEnv
LoadDir
LoadString
RealPath
SaveString
SetEnv
StripAll
StripDir
StripExt

Monkey Coder also has audio functions too (obviousely). Thy also have 3rd party modules that have sockets, GUI, email support, getting photo, camera etc. I hope TLL will consider these ideas.
Thanks!

Comments

  • Posts: 2,820

    I do find myself needing findInArray() very often.

  • SimeonSimeon Admin Mod
    Posts: 5,054

    For findInArray you can use something like this:

    function findInTable( t, value )
        for k,v in pairs( t ) do
            if v == value then
                return k
            end
        end
    
        return nil
    end
    

    This will return the key where the value was found (index, if the table is an array) or return nil if not found.

  • Posts: 2,820

    Oh... Thanks.

Sign In or Register to comment.