Corona SDK preload images and physics bodies

杀马特。学长 韩版系。学妹 提交于 2019-12-25 01:58:59

问题


I am creating a game that generates random landscapes that the character drives along. There are 7 "sections" right now, and there will probably be 25 or so total. For example, one section is a hill, one is a ramp, etc. I am loading these images and physics bodies (whch are made with Physics Editor) when the character passes halfway between the previous section. The previous section is also destroyed. There is a frame rate skip when this function is called because it is loading these images and physics bodies during the gameplay. How would I preload these images and physics bodies before the the user starts playing? Thanks!


回答1:


Use storyboard.loadScene:

-- load scene module and call its createsScene, but do not display it:
storyboard.loadScene( "nextScene1", false, {...})

...do stuff...

-- Later, transition to the (already loaded) scene
storyboard.gotoScene( "scene2", "slideLeft", 800 )


来源:https://stackoverflow.com/questions/22674505/corona-sdk-preload-images-and-physics-bodies

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!