Natural - A Platformer
@Stage\n\nwhen flag clicked\nforever\n    play sound [Night Valley v] until done\n    play sound [Night Valley - Part 2 v] until done\nend\n\n@Player\n\nwhen flag clicked\nLevelInit\nset [skips v] to [0]\nforever\n    if <(Move) = [0]> then\n        if <key (left arrow v) pressed?> then\n            Walk [-90] [-5]\n        else\n            if <key (right arrow v) pressed?> then\n                Walk [90] [5]\n            end\n        end\n    end\n    if <<key (up arrow v) pressed?> or <key (space v) pressed?>> then\n        if <<(Jump Key) = [0]> and <(Falling) < [3]>> then\n            set [speed y v] to [14]\n            set [falling v] to [6]\n            set [jump key v] to [1]\n        end\n    else\n        set [jump key v] to [0]\n    end\n    if <touching (obstacles v)?> then\n        broadcast (Death v)\n        LevelInit\n    end\nend\n\ndefine Walk (direction) (speed)\npoint in direction (direction)\nchange x by (speed)\nset [slope v] to [0]\nrepeat until <<(Slope) = [8]> or <not <touching (level v)?>>>\n    change y by (1)\n    change [slope v] by (1)\nend\nif <(Slope) = [8]> then\n    change x by ((0) - (speed))\n    change y by ((0) - (Slope))\nend\n\ndefine Touch Ground <up>\nchange [falling v] by (1)\nrepeat until <not <touching (floor v)?>>\n    if <up> then\n        change y by (-1)\n    else\n        change y by (1)\n        set [falling v] to [0]\n    end\n    set [speed y v] to [0]\nend\n\nwhen flag clicked\nshow\nforever\n    if <<(speed y) < [4]> or <key (up arrow v) pressed?>> then\n        change [speed y v] by (-1)\n    else\n        change [speed y v] by (-2)\n    end\n    change y by (speed y)\n    Touch Ground <(speed y) > [0]>\nend\n\nwhen flag clicked\nset rotation style [left-right v]\npoint in direction (90)\nforever\n    if <(speed y) > [0]> then\n        switch costume to (costume17 v)\n    else\n        if <[0] > (speed y)> then\n            switch costume to (costume18 v)\n        else\n            if <<key (right arrow v) pressed?> or <key (left arrow v) pressed?>> then\n                switch costume to (costume2 v)\n                repeat (14)\n                    if <<<key (right arrow v) pressed?> or <key (left arrow v) pressed?>> and <not <key (up arrow v) pressed?>>> then\n                        wait () seconds\n                        next costume\n                    else\n                        if <<key (up arrow v) pressed?> or <key (space v) pressed?>> then\n                            switch costume to (costume17 v)\n                        else\n                            switch costume to (costume1 v)\n                        end\n                    end\n                end\n            else\n                switch costume to (costume1 v)\n            end\n        end\n    end\nend\n\ndefine LevelInit\nswitch costume to (costume1 v)\ngo to [front v] layer\nset [move v] to [0]\nset [falling v] to [10]\nset [speed y v] to [0]\ngo to x: (-200) y: (-75)\nset rotation style [left-right v]\n\nwhen I receive [nextlevel v]\nLevelInit\n\nwhen [s v] key pressed\nif <not <(Skips) = [1]>> then\n    set [skips v] to [1]\n    broadcast (NextLevel v)\n    change [level v] by (1)\nend\n\nwhen [r v] key pressed\nLevelInit\n\nwhen flag clicked\nforever\n    if <touching (levelback v)?> then\n        change [level v] by (-1)\n        broadcast (NextLevel v)\n        wait (1) seconds\n    end\nend\n\nwhen flag clicked\nforever\n    if <(Level) < [1]> then\n        set [level v] to [1]\n    end\nend\n\ndefine LevelSet <if> (ask)\nif <if> then\n    ask (ask) and wait\n    set [level v] to (answer)\nend\n\nwhen [space v] key pressed\nLevelSet <(username) = [Falcon0327]> [Set Level To:]\n\n@Floor\n\nwhen I receive [nextlevel v]\n\nnext costume\n\nwhen flag clicked\n\nforever\n    play sound [Heartbeat Piano v] until done\nend\n\nset [level v] to [7]\n\nwhen flag clicked\nswitch costume to (costume2 v)\ngo to [front v] layer\nforever\n    switch costume to (Level)\nend\n\n@Background1\n\nwhen flag clicked\nLevelInit\nforever\n    if <key (left arrow v) pressed?> then\n        change x by (0.5)\n    else\n        if <key (right arrow v) pressed?> then\n            change x by (-0.5)\n        end\n    end\nend\n\nwhen I receive [nextlevel v]\nLevelInit\n\nwhen I receive [death v]\nLevelInit\n\ndefine LevelInit\ngo to x: (-12) y: (-50)\ngo to [back v] layer\n\n@Obstacles\n\nwhen flag clicked\nforever\n    switch costume to (Level)\nend\n\n@Finish\n\nwhen flag clicked\nset [level v] to [1]\nwait (0.001) seconds\nshow\ngo to [front v] layer\ngo [forward v] (10) layers\nforever\n    if <<touching (player v)?> and <not <(Level) = [8]>>> then\n        change [level v] by (1)\n        broadcast (NextLevel v)\n    end\n    if <(Level) = [8]> then\n        hide\n    end\nend\n\n@BouncyMushroom\n\nwhen flag clicked\nshow\ngo [backward v] (1) layers\ngo to x: (-107) y: (-124)\nforever\n    switch costume to (Level)\n    set [level v] to ([costume # v] of [floor v])\n    if <<touching (player v)?> and <not <key (up arrow v) pressed?>>> then\n        start sound [Drum Boing v]\n        set [speed y v] to [30]\n        repeat (5)\n            change y by (-1)\n        end\n        repeat (5)\n            change y by (1)\n        end\n    end\nend\n\n@Text\n\nwhen flag clicked\nshow\ngo to [front v] layer\nforever\n    switch costume to (Level)\nend\n\n@Cloud\n\nwhen I start as a clone\nset [ghost v] effect to (pick random (15) to (50))\nSpawnEdge (pick random (1) to (2)) <(EdgeSpawn) = [1]> [-240] [240] (pick random (0) to (180)) (pick random (-90) to (90))\nGlide\n\ndefine Glide\nif <(x position) > [0]> then\n    repeat until <[-240] > (x position)>\n        change x by (-0.7)\n    end\n    delete this clone\nelse\n    repeat until <(x position) > [240]>\n        change x by (0.7)\n    end\n    delete this clone\nend\n\ndefine SpawnEdge (xedge) <x =__> (xpos1) (xpos2) (ypos) (direction)\nhide\nset [edgespawn v] to (xedge)\nset rotation style [left-right v]\ngo to x: (0) y: (0)\npoint in direction (direction)\nset y to (ypos)\nif <x =__> then\n    set x to (xpos1)\nelse\n    set x to (xpos2)\nend\nshow\n\nwhen flag clicked\ngo to [back v] layer\ngo [backward v] (10) layers\nhide\nset rotation style [left-right v]\nforever\n    wait (pick random (5.01) to (12.01)) seconds\n    create clone of (_myself_ v)\nend\n\n@Bird\n\nwhen I start as a clone\ngo to [front v] layer\ngo [backward v] (1100) layers\nforever\n    repeat (3)\n        change y by (0.5)\n    end\n    repeat (3)\n        change y by (1)\n    end\n    repeat (3)\n        change y by (1.5)\n    end\n    repeat (3)\n        change y by (1)\n    end\n    repeat (3)\n        change y by (0.5)\n    end\n    repeat (3)\n        change y by (-0.5)\n    end\n    repeat (3)\n        change y by (-1)\n    end\n    repeat (3)\n        change y by (-1.5)\n    end\n    repeat (3)\n        change y by (-1)\n    end\n    repeat (3)\n        change y by (-0.5)\n    end\nend\n\nwhen I start as a clone\nforever\n    wait (0.01) seconds\n    next costume\nend\n\ndefine SpawnEdge (xedge) <x =__> (xpos1) (xpos2) (ypos) (direction)\nhide\nset [edgespawn2 v] to (xedge)\nset rotation style [left-right v]\ngo to x: (0) y: (0)\npoint in direction (direction)\nset y to (ypos)\nif <x =__> then\n    set x to (xpos1)\nelse\n    set x to (xpos2)\nend\nshow\n\nwhen flag clicked\nhide\nset rotation style [left-right v]\nforever\n    wait (pick random (3.01) to (7.01)) seconds\n    create clone of (_myself_ v)\nend\n\ndefine Glide\nif <(x position) > [0]> then\n    repeat until <[-240] > (x position)>\n        change x by (-4)\n    end\n    delete this clone\nelse\n    repeat until <(x position) > [240]>\n        change x by (4)\n    end\n    delete this clone\nend\n\nwhen I start as a clone\nset [ghost v] effect to (25)\nSpawnEdge (pick random (1) to (2)) <(EdgeSpawn2) = [1]> [-240] [240] (pick random (0) to (180)) (pick random (-90) to (90))\nGlide\n\n@LevelBack\n\n@Thumbnail\n\ndefine VariableHide\nhide variable [edgespawn v]\nhide variable [edgespawn2 v]\nhide variable [falling v]\nhide variable [jump key v]\nhide variable [level v]\nhide variable [move v]\nhide variable [skips v]\nhide variable [slope v]\nhide variable [speed y v]\n\nwhen flag clicked\nhide\nforever\n    reset timer\nend\n\nwhen [timer v] > (0.1)\nVariableHide\ngo to [front v] layer\nshow\nstop [all v]\n\n
               ->INSTRUCTIONS<-\n\nI know this is short but I will add more levels. \n\nDouble click the flag. Arrow keys to move, get to the stump, don't touch the rocks, mushrooms are bouncy... \n\nS to skip (Only once though), and R to restart the level\n