I am trying to do a transition between game menu and the first level.
But instead of all Level1 (it is built by using an Level1.sks file(here I have designed a level) and Level1.swift(here I have created my "hero" etc.)) on the screen appears just hero, but no locations that was designed in Level1.sks.
How I can resolve this problem?
override func touchesEnded(touches: NSSet, withEvent event: UIEvent) {
for touch: AnyObject in touches {
let location = touch.locationInNode(self)
if (playbutton .containsPoint(location)){
runAction(SKAction.playSoundFileNamed("play.wav", waitForCompletion: false))
let transition = SKTransition.revealWithDirection(SKTransitionDirection.Down, duration: 1)
let scene = Level1(size: CGSizeMake(1024, 768))
scene.scaleMode = SKSceneScaleMode.AspectFill
self.scene?.view?.presentScene(scene, transition: transition)
transition.pausesOutgoingScene = true
}
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…