# How to add multiple extra spawn levels to go along with the level spawn sequence

**URL:** <https://forums.kodeco.com/t/how-to-add-multiple-extra-spawn-levels-to-go-along-with-the-level-spawn-sequence/18064>\
**Category:** iOS\
**Created:** [August 2, 2016, 5:52pm UTC](https://forums.kodeco.com/t/how-to-add-multiple-extra-spawn-levels-to-go-along-with-the-level-spawn-sequence/18064 "2016-08-02T17:52:35Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![zalubski](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/zalubski/32/81494_2.png) [@zalubski](https://forums.kodeco.com/u/zalubski)\
**Post date:** [August 2, 2016, 5:52pm UTC](https://forums.kodeco.com/t/how-to-add-multiple-extra-spawn-levels-to-go-along-with-the-level-spawn-sequence/18064/1 "2016-08-02T17:52:35Z")

</div>

This is my code once gamescore 3 is hit a special enemy is spawned but when I try to do the same if state like for 8 I get a error message. I can only add one bonus line for code how can I do multiple.

func startNewLevel(){  
levelNumber += 1

```
    if gameScore == 3 && bonus == false{
        bonus = true
        addbonus()
    
    }
    else{
    if self.actionForKey("spawningEnemies") != nil{
        self.removeActionForKey("spawningEnemies")}
    var levelDuration = NSTimeInterval()
    switch levelNumber{
    case 1: levelDuration = 1.5
    case 2: levelDuration = 1.4
    case 3: levelDuration = 1.4
    case 4: levelDuration = 1.3
    default:
        levelDuration = 0.5
        print("cannot find level info")}
    let spawn = SKAction.runBlock(spawnEnemy)
    let waitToSpawn = SKAction.waitForDuration(levelDuration)
    let spawnSequence = SKAction.sequence([waitToSpawn, spawn])
    let spawnForever = SKAction.repeatActionForever(spawnSequence)
        self.runAction(spawnForever)}}

```

if gameScore == 10 || gameScore == 3 || gameScore == 8 || gameScore == 44 || gameScore == 50 || gameScore == 100 {  
startNewLevel()}

---

<div class="post-metadata">

**Author:** ![marciokoko](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/marciokoko/32/32922_2.png) [@marciokoko](https://forums.kodeco.com/u/marciokoko)\
**Post date:** [August 4, 2016, 10:20pm UTC](https://forums.kodeco.com/t/how-to-add-multiple-extra-spawn-levels-to-go-along-with-the-level-spawn-sequence/18064/2 "2016-08-04T22:20:58Z")

</div>

You would have to use else if but really, the best thing to do would be to use switch case statements.
