Adventure | A platformer

Instructions: Hello, This is my first platformer on this account.\n\n--- CONTROLS ---\n\nWASD, Arrow Keys, Mobile Controls to move\nAvoid Lava and Spikes\nCollect Coins and Use Trampolines for help with jumping\n\n--- CREDITS ---\n\nIn game\n@alphabetica for Mobile Friendly Icon\n@Ziyu3 for Inspiration\n@Tralaxy for the Intro\n\nUPDATE:\n1.1: Intro Added\n

@Stage\n\nwhen flag clicked\nset [level # v] to [1]\nset volume to (55) %\nforever\n    play sound [Nebula v] until done\nend\n\n@Player\n\ndefine death\nrepeat (25)\n    turn right (-5) degrees\n    change y by (2)\n    change [ghost v] effect by (5)\nend\nSetup\n\ndefine Platformer Physics (speed) (friction) (gravity) (jump height) Controls <^> <<> <>> <\/>\ncreate clone of (_myself_ v)\nchange [yvelocity v] by (gravity)\nif <>> then\n    change [xveloctiy v] by (speed)\nend\nif <<> then\n    change [xveloctiy v] by ((speed) * (gravity))\nend\nset [xveloctiy v] to ((xVeloctiy) * (friction))\nchange x by (xVeloctiy)\nif <touching (level v)?> then\n    change y by (1)\n    if <touching (level v)?> then\n        change y by (1)\n        if <touching (level v)?> then\n            change y by (1)\n            if <touching (level v)?> then\n                change y by (1)\n                if <touching (level v)?> then\n                    change y by (1)\n                    if <touching (level v)?> then\n                        change y by (1)\n                        if <touching (level v)?> then\n                            change y by (1)\n                            if <touching (level v)?> then\n                                change y by (1)\n                                if <touching (level v)?> then\n                                    change y by (-8)\n                                    repeat until <not <touching (level v)?>>\n                                        change x by ((([abs v] of (xVeloctiy) ) / (xVeloctiy)) * (-1))\n                                    end\n                                    set [xveloctiy v] to [0]\n                                    if <<key (up arrow v) pressed?> or <<key (w v) pressed?> or <<mouse down?> and <(y position) < (mouse y)>>>> then\n                                        if <(xVeloctiy) > [0]> then\n                                            set [xveloctiy v] to [6]\n                                        else\n                                            set [xveloctiy v] to [-6]\n                                        end\n                                        set [yvelocity v] to [12]\n                                    else\n                                        set [xveloctiy v] to [0]\n                                    end\n                                end\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\nend\nchange y by (yVelocity)\nif <touching (level v)?> then\n    repeat until <not <touching (level v)?>>\n        change y by ((([abs v] of (yVelocity) ) / (yVelocity)) * (-1))\n    end\n    set [yvelocity v] to [0]\nend\nchange y by (-1)\nif <^> then\n    if <touching (level v)?> then\n        set [yvelocity v] to [12]\n    end\nend\nchange y by (1)\n\nwhen flag clicked\n\nwhen I start as a clone\nrepeat (10)\n    switch costume to (effect v)\n    change size by (-1)\n    change [ghost v] effect by (12)\nend\ndelete this clone\n\ndefine Touching Hazard <touching hazard>\nif <touching hazard> then\n    broadcast (Dead v)\n    death\nend\n\ndefine Next Level\nif <(x position) = [242]> then\n    broadcast (Leave Scene v)\n    set x to (-235)\nend\n\ndefine Trampoline\nif <touching (trampoline v)?> then\n    set [yvelocity v] to [20]\nend\n\nwhen flag clicked\nforever\n    Fix Overlap x2\nend\n\ndefine Fix Overlap x2\nrepeat (10)\n    repeat until <not <touching (level v)?>>\n        change y by (1)\n    end\nend\n\ndefine Setup\nset [xveloctiy v] to [0]\nset [yvelocity v] to [0]\npoint in direction (90)\ngo to x: (-211) y: (-52)\nset size to (60) %\ngo to [front v] layer\nclear graphic effects\nshow\n\nwhen I receive [intro v]\nforever\n    if <(Intro) = [1]> then\n        hide\n    else\n        show\n    end\nend\n\nwhen I receive [intro v]\n\nwhen I receive [begin v]\nSetup\nforever\n    Platformer Physics [1.5] [0.8] [-1] [12] Controls <<<key (up arrow v) pressed?> or <<mouse down?> and <(y position) < (mouse y)>>> or <key (w v) pressed?>> <<key (left arrow v) pressed?> or <<key (a v) pressed?> or <<mouse down?> and <(mouse x) < (x position)>>>> <<key (right arrow v) pressed?> or <<key (d v) pressed?> or <<mouse down?> and <(mouse x) > (x position)>>>> <key (down arrow v) pressed?>\n    Trampoline\n    Touching Hazard <<touching (lava v)?> or <touching (danger v)?>>\n    Next Level\nend\n\nstop [other scripts in sprite v]\n\nwhen I receive [end intro v]\n\nwhen I receive [begin v]\nforever\n    if <<<key (up arrow v) pressed?> or <<mouse down?> and <(y position) < (mouse y)>>> or <key (w v) pressed?>> then\n        switch costume to (up v)\n    end\n    if <<key (right arrow v) pressed?> or <<key (d v) pressed?> or <<mouse down?> and <(mouse x) > (x position)>>>> then\n        switch costume to (right v)\n    end\n    if <<key (left arrow v) pressed?> or <<key (a v) pressed?> or <<mouse down?> and <(mouse x) < (x position)>>>> then\n        switch costume to (left v)\n    end\n    if <<<key (left arrow v) pressed?> or <<key (a v) pressed?> or <<mouse down?> and <(mouse x) < (x position)>>>> and <<key (up arrow v) pressed?> or <<key (w v) pressed?> or <<mouse down?> and <(mouse y) > (y position)>>>>> then\n        switch costume to (up-left v)\n    end\n    if <<<key (right arrow v) pressed?> or <<key (d v) pressed?> or <<mouse down?> and <(mouse x) > (x position)>>>> and <<key (up arrow v) pressed?> or <<key (w v) pressed?> or <<mouse down?> and <(mouse y) > (y position)>>>>> then\n        switch costume to (up-right v)\n    end\n    if <not <<key (right arrow v) pressed?> or <<key (left arrow v) pressed?> or <<key (up arrow v) pressed?> or <<key (w v) pressed?> or <<key (a v) pressed?> or <<key (d v) pressed?> or <<<mouse down?> and <(mouse x) > (x position)>> or <<mouse down?> and <(mouse x) < (x position)>>>>>>>>>> then\n        switch costume to (stand v)\n    end\nend\n\nwhen flag clicked\nbroadcast (Begin v)\n\n@Level\n\nwhen flag clicked\ngo to x: (0) y: (0)\nswitch costume to (1 v)\nforever\n    set [level # v] to (costume [name v])\nend\n\nwhen I receive [leave scene v]\nnext costume\n\nwhen I receive [intro v]\nforever\n    if <(Intro) = [1]> then\n        hide\n    else\n        show\n    end\nend\n\n@Decorations\n\nwhen flag clicked\nswitch costume to (1 v)\nforever\n    set [level # v] to (costume [number v])\nend\n\nwhen I receive [leave scene v]\nnext costume\n\nwhen I receive [intro v]\nforever\n    if <(Intro) = [1]> then\n        hide\n    else\n        show\n    end\nend\n\n@Clouds\n\nwhen flag clicked\nhide\nforever\n    create clone of (_myself_ v)\n    wait (pick random (3) to (5)) seconds\nend\n\nwhen I start as a clone\nshow\ngo to [back v] layer\ngo to x: (300) y: (pick random (50) to (150))\nforever\n    set [ghost v] effect to (pick random (10) to (50))\n    switch costume to (pick random (1) to (5))\n    glide (pick random (7) to (10)) secs to x: (-300) y: (y position)\n    delete this clone\nend\n\n@Collectable\n\nwhen I receive [leave scene v]\nhide\ndelete this clone\n\nwhen flag clicked\nwait until <(LEVEL #) = [2]>\nrepeat (1)\n    if <(LEVEL #) = [2]> then\n        go to [front v] layer\n        Clone at x: [-65] y: [-22]\n        Clone at x: [-13] y: [-24]\n        Clone at x: [95] y: [-22]\n        Clone at x: [-191] y: [-84]\n    else\n        hide\n        delete this clone\n    end\nend\n\ndefine Clone at x: (x) y: (y)\nset x to (x)\nset y to (y)\ncreate clone of (_myself_ v)\n\nwhen flag clicked\nhide\n\nwhen I start as a clone\nshow\nforever\n    if <touching (player v)?> then\n        repeat (1)\n            start sound [Collect v]\n        end\n        clear sound effects\n        repeat (10)\n            change y by (5)\n            change [ghost v] effect by (10)\n        end\n        hide\n        add [1] to [collectable v]\n    end\nend\n\nwhen flag clicked\nwait until <(LEVEL #) = [3]>\nrepeat (1)\n    if <(LEVEL #) = [3]> then\n        go to [front v] layer\n        Clone at x: [-208] y: [-51]\n    else\n        hide\n        delete this clone\n    end\nend\n\nwhen flag clicked\nwait until <(LEVEL #) = [4]>\nrepeat (1)\n    if <(LEVEL #) = [4]> then\n        go to [front v] layer\n        Clone at x: [-202] y: [-82]\n    else\n        hide\n        delete this clone\n    end\nend\n\nwhen flag clicked\nwait until <(LEVEL #) = [5]>\nrepeat (1)\n    if <(LEVEL #) = [5]> then\n        go to [front v] layer\n        Clone at x: [-212] y: [-86]\n        Clone at x: [-126] y: [-86]\n        Clone at x: [52] y: [-86]\n        Clone at x: [91] y: [-86]\n    else\n        hide\n        delete this clone\n    end\nend\n\nwhen flag clicked\nwait until <(LEVEL #) = [6]>\nrepeat (1)\n    if <(LEVEL #) = [6]> then\n        go to [front v] layer\n        Clone at x: [-39] y: [12]\n    else\n        hide\n        delete this clone\n    end\nend\n\nwhen flag clicked\nwait until <(LEVEL #) = [7]>\nrepeat (1)\n    if <(LEVEL #) = [7]> then\n        go to [front v] layer\n        Clone at x: [200] y: [125]\n    else\n        hide\n        delete this clone\n    end\nend\n\nwhen flag clicked\nwait until <(LEVEL #) = [8]>\nrepeat (1)\n    if <(LEVEL #) = [8]> then\n        go to [front v] layer\n        Clone at x: [-41] y: [-77]\n        Clone at x: [-5] y: [-56]\n        Clone at x: [35] y: [-35]\n    else\n        hide\n        delete this clone\n    end\nend\n\nwhen flag clicked\nwait until <(LEVEL #) = [9]>\nrepeat (1)\n    if <(LEVEL #) = [9]> then\n        go to [front v] layer\n        Clone at x: [99] y: [-39]\n        Clone at x: [-215] y: [-85]\n        Clone at x: [-174] y: [-85]\n    else\n        hide\n        delete this clone\n    end\nend\n\nwhen flag clicked\nwait until <(LEVEL #) = [10]>\nrepeat (1)\n    if <(LEVEL #) = [10]> then\n        go to [front v] layer\n        Clone at x: [-174] y: [-85]\n        Clone at x: [11] y: [142]\n        Clone at x: [203] y: [142]\n    else\n        hide\n        delete this clone\n    end\nend\n\nwhen flag clicked\ndelete all of [collectable v]\nforever\n    if <(length of [collectable v]) = [10]> then\n        broadcast (Shop | 1 v)\n    end\nend\n\nwhen I receive [intro v]\nhide variable [level # v]\nhide\n\nwhen I receive [end intro v]\n\nwhen flag clicked\nshow variable [level # v]\nrepeat (1)\n    if <(LEVEL #) = [1]> then\n        go to [front v] layer\n        Clone at x: [-97] y: [-80]\n        Clone at x: [-58] y: [-80]\n        Clone at x: [-21] y: [-80]\n        Clone at x: [189] y: [-81]\n    else\n        hide\n        delete this clone\n    end\nend\n\n@Danger\n\nwhen flag clicked\nswitch costume to (1 v)\nforever\n    set [level # v] to (costume [name v])\nend\n\nwhen I receive [leave scene v]\nnext costume\n\n@Trampoline\n\nwhen flag clicked\nhide\n\ndefine Create clone of myself (x) (y)\nset x to (x)\nset y to (y)\ncreate clone of (_myself_ v)\n\nwhen I start as a clone\nshow\n\nwhen flag clicked\nwait until <(LEVEL #) = [3]>\nrepeat (1)\n    if <(LEVEL #) = [3]> then\n        go to [back v] layer\n        Create clone of myself [-13] [-121]\n    else\n        delete this clone\n    end\nend\n\nwhen I receive [leave scene v]\ndelete this clone\n\n@Lava\n\nwhen flag clicked\nswitch costume to (1 v)\ngo to x: (0) y: (0)\nforever\n    set [level # v] to (costume [name v])\n    repeat (10)\n        change y by (0.8)\n    end\n    wait (0.2) seconds\n    repeat (10)\n        change y by (-0.8)\n    end\n    wait (0.2) seconds\n    repeat (10)\n        change y by (0.8)\n    end\n    wait (0.2) seconds\n    repeat (10)\n        change y by (-0.8)\n    end\nend\n\nwhen I receive [leave scene v]\nnext costume\n\n@End\n\nwhen flag clicked\nhide\nwait until <(LEVEL #) = [11]>\nforever\n    if <(LEVEL #) = [11]> then\n        show\n    else\n        hide\n    end\nend\n\n@Notice Board\n\nwhen flag clicked\nhide\nwait until <(LEVEL #) = (length of [information])>\ngo to [back v] layer\ngo [forward v] (5) layers\nforever\n    if <(LEVEL #) = (join [1] [1])> then\n        show\n        if <touching (player v)?> then\n            say [Comment "Curious"]\n        else\n            say []\n        end\n    else\n        hide\n    end\nend\n\n@Credits\n\nwhen flag clicked\nhide\nwait until <(LEVEL #) = [11]>\nshow\ngo to x: (192) y: (158)\ngo to [front v] layer\nswitch costume to (credits v)\ncreate clone of (_myself_ v)\nset [shop open? v] to [no]\nforever\n    if <<touching (mouse-pointer v)?> and <mouse down?>> then\n        if <(shop open?) = [no]> then\n            go to x: (-50) y: (-161)\n            set [shop open? v] to [yes]\n            switch costume to (close v)\n            broadcast (Open Shop v)\n            wait until <not <mouse down?>>\n        else\n            go to x: (190) y: (158)\n            set [shop open? v] to [no]\n            switch costume to (credits v)\n            broadcast (Close Shop v)\n            wait until <not <mouse down?>>\n        end\n    end\nend\n\nwhen I start as a clone\nhide\nswitch costume to (open v)\nset [ghost v] effect to (20)\ngo to x: (0) y: (0)\nforever\n    wait until <(shop open?) = [yes]>\n    show\n    wait until <(shop open?) = [no]>\n    hide\nend\n\n@Thumbnail\n\nwhen flag clicked\nhide\nshow variable [level # v]\n\nshow\nhide variable [level # v]\ngo to x: (0) y: (0)\ngo to [front v] layer\n\n@Dead\n\nwhen flag clicked\ngo to x: (0) y: (0)\nhide\n\nwhen I receive [dead v]\nshow\nclear graphic effects\ngo to [front v] layer\nwait (1.2) seconds\nrepeat (10)\n    change [ghost v] effect by (10)\n    change [pixelate v] effect by (10)\nend\nhide\n\n@Control Stick\n\nwhen flag clicked\ngo to [front v] layer\nset [myself v] to [Control Stick]\nset size to (100) %\nset [max stick v] to ((size) / (4))\nswitch costume to (base v)\nset [ghost v] effect to (60)\ncreate clone of (_myself_ v)\n\nwhen I start as a clone\nswitch costume to (stick v)\ngo [forward v] (1) layers\nset [ghost v] effect to (25)\nforever\n    set [stick power v] to []\n    set [stick x v] to [0]\n    set [stick y v] to [0]\n    repeat until <mouse down?>\n        go to (myself)\n    end\n    if <(distance to [mouse-pointer v]) < ((size) * (0.6))> then\n        Stick Drag\n    else\n        wait until <not <mouse down?>>\n    end\nend\n\ndefine Stick Drag\nrepeat until <not <mouse down?>>\n    go to (mouse-pointer v)\n    point towards (myself)\n    turn right (180) degrees\n    set [stick direction v] to (direction)\n    set [stick power v] to (distance to [(myself) v])\n    if <(STICK POWER) > (max stick)> then\n        move ((max stick) - (STICK POWER)) steps\n        set [stick power v] to (max stick)\n    end\n    set [stick power v] to ((STICK POWER) / (max stick))\n    set [stick x v] to ((STICK POWER) * ([sin v] of (STICK DIRECTION) ))\n    set [stick y v] to ((STICK POWER) * ([cos v] of (STICK DIRECTION) ))\nend\n\n