The scene isn't really "exported" as agk code, the scene file is agk code. If I were to create a scene called "MyWorld", AppGameKit Studio would create the file "MyWorld.scene" which is just a agk source file with the .scene extension that you would
#INSERT.
As AppGameKit can already load JSON straight into UDTs, we could have one general SceneManager.agc file to include. This would define the UDTs and setup functions.
global gAGKScenes as AGKScene[]
type AGKScene
name as string
sceneSprites as AGKSceneSprite[]
[other scene properties]
endtype
type AGKSceneSprite
name as string
spriteId as integer
[other sprite properties]
endtype
Then in our own code, we would access sprites and whatever as follows:
SceneId = LoadScene("MarsScene.json")
playerSpriteId = GetSceneSpriteIdByName(SceneId, "Player")
bossSpriteId = GetSceneSpriteIdByName(SceneId, "Boss")
enemyCount = GetSceneGroupSpriteCount(SceneId, "Enemies")
for i=0 to enemyCount
spriteId = GetSceneGroupSpriteId(sceneId, "Enemies", i)
next i