Pine Mountains | A Platformer

Instructions: -Pine Mountains-\nMobile Friendly!\n\n- Complete with 22 Levels!\n- Music!\n- A Heart-moving story!\n- Arrow Keys or Mobile Friendly Controls\n- Avoid Sharp Rocks\n- Don't touch Hot Water\n- Enjoy the nature!\n\nStory\nYou are on your way back to your Grandparents' House where on the way you have to Scale Cliffs, Cross Rivers, Avoid Grizzlies and Get Home!\n\nTYSM FOR 100 favs! :D

@Stage\n\nwhen flag clicked\nbroadcast (Run Platformer v)\n\n@Player\n\nwhen I receive [run platformer v]\nforever\n    if <<[240] < (x position)> and <(dead?) = [0]>> then\n        broadcast (NAXT LEVEL v)\n        change [level v] by (1)\n        Reset - Setup\n    end\nend\n\nwhen flag clicked\nhide variable [xv v]\nhide variable [dead? v]\nhide variable [level v]\nhide variable [yv v]\nhide\n\nwhen I receive [run platformer v]\nset [level v] to [1]\nforever\n    create clone of (_myself_ v)\nend\n\ndefine Reset - Setup\nset [dead? v] to [0]\nset [xv v] to [0]\nset [yv v] to [0]\npoint in direction (90)\ngo to x: (-201) y: (30)\nclear graphic effects\nswitch costume to (1 v)\nset size to (80) %\nshow\n\ndefine Death\nset [dead? v] to [1]\nrepeat (25)\n    turn right (5) degrees\n    change [ghost v] effect by (4)\n    change size by (-4)\nend\nReset - Setup\n\nwhen I start as a clone\nswitch costume to (clone v)\nrepeat (10)\n    change [ghost v] effect by (10)\n    change size by (-1.5)\nend\ndelete this clone\n\nwhen I receive [start project v]\nset [dead? v] to [0]\nset [level v] to [1]\nset size to (80) %\nReset - Setup\nforever\n    go to [front v] layer\n    if <<<<key (right arrow v) pressed?> or <key (d v) pressed?>> or <<mouse down?> and <(mouse x) > (x position)>>> and <(dead?) = [0]>> then\n        switch costume to (1 v)\n        change [xv v] by (1)\n    end\n    if <<<<key (left arrow v) pressed?> or <key (a v) pressed?>> or <<mouse down?> and <(mouse x) < (x position)>>> and <(dead?) = [0]>> then\n        switch costume to (2 v)\n        change [xv v] by (-1)\n    end\n    set [xv v] to ((Xv) * (.9))\n    change x by (Xv)\n    if <touching (ground v)?> then\n        change y by (2)\n        if <touching (ground v)?> then\n            change y by (2)\n        end\n        if <touching (ground v)?> then\n            change y by (2)\n            if <touching (ground v)?> then\n                change y by (2)\n                if <touching (ground v)?> then\n                    change y by (2)\n                    if <touching (ground v)?> then\n                        change x by ((Xv) * (-2))\n                        change y by (-5)\n                        if <<key (up arrow v) pressed?> or <<key (w v) pressed?> or <<mouse down?> and <(mouse y) > ((y position) + (10))>>>> then\n                            if <(Xv) > [0]> then\n                                set [xv v] to [-5]\n                            else\n                                set [xv v] to [5]\n                            end\n                            set [yv v] to [13]\n                        else\n                            set [xv v] to [0]\n                        end\n                    end\n                end\n            end\n        end\n    end\n    change [yv v] by (-0.8)\n    change y by (Yv)\n    if <touching (ground v)?> then\n        change y by ((Yv) * (-1))\n        set [yv v] to [0]\n    end\n    change y by (-1)\n    if <touching (ground v)?> then\n        if <<key (up arrow v) pressed?> or <<key (w v) pressed?> or <<mouse down?> and <(mouse y) > ((y position) + (10))>>>> then\n            set [yv v] to [12]\n        end\n    end\n    change y by (1)\n    if <<<touching (spikes v)?> or <touching (lava v)?>> or <touching (bears v)?>> then\n        Death\n    end\n    if <(y position) < [-180]> then\n        Death\n    end\n    if <touching (bouncy v)?> then\n        set [yv v] to [15]\n    end\nend\n\n@ground\n\nwhen I receive [start project v]\nshow\nforever\n    switch costume to (Level)\nend\n\nwhen flag clicked\nhide\n\nwhen I receive [start project v]\nforever\n    play sound [Young Fire v] until done\nend\n\n@Lava\n\nwhen flag clicked\nhide\n\nwhen I receive [start project v]\nshow\ngo to [front v] layer\nforever\n    switch costume to (Level)\nend\n\nwhen I receive [start project v]\nforever\n    set y to (([cos v] of ((timer) * (150)) ) * (7))\nend\n\n@Spikes\n\nwhen flag clicked\nhide\n\nwhen I receive [start project v]\nshow\nforever\n    switch costume to (Level)\nend\n\n@Letter\n\nwhen flag clicked\nhide\n\nwhen I receive [start project v]\nshow\nforever\n    switch costume to (Level)\nend\n\n@Thumbnail\n\nwhen flag clicked\nforever\n    set [ghost v] effect to (100)\n    go to x: (0) y: (0)\n    go to [front v] layer\n    show\n    go to [front v] layer\nend\n\ngo to [front v] layer\n\n@Intro\n\ndefine Clone Particles\nset [clone id v] to [Particle]\nrepeat (75)\n    create clone of (_myself_ v)\n    turn right (15) degrees\nend\npoint in direction (90)\n\ndefine Clone Row of Boxes\nset [brightness v] effect to (10)\nrepeat (9)\n    create clone of (_myself_ v)\n    change [var 2 v] by (-1)\n    change [brightness v] effect by (-1)\nend\n\ndefine Bounce with (bounciness) , (speed) and (finishing size)\nset [var 1 v] to [0]\nrepeat until <<(finishing size) = (size)> and <(Var 1) = (size)>>\n    set [var 2 v] to (((Var 2) * ((bounciness) / (100))) + (((finishing size) - (size)) * ((speed) / (20))))\n    set [var 1 v] to (size)\n    change size by (Var 2)\nend\nset size to (finishing size) %\n\ndefine Smooth Glide x: (x) y: (y) speed: (speed)\nrepeat until <<(round (x position)) = (round (x))> and <(round (y position)) = (round (y))>>\n    change x by (((round (x)) - (round (x position))) / (speed))\n    change y by (((round (y)) - (round (y position))) / (speed))\nend\ngo to x: (x) y: (y)\n\ndefine Type: System (text) (x) (y) (size) (color) (brightness) (speed)\nswitch costume to (master v)\nhide\ngo to x: (x) y: (y)\nset size to (size) %\nset [# v] to [1]\nset [color v] effect to (color)\nset [brightness v] effect to (brightness)\nrepeat (length of (text))\n    if <(letter (#) of (text)) > [ ]> then\n        switch costume to (letter (#) of (text))\n        create clone of (_myself_ v)\n        change x by ((size) * ((item (costume [number v]) of [character widths v]) / (90)))\n        change [# v] by (1)\n    else\n        switch costume to ( v)\n        create clone of (_myself_ v)\n        change x by ((size) * ((item (costume [number v]) of [character widths v]) / (90)))\n        change [# v] by (1)\n    end\n    wait (speed) seconds\nend\n\nwhen I start as a clone\nif <(Clone ID) = [Letter 1]> then\n    wait until <(timer) > [1.5]>\n    wait ((#) / (Length)) seconds\n    show\n    set [x v] to (x position)\n    set [y v] to (y position)\n    go to [front v] layer\n    set size to (0) %\n    go to x: (X) y: (Y)\n    Bounce with (65) , (10) and (Size)\n    wait until <(timer) > [3.5]>\n    wait ((#) / (Length)) seconds\n    set [var 1 v] to [10]\n    repeat (30)\n        change y by (Var 1)\n        change [var 1 v] by (-1)\n        change [ghost v] effect by (5)\n    end\n    delete this clone\nend\nif <(Clone ID) = [Box]> then\n    point in direction (180)\n    switch costume to (box v)\n    set [ghost v] effect to (50)\n    set size to (15) %\n    show\n    go to [back v] layer\n    go to x: ((Var 1) * (40)) y: ((Var 2) * (40))\n    repeat until <(size) > [89]>\n        change size by (((91) - (size)) / (7))\n        turn right (((180) - (direction)) / (10)) degrees\n        change [ghost v] effect by (-5)\n    end\n    set size to (90) %\n    set [ghost v] effect to (0)\n    wait until <(timer) > [4.5]>\n    set [brightness v] effect to (0)\n    repeat (20)\n        turn right (5) degrees\n        change size by (-5)\n        change [ghost v] effect by (5)\n    end\n    delete this clone\nend\n\nwhen flag clicked\nset [username v] to [LS981]\nSetup Lists\nset [clone id v] to [Letter 1]\nType (Username) [-200] [-100] [200] [115] [100] [0]\nset [clone id v] to [Letter 2]\nType (Username) [-200] [0] [200] [115] [100] [0]\nclear graphic effects\nreset timer\nstart sound [ v]\nset [clone id v] to [Back 2]\ncreate clone of (_myself_ v)\nset [clone id v] to [Box]\nset [var 1 v] to [-6]\nrepeat (13)\n    set [var 2 v] to [4]\n    Clone Row of Boxes\n    change [var 1 v] by (1)\nend\nset [clone id v] to [Logo]\ncreate clone of (_myself_ v)\nwait until <(timer) > [1.5]>\nset [clone id v] to [Back]\ncreate clone of (_myself_ v)\nwait until <(timer) > [5]>\nset [clone id v] to [Hider 1]\ncreate clone of (_myself_ v)\nset [clone id v] to [Hider 2]\ncreate clone of (_myself_ v)\nwait until <(timer) > [8]>\nbroadcast (Start Project v)\n\ndefine Setup Lists\ndelete all of [character widths v]\nadd [thing] to [character widths v]\nadd [29] to [character widths v]\nadd [24] to [character widths v]\nadd [28] to [character widths v]\nadd [27] to [character widths v]\nadd [24] to [character widths v]\nadd [24] to [character widths v]\nadd [28] to [character widths v]\nadd [28] to [character widths v]\nadd [7] to [character widths v]\nadd [21] to [character widths v]\nadd [22] to [character widths v]\nadd [22] to [character widths v]\nadd [34] to [character widths v]\nadd [27] to [character widths v]\nadd [34] to [character widths v]\nadd [22] to [character widths v]\nadd [34] to [character widths v]\nadd [21] to [character widths v]\nadd [23] to [character widths v]\nadd [27] to [character widths v]\nadd [27] to [character widths v]\nadd [29] to [character widths v]\nadd [38] to [character widths v]\nadd [26] to [character widths v]\nadd [27] to [character widths v]\nadd [27] to [character widths v]\nadd [11] to [character widths v]\nadd [20] to [character widths v]\nadd [21] to [character widths v]\nadd [25] to [character widths v]\nadd [21] to [character widths v]\nadd [20] to [character widths v]\nadd [21] to [character widths v]\nadd [20] to [character widths v]\nadd [20] to [character widths v]\nadd [20] to [character widths v]\nadd [14] to [character widths v]\nadd [25] to [character widths v]\nadd [15] to [character widths v]\nadd [10] to [character widths v]\nadd [24] to [character widths v]\nadd [24] to [character widths v]\nadd [20] to [character widths v]\nadd [24] to [character widths v]\nadd [22] to [character widths v]\nadd [16] to [character widths v]\nadd [24] to [character widths v]\nadd [22] to [character widths v]\nadd [10] to [character widths v]\nadd [14] to [character widths v]\nadd [18] to [character widths v]\nadd [9] to [character widths v]\nadd [33] to [character widths v]\nadd [22] to [character widths v]\nadd [24] to [character widths v]\nadd [24] to [character widths v]\nadd [24] to [character widths v]\nadd [15] to [character widths v]\nadd [19] to [character widths v]\nadd [16] to [character widths v]\nadd [22] to [character widths v]\nadd [22] to [character widths v]\nadd [30] to [character widths v]\nadd [20] to [character widths v]\nadd [23] to [character widths v]\nadd [20] to [character widths v]\n\ndefine Change Size By: (size)\nchange size by (size)\nchange x by ((0) - ((size) / (7)))\n\ndefine Find Size (text) (size)\nset [size v] to (size)\nset [width v] to [1]\nset [# v] to [1]\nrepeat (length of (text))\n    if <(letter (#) of (text)) > [ ]> then\n        switch costume to (letter (#) of (text))\n        change [width v] by ((Size) * ((item (costume [number v]) of [character widths v]) / (90)))\n        change [# v] by (1)\n    else\n        switch costume to ( v)\n        change [width v] by ((Size) * ((item (costume [number v]) of [character widths v]) / (90)))\n        change [# v] by (1)\n    end\nend\nif <(Width) > [400]> then\n    change [size v] by (-1)\nend\nif <(Width) < [390]> then\n    change [size v] by (1)\nend\nrepeat until <<<(Width) < [400]> and <(Width) > [389]>> or <(Size) > [200]>>\n    set [width v] to [0]\n    set [# v] to [1]\n    repeat (length of (text))\n        if <(letter (#) of (text)) > [ ]> then\n            switch costume to (letter (#) of (text))\n            change [width v] by ((Size) * ((item (costume [number v]) of [character widths v]) / (90)))\n            change [# v] by (1)\n        else\n            switch costume to ( v)\n            change [width v] by ((Size) * ((item (costume [number v]) of [character widths v]) / (90)))\n            change [# v] by (1)\n        end\n    end\n    if <(Width) > [400]> then\n        change [size v] by (-1)\n    end\n    if <(Width) < [390]> then\n        change [size v] by (1)\n    end\n    if <(Size) > [201]> then\n        set [size v] to [190]\n    end\nend\nset [x v] to ((0) - ((Width) / (2)))\n\ndefine Type (text) (x) (y) (size) (color) (brightness) (speed)\nset [length v] to (length of (text))\nif <(length of (text)) > [20]> then\n    Find Size [Text Too Long] (size)\n    Type: System [Text Too Long] (X) (y) (Size) (color) (brightness) (speed)\nelse\n    Find Size (text) (size)\n    Type: System (text) (X) (y) (Size) (color) (brightness) (speed)\nend\n\nwhen I start as a clone\nif <(Clone ID) = [Logo]> then\n    switch costume to (logo v)\n    reset timer\n    set size to (0) %\n    show\n    go to x: (300) y: (0)\n    set [var 1 v] to [-40]\n    repeat (34)\n        change size by (2)\n        change x by (Var 1)\n        change [var 1 v] by (2)\n    end\n    Clone Particles\n    Smooth Glide x: [0] y: [25] speed: [9]\n    wait until <(timer) > [4]>\n    set [var 1 v] to [10]\n    repeat (30)\n        change size by (Var 1)\n        change [var 1 v] by (-1)\n    end\n    delete this clone\nend\nif <(Clone ID) = [Back]> then\n    go to [back v] layer\n    show\n    go to x: (-500) y: (500)\n    set size to (200) %\n    switch costume to (landscape v)\n    clear graphic effects\n    wait until <(timer) > [4]>\n    repeat until <(timer) > [7.5]>\n        change x by (5)\n        change y by (-5)\n    end\n    delete this clone\nend\nif <(Clone ID) = [Back 2]> then\n    go to [back v] layer\n    show\n    go to x: (0) y: (0)\n    set size to (200) %\n    switch costume to (back 2 v)\n    clear graphic effects\n    repeat until <(timer) > [7.5]>\n        go to [back v] layer\n    end\n    delete this clone\nend\n\nwhen I start as a clone\nif <(Clone ID) = [Particle]> then\n    switch costume to (particle v)\n    clear graphic effects\n    set size to (100) %\n    go to x: (0) y: (0)\n    set [brightness v] effect to (100)\n    go to [front v] layer\n    go [backward v] (10) layers\n    set [var 1 v] to (pick random (10) to (15))\n    set [var 2 v] to (pick random (2) to (7))\n    turn right (pick random (-10) to (10)) degrees\n    show\n    repeat until <touching (_edge_ v)?>\n        move (Var 1) steps\n        change y by (Var 2)\n        change [var 2 v] by (-0.4)\n        set [var 1 v] to ((Var 1) * (0.95))\n    end\n    repeat (10)\n        move (Var 1) steps\n        change y by (Var 2)\n        change [var 2 v] by (-0.4)\n        set [var 1 v] to ((Var 1) * (0.95))\n        change [ghost v] effect by (10)\n    end\n    hide\n    delete this clone\nend\n\nwhen I start as a clone\nif <(Clone ID) = [Hider 1]> then\n    wait until <(timer) > [6.5]>\n    go to [front v] layer\n    point in direction (105)\n    show\n    go to x: (300) y: (0)\n    set size to (100) %\n    switch costume to (hider 2 v)\n    clear graphic effects\n    repeat until <<(round (x position)) = [0]> and <(round (y position)) = [0]>>\n        change x by (((0) - (round (x position))) / (5))\n        change y by (((0) - (round (y position))) / (5))\n    end\n    go to x: (0) y: (0)\n    wait (1) seconds\n    repeat (20)\n        change [ghost v] effect by (5)\n    end\n    delete this clone\nend\nif <(Clone ID) = [Hider 2]> then\n    wait until <(timer) > [6.5]>\n    go to [front v] layer\n    point in direction (105)\n    show\n    go to x: (-300) y: (0)\n    set size to (100) %\n    switch costume to (hider 1 v)\n    clear graphic effects\n    repeat until <<(round (x position)) = [0]> and <(round (y position)) = [0]>>\n        change x by (((0) - (round (x position))) / (5))\n        change y by (((0) - (round (y position))) / (5))\n    end\n    go to x: (0) y: (0)\n    wait (1) seconds\n    repeat (20)\n        change [ghost v] effect by (5)\n    end\n    delete this clone\nend\n\nwhen I start as a clone\nif <(Clone ID) = [Letter 2]> then\n    wait until <(timer) > [5]>\n    wait ((#) / (Length)) seconds\n    show\n    set [x v] to (x position)\n    set [y v] to (y position)\n    go to [front v] layer\n    set size to (Size) %\n    go to x: (X) y: (-300)\n    Smooth Glide x: (X) y: (Y) speed: [9]\n    wait until <(timer) > [7]>\n    delete this clone\nend\n\n@Bears\n\nwhen flag clicked\nhide\ngo to x: (-31) y: (-157)\nforever\n    if <(Level) = [1]> then\n        hide\n    end\n    if <(Level) = [2]> then\n        hide\n    end\n    if <(Level) = [3]> then\n        hide\n    end\n    if <(Level) = [4]> then\n        hide\n    end\n    if <(Level) = [5]> then\n        hide\n    end\n    if <(Level) = [6]> then\n        go to x: (55) y: (-63)\n        show\n        repeat until <<(x position) = [188]> or <(Level) = [7]>>\n            move (1) steps\n        end\n        hide\n    end\n    if <(Level) = [7]> then\n        show\n        go to x: (115) y: (2)\n    end\n    if <(Level) = [8]> then\n        hide\n    end\n    if <(Level) = [9]> then\n        show\n        go to x: (134) y: (124)\n        repeat until <<(x position) = [214]> or <(Level) = [10]>>\n            move (1) steps\n        end\n        hide\n    end\n    if <(Level) = [10]> then\n        go to x: (55) y: (-59)\n        show\n        repeat until <<(x position) = [188]> or <(Level) = [11]>>\n            move (1) steps\n        end\n        hide\n    end\n    if <(Level) = [11]> then\n        go to x: (55) y: (-59)\n        show\n        repeat until <<(x position) = [188]> or <(Level) = [12]>>\n            move (1) steps\n        end\n        hide\n    end\n    if <(Level) = [12]> then\n        hide\n    end\n    if <(Level) = [13]> then\n        hide\n    end\n    if <(Level) = [14]> then\n        hide\n    end\n    if <(Level) = [15]> then\n        hide\n    end\n    if <(Level) = [16]> then\n        go to x: (55) y: (-61)\n        show\n        create clone of (_myself_ v)\n        repeat until <<(x position) = [188]> or <(Level) = [17]>>\n            move (1) steps\n        end\n        hide\n    end\n    if <(Level) = [17]> then\n        hide\n    end\n    if <(Level) = [18]> then\n        hide\n    end\n    if <(Level) = [19]> then\n        hide\n    end\n    if <(Level) = [20]> then\n        hide\n    end\n    if <(Level) = [21]> then\n        hide\n    end\nend\n\nwhen I start as a clone\ngo to x: (-114) y: (-61)\nshow\nrepeat until <<(x position) = [0]> or <(Level) = [17]>>\n    move (1) steps\nend\nhide\n\n