• startPt=x: CGFloat.random(min:0, max: frame.size.width), y: frame.size.height! • fallPt = x: startPt.x, y: 160.0! • enemy = SKSpriteNode(imageNamed: “mwd1”)! • position = startPt, name = “enemy”, setScale(0.2)! • load and run frame animation on enemy with name ”mwd” and 9 steps ! • create and run scale animation on enemy: SKAction.scaleTo(2.0, duration: 7.0)! • create and run move animation: SKAction.moveTo(fallPt, duration: 5.0) ~10 min
actions and run it on enemy! • replace move animation from prev. task with the new action sequence! • replace walking frame animation with running frame animation: ~8 min fallPt walkPt runPt (startPt.x, 160.0) (startPt.x, 120.0) (startPt.x, 40.0)
the passed parameter! • create explostion by calling timedEmitter(“spark”, emitTime: 0.1, totalTime: 2.0)! • set the exposition’s position to the enemy’s position! ! • back in spawEnemy(), add one more action to the action sequence:! ! ! ! • [⚛] Play with explosion.particleSpeed = [25 … 250] ~8 min
its position and size from bgNode! • set its color to: SKColor.redColor().colorWithAlphaComponent(0.5)! • add it to the scene ( via addChild )! • run this sequence on the node:! ! ! ! • call flash() from takeHit() ~6 min
pt param in shoot’s body! ! • override touchesEnded(touches:, event:)! • get one touch:! ! ! • finally call shoot() and pass the touch location point ~10 min
1 return; 2) set ammoCount-1; 3) update ammoLabel.text! • set rocket’s zRotation to (pt - rocket.position).angle set emissionAngle to (rocket.position - pt).angle! • run scale action to 0.75 scale on rocket for 1 second! • run the following actions sequence on rocket:! ! ! ! • moveTo pt over duration of 1 second runBlock 1) create explosion at the position of rocket 2) if ammoCount > 0 call showRocket() removeFromParent ~10 min
set its category! ! ! ! • in showRocket(), create a body for the rocket, and set its contact category! ! ! • in GameViewController.viewDidLoad() : ~8 min
• in didMoveToView() set the contact delegate: physicsWorld.contactDelegate = self! • create a new method: didBeginContact(contact: SKPhysicsContact)! • remove the hit enemy:! ! ! • set score to score + 1! • update scoreLabel with the new score ~10 min
is using dynamic dispatch:! ! ! • inside checkForCompletedLevel() check if health is less than 1! • if so set wavePaused to true, finished to “lost”, and return ~5 min