Swiss Alps || A Platformer
@Stage\n\nwhen flag clicked\nset volume to (50) %\nforever\n    play sound [Alan Walker - Alone \(Karaoke Version\) v] until done\nend\n\n@Sprite1\n\ndefine Restart\nset [x v] to [0]\nset [y v] to [0]\ngo to x: (-200) y: (-50)\nif <(Lives) < [1]> then\n    stop [all v]\nend\n\ndefine Physics\nif <key (down arrow v) pressed?> then\n    switch costume to (costume2 v)\nelse\n    switch costume to (costume1 v)\nend\nif <<(Attacking) = [no]> and <key (space v) pressed?>> then\n    set [attacking v] to [yes]\n    broadcast (Attack v)\nend\nif <<key (right arrow v) pressed?> or <<key (d v) pressed?> or <<mouse down?> and <(mouse x) > (x position)>>>> then\n    point in direction (90)\n    change [x v] by (1)\nend\nif <<key (left arrow v) pressed?> or <<key (a v) pressed?> or <<mouse down?> and <(x position) > (mouse x)>>>> then\n    point in direction (-90)\n    change [x v] by (-1)\nend\nchange x by (x)\nSlope Detection\nif <<touching (sprite2 v)?> or <<touching (dissapearing v)?> or <touching (appearing  v)?>>> then\n    if <(x) > [0]> then\n        set [x v] to [-1]\n    else\n        set [x v] to [1]\n    end\n    repeat until <not <<touching (appearing  v)?> or <<touching (dissapearing v)?> or <touching (sprite2 v)?>>>>\n        change x by (x)\n    end\n    if <<key (up arrow v) pressed?> or <<key (w v) pressed?> or <<mouse down?> and <(mouse y) > (y position)>>>> then\n        if <[0] > (x)> then\n            set [x v] to [-6]\n            set [y v] to [10]\n        else\n            set [x v] to [6]\n            set [y v] to [10]\n        end\n    else\n        set [x v] to [0]\n    end\nelse\n    set [x v] to ((x) * (.9))\nend\nchange y by (y)\nif <<<touching (sprite2 v)?> or <<touching (dissapearing v)?> or <touching (appearing  v)?>>> or <<not <touching color (#ffde2a)?>> and <<touching color (#ffd900)?> or <touching color (#e47224)?>>>> then\n    if <(y) > [0]> then\n        set [y v] to [-1]\n    else\n        set [y v] to [1]\n    end\n    repeat until <not <<touching (appearing  v)?> or <<touching (dissapearing v)?> or <touching (sprite2 v)?>>>>\n        change y by (y)\n    end\n    set [y v] to [0]\n    if <<key (up arrow v) pressed?> or <<key (w v) pressed?> or <<mouse down?> and <(mouse y) > (y position)>>>> then\n        if <(Jumping?) = [no]> then\n            set [y v] to [12]\n            set [jumping? v] to [yes]\n        end\n    end\nelse\n    change [y v] by (-1)\n    set [jumping? v] to [no]\nend\nif <<<touching (danger v)?> or <(y position) < [-179]>> or <touching (sprite3 v)?>> then\n    change [lives v] by (-1)\n    if <(Collected) = [no]> then\n        set [last lives v] to (Lives)\n    end\n    Restart\n    broadcast (Reset Enemy v)\nend\nif <<touching color (#ffde2a)?> and <touching (danger v)?>> then\n    set [y v] to [20]\n    set [jumping? v] to [yes]\n    broadcast (bounce v)\nend\nif <<(Collected) = [yes]> and <touching (endpoirtal v)?>> then\n    broadcast (Portal Animation  v)\nend\n\ndefine Slope Detection\nset [slope v] to [0]\nrepeat until <<(Slope) = [8]> or <not <<touching (appearing  v)?> or <<touching (dissapearing v)?> or <touching (sprite2 v)?>>>>>\n    change y by (1)\n    change [slope v] by (1)\nend\nif <<touching (appearing  v)?> or <<touching (dissapearing v)?> or <touching (sprite2 v)?>>> then\n    change y by (-8)\nend\n\nchange [lives v] by (-1)\nRestart\nbroadcast (Reset Enemy v)\n\nwhen I receive [green flag v]\nset [attacking v] to [no]\ngo to [back v] layer\nset [lives v] to [15]\nRestart\nSetup\nshow\nset [level v] to [1]\nforever\n    Physics\n    if <(Help Showing) = [yes]> then\n        wait until <(Help Showing) = [no]>\n    end\nend\n\nwhen I receive [green flag v]\nset [help showing v] to [no]\nset [ghost v] effect to (0)\npoint in direction (90)\nforever\n    play sound [Vexento - Tevo \(Original Mix\)2.MP3 v] until done\nend\n\nwhen flag clicked\nset rotation style [left-right v]\n\nwhen I receive [portal animation  v]\nset [help showing v] to [yes]\nrepeat (distance to [endpoirtal v])\n    point towards (endpoirtal v)\n    turn left (65) degrees\n    move ((distance to [endpoirtal v]) / (2)) steps\n    change [ghost v] effect by (4)\nend\nchange [level v] by (1)\nRestart\nbroadcast (Reset Enemy v)\nbroadcast (Delete Clones v)\nset [help showing v] to [no]\npoint in direction (90)\nset [ghost v] effect to (0)\n\nwhen flag clicked\nhide\n\nwhen I receive [start cutscene v]\nshow\n\ndefine Setup\ndelete all of [collected? v]\nrepeat (10)\n    add [] to [collected? v]\nend\n\n@Sprite2\n\nwhen I receive [green flag v]\ngo to x: (0) y: (0)\ngo to [back v] layer\ngo [forward v] (1) layers\nforever\n    switch costume to (Level)\nend\n\nwhen flag clicked\nhide\n\nwhen I receive [start cutscene v]\nshow\n\n@Drawings\n\nwhen flag clicked\nhide\n\n@Danger\n\nwhen I receive [green flag v]\ngo to x: (0) y: (0)\ngo to [back v] layer\nforever\n    set [brightness v] effect to ((([sin v] of ((timer) * (150)) ) * (10)) - (5))\n    switch costume to (Level)\nend\n\nwhen flag clicked\nhide\n\nwhen I receive [start cutscene v]\nshow\n\n@key\n\ndefine Movement (x) (y)\nwait (.02) seconds\nset [collected v] to [no]\nshow\nset [last level v] to (Level)\nset size to (100) %\npoint in direction (90)\nset [last lives v] to (Lives)\nrepeat until <touching (sprite1 v)?>\n    go to x: (x) y: ((([sin v] of (((timer) + (-3)) * (150)) ) * (7)) + (y))\nend\nset [collected v] to [yes]\nbroadcast (collected v)\nrepeat (15)\n    change size by (-6)\n    turn right (25) degrees\nend\nhide\nrepeat until <(Level) > (Last Level)>\n    if <(Lives) < (Last lives)> then\n        Movement (x) (y)\n    end\nend\n\nstart sound [337049__shinephoenixstormcrow__320655-rhodesmas-level-up-01 v]\n\nwhen I receive [green flag v]\nMovement [-100] [-90]\nMovement [0] [130]\nMovement [-100] [-90]\nMovement [193] [100]\nMovement [183] [38]\nMovement [-200] [38]\nMovement [-175] [40]\n\nwhen flag clicked\nhide\n\nwhen I receive [start cutscene v]\nshow\n\n@endpoirtal\n\nwhen I receive [green flag v]\nforever\n    if <(Collected) = [yes]> then\n        switch costume to (costume2 v)\n    else\n        switch costume to (costume1 v)\n    end\n    set [ghost v] effect to ((([sin v] of ((timer) * (100)) ) * (40)) + (3))\n    if <(Level) = [7]> then\n        go to x: (202) y: (110)\n    else\n        go to x: (193) y: (-44)\n    end\nend\n\nwhen flag clicked\nhide\n\nwhen I receive [start cutscene v]\nshow\n\n@appearing \n\ndefine show\nshow\nset [ghost v] effect to (100)\nrepeat (20)\n    switch costume to (Level)\n    if <(Stop animation!) = [no]> then\n        change [ghost v] effect by (-5)\n    else\n        hide\n        set [ghost v] effect to (100)\n        stop [this script v]\n    end\nend\n\ndefine wait\nwait (.02) seconds\nswitch costume to (Level)\nset [stop animation! v] to [yes]\nwait until <(Collected) = [yes]>\nswitch costume to (Level)\nset [stop animation! v] to [no]\nbroadcast (show appearing v)\nrepeat until <(Level) > (Last Level)>\n    if <(Lives) < (Last lives)> then\n        hide\n        wait\n    end\nend\nhide\n\nwhen I receive [green flag v]\nwait (.02) seconds\nhide\nset size to (100) %\npoint in direction (90)\ngo to x: (0) y: (0)\nforever\n    switch costume to (Level)\n    wait\nend\n\nwhen flag clicked\nhide\n\nwhen I receive [start cutscene v]\nshow\n\nwhen I receive [show appearing v]\nshow\n\n@dissapearing\n\ndefine Hide\nset [ghost v] effect to (0)\nrepeat (20)\n    switch costume to (Level)\n    if <(Stop animation!) = [no]> then\n        change [ghost v] effect by (5)\n    else\n        set [ghost v] effect to (0)\n        show\n        stop [this script v]\n    end\nend\nhide\n\ndefine wait\nwait (.02) seconds\nset [stop animation! v] to [yes]\nswitch costume to (Level)\nwait until <(Collected) = [yes]>\nswitch costume to (Level)\nset [stop animation! v] to [no]\nbroadcast (Hide dissapearing v)\nrepeat until <(Level) > (Last Level)>\n    switch costume to (Level)\n    if <(Lives) < (Last lives)> then\n        set [ghost v] effect to (0)\n        show\n        wait\n    end\nend\nset [ghost v] effect to (0)\nshow\n\nwhen I receive [green flag v]\nwait (.01) seconds\nshow\nset size to (100) %\npoint in direction (90)\ngo to x: (0) y: (0)\nforever\n    switch costume to (Level)\n    wait\nend\n\nwhen flag clicked\nhide\n\nwhen I receive [start cutscene v]\nshow\n\nwhen I receive [hide dissapearing v]\nHide\n\n@Red Counter\n\nwhen I start as a clone\nshow\nforever\n    set size to (40) %\n    go to x: (((digits) * (16)) - (150)) y: (150)\n    if <(length of (Lives)) < (digits)> then\n        hide\n    else\n        show\n        switch costume to (letter (digits) of (Lives))\n    end\nend\n\nwhen I receive [game over v]\nstop [other scripts in sprite v]\ndelete this clone\n\nwhen flag clicked\nshow\nswitch costume to (lives v)\ngo to x: (-189) y: (150)\nset size to (40) %\n\nwhen I receive [green flag v]\nset [digits v] to [1]\nrepeat (5)\n    create clone of (_myself_ v)\n    change [digits v] by (1)\nend\n\nwhen flag clicked\nhide\n\nwhen I receive [start cutscene v]\nshow\n\n@Sprite3\n\ndefine Restart\nhide\nstop [other scripts in sprite v]\nset [x v] to [0]\nset [y v] to [0]\nbroadcast (Spawn v)\ndelete this clone\n\ndefine Physics\nset rotation style [left-right v]\nif <(Red) > [0]> then\n    switch costume to (12 v)\n    change [red v] by (-1)\nelse\n    next costume\n    if <(costume [number v]) = [12]> then\n        next costume\n    end\nend\nif <(x position) < ([x position v] of [sprite1 v])> then\n    change [x v] by (.4)\n    point in direction (-90)\nend\nif <([x position v] of [sprite1 v]) < (x position)> then\n    change [x v] by (-.4)\n    point in direction (90)\nend\nchange x by (x)\nSlope Detection\nif <<touching (appearing  v)?> or <<touching (dissapearing v)?> or <touching (sprite2 v)?>>> then\n    if <(x) > [0]> then\n        set [x v] to [-1]\n    else\n        set [x v] to [1]\n    end\n    change y by (2)\n    repeat until <not <<touching (dissapearing v)?> or <<touching (appearing  v)?> or <touching (sprite2 v)?>>>>\n        change x by (x)\n    end\n    change y by (-2)\n    if <(y position) < ([y position v] of [sprite1 v])> then\n        if <[0] > (x)> then\n            set [x v] to [-10]\n            set [y v] to [10]\n        else\n            set [x v] to [10]\n            set [y v] to [10]\n        end\n    else\n        set [x v] to [0]\n    end\nelse\n    set [x v] to ((x) * (.9))\nend\nchange y by (y)\nif <<touching (appearing  v)?> or <<touching (dissapearing v)?> or <touching (sprite2 v)?>>> then\n    if <(y) > [0]> then\n        set [y v] to [-1]\n    else\n        set [y v] to [1]\n    end\n    repeat until <not <<touching (appearing  v)?> or <<touching (dissapearing v)?> or <touching (sprite2 v)?>>>>\n        change y by (y)\n    end\n    set [y v] to [0]\n    if <((y position) - (0)) < ([y position v] of [sprite1 v])> then\n        if <(Jumping?) = [no]> then\n            set [y v] to [12]\n            set [jumping? v] to [yes]\n        end\n    end\nelse\n    change [y v] by (-1)\n    set [jumping? v] to [no]\nend\nif <(y position) < [-179]> then\n    delete this clone\nend\nif <<touching (danger v)?> or <touching (sprite5 v)?>> then\n    change [how long touching v] by (-1)\n    if <<(touching?) = [no]> or <(How long touching) < [1]>> then\n        set [red v] to [5]\n        set [touching? v] to [yes]\n        change [health v] by (-1)\n        if <(health) > [0]> then\n            start sound [547036__eponn__hit-impact-sword-2 v]\n            set [y v] to [8]\n            if <([x position v] of [sprite1 v]) < (x position)> then\n                set [x v] to [17]\n            else\n                set [x v] to [-17]\n            end\n        else\n            set [dying v] to [yes]\n        end\n    end\nelse\n    set [touching? v] to [no]\n    set [how long touching v] to [7]\nend\n\ndefine Slope Detection\nset [slope v] to [0]\nrepeat until <<(Slope) = [8]> or <not <<<touching (dissapearing v)?> or <touching (appearing  v)?>> or <touching (sprite2 v)?>>>>\n    change y by (1)\n    change [slope v] by (1)\nend\nif <<<touching (dissapearing v)?> or <touching (appearing  v)?>> or <touching (sprite2 v)?>> then\n    change y by (-8)\nend\n\nwhen I receive [reset enemy v]\nRestart\n\nwhen I start as a clone\nset [dying v] to [no]\nhide\nset size to (20) %\nshow\nset [health v] to [3]\nwait (.04) seconds\ngo to (random position v)\nMove\nforever\n    Physics\n    if <(Help Showing) = [yes]> then\n        wait until <(Help Showing) = [no]>\n    end\n    if <(dying) = [yes]> then\n        start sound [547036__eponn__hit-impact-sword-2 v]\n        set rotation style [all around v]\n        switch costume to (12 v)\n        repeat (14)\n            turn right (40) degrees\n            change [ghost v] effect by (6)\n            change size by (-1)\n        end\n        delete this clone\n    end\nend\n\nwhen I receive [delete clones v]\ndelete this clone\n\nwhen I receive [green flag v]\ngo to [back v] layer\nRestart\nhide\nset [level v] to [1]\n\nwhen I receive [spawn v]\nwait (.01) seconds\nClone\n\nwhen flag clicked\nset size to (60) %\ngo to x: (188) y: (-98)\n\nwhen I receive [death v]\nif <(health) < [1]> then\n\ndefine Clone\nrepeat ([floor v] of ((Level) / (2)) )\n    create clone of (_myself_ v)\nend\n\nshow\nset [cutseen v] to [going]\nset [help showing v] to [yes]\ngo to [front v] layer\nbroadcast (Fight! v)\nwait until <(Cutseen) = [over]>\n\ndefine Move\nrepeat until <not <<touching (appearing  v)?> or <<touching (dissapearing v)?> or <<(distance to [sprite1 v]) < [70]> or <touching (sprite2 v)?>>>>>\n    go to (random position v)\nend\n\nwhen [timer v] > (timer)\nstop [other scripts in sprite v]\ndelete this clone\n\n@Sprite5\n\nwhen I receive [attack v]\ngo to [back v] layer\nshow\nstart sound [380488__deleted-user-6479820__sword-swipes v]\nif <([direction v] of [sprite1 v]) = [90]> then\n    switch costume to (costume1 v)\n    point in direction (-75)\n    repeat (9)\n        go to (sprite1 v)\n        turn right (22) degrees\n    end\nelse\n    switch costume to (costume2 v)\n    point in direction (75)\n    repeat (9)\n        go to (sprite1 v)\n        turn right (-22) degrees\n    end\nend\nhide\nwait (.2) seconds\nset [attacking v] to [no]\n\nwhen flag clicked\nhide\n\n@CutsceneCut\n\ndefine Fade in/out (-10 or 10)\nrepeat (10)\n    go to [front v] layer\n    change [ghost v] effect by (-10 or 10)\nend\n\nwhen I start as a clone\nswitch costume to (costume1 v)\ngo to [front v] layer\ngo [backward v] (1) layers\nset [ghost v] effect to (0)\n\nwhen I receive [green flag v]\nFade in/out [10]\nhide\ndelete this clone\n\nwhen I receive [start cutscene v]\ngo to x: (0) y: (0)\nshow\nset [ghost v] effect to (100)\nswitch costume to (bad rats v)\ncreate clone of (_myself_ v)\nFade in/out [-10]\nrepeat (2)\n    wait until <<key (space v) pressed?> or <mouse down?>>\n    Fade in/out [10]\n    next costume\n    Fade in/out [-10]\nend\nwait until <<key (space v) pressed?> or <mouse down?>>\nbroadcast (Green Flag v)\n\nwhen flag clicked\nhide\n\n@Intro\n\nwhen flag clicked\nset size to (100) %\nset [clone# v] to [0]\nrepeat (2)\n    change [clone# v] by (1)\n    create clone of (_myself_ v)\nend\nwait (.7) seconds\nrepeat (16)\n    change [clone# v] by (1)\n    create clone of (_myself_ v)\n    wait (.03) seconds\nend\n\nwhen I start as a clone\nshow\nif <(clone#) = [1]> then\n    switch costume to (y4 v)\n    go to x: (100) y: (-190)\n    set [my dir v] to [0]\n    set [ghost v] effect to (100)\n    Point to X: (My dir) Y: [0]\n    wait (.1) seconds\n    repeat (10)\n        change [ghost v] effect by (-10)\n    end\n    repeat (70)\n        Point to X: (My dir) Y: [0]\n        change [my dir v] by (2)\n    end\n    repeat (100)\n        Point to X: (My dir) Y: [0]\n        change [my dir v] by (-2)\n        change [ghost v] effect by (1)\n    end\nelse\n    if <(clone#) = [2]> then\n        switch costume to (y4 v)\n        go to x: (-100) y: (-190)\n        set [my dir v] to [0]\n        set [ghost v] effect to (100)\n        Point to X: (My dir) Y: [0]\n        wait (.1) seconds\n        set [ghost v] effect to (100)\n        repeat (10)\n            change [ghost v] effect by (-10)\n        end\n        repeat (70)\n            Point to X: (My dir) Y: [0]\n            change [my dir v] by (-2)\n        end\n        repeat (100)\n            Point to X: (My dir) Y: [0]\n            change [my dir v] by (2)\n            change [ghost v] effect by (1)\n        end\n    else\n        point in direction (90)\n        set [ghost v] effect to (100)\n        show\n        go to x: ((((clone#) - (2)) * (29)) - ((8) * (30))) y: (0)\n        set size to (65) %\n        switch costume to ((clone#) - (2))\n        repeat (5)\n            change [ghost v] effect by (-20)\n        end\n        wait (2) seconds\n        repeat (5)\n            change [ghost v] effect by (20)\n        end\n    end\nend\ndelete this clone\n\ndefine Point to X: (x) Y: (y)\nset [dx v] to ((x) - (x position))\nset [dy v] to ((y) - (y position))\nif <(dy) = [0]> then\n    if <(dx) > [0]> then\n        set [dir v] to [90]\n    else\n        set [dir v] to [-90]\n    end\nelse\n    if <(dy) > [0]> then\n        set [dir v] to ([atan v] of ((dx) / (dy)) )\n    else\n        set [dir v] to ((180) + ([atan v] of ((dx) / (dy)) ))\n    end\nend\nif <not <(direction) = (dir)>> then\n    point in direction (dir)\nend\n\nwhen flag clicked\nset [level v] to [0]\nset [intro going? v] to [yes]\npoint in direction (90)\nshow\nswitch costume to (y5 v)\ngo to x: (0) y: (0)\nrepeat (103)\n    go to [back v] layer\n    set [ghost v] effect to (10)\n    go to x: (0) y: (0)\nend\nwait (3) seconds\nbroadcast (Start Cutscene v)\nrepeat (20)\n    change [ghost v] effect by (5)\nend\nset [intro going? v] to [no]\nforever\n    set [ghost v] effect to (50)\n    go to x: (0) y: (0)\n    go to [back v] layer\n    if <(Level) = [8]> then\n        stop [all v]\n    end\nend\n\nwhen flag clicked\nforever\n    set [timer v] to ((timer) + (.1))\nend\n\nwhen [timer v] > (timer)\nif <(Level) = [8]> then\n    switch costume to (thanks v)\nelse\n    switch costume to (thanks2 v)\nend\nforever\n    set [timer v] to ((timer) + (.1))\n    go to [front v] layer\n    point in direction ((([sin v] of (((timer) + (-3)) * (150)) ) * (10)) + (90))\nend\n\n
Here's my entry for @-PickleAnimator-'s contest!\n\nArrow keys to move (down arrow to crouch)\n\nI made a game, but also added a very simple intro. Hope you like it!\n\nAlso, I've made a Scrolling Sequel. Here's the link: \nhttps://scratch.mit.edu/projects/468707306/