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!
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 )
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.