Radioactive A 100% Pen Platformer


@Stage\n\nwhen flag clicked\nswitch backdrop to (backdrop20 v)\n\nwhen I receive [green flag clicked v]\nswitch backdrop to (backdrop1 v)\nforever\n    play sound [hollow-knight-ost-enter-hallownest-youtubemp3free v] until done\nend\n\n@Scratch Cat2\n\nwhen I receive [green flag clicked v]\npoint in direction (90)\nset size to (40) %\nset rotation style [left-right v]\ngo to x: (-200) y: (0)\nshow\nset [speed y v] to [0]\nset [falling? v] to [10]\nforever\n    switch costume to (hitbox v)\n    if <<(speed y) < [4]> or <<key (w v) pressed?> or <<key (space v) pressed?> or <<key (up arrow v) pressed?> or <<mouse down?> and <(mouse y) > (y position)>>>>>> 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]>\n    if <(wall jump) > [0]> then\n        change [wall jump v] by (-1)\n    else\n        set [speed x v] to ((speed x) * (0.7))\n        if <<key (left arrow v) pressed?> or <<key (a v) pressed?> or <<mouse down?> and <(x position) > (mouse x)>>>> then\n            change [speed x v] by (-1.5)\n        end\n        if <<key (right arrow v) pressed?> or <<key (d v) pressed?> or <<mouse down?> and <(mouse x) > (x position)>>>> then\n            change [speed x v] by (1.5)\n        end\n    end\n    if <(speed x) < [-0.5]> then\n        Walk (-90) (speed x)\n    else\n        if <(speed x) > [0.5]> then\n            Walk (90) (speed x)\n        else\n            set [frame v] to [0]\n        end\n    end\n    if <<key (w v) pressed?> or <<key (space v) pressed?> or <<key (up arrow v) pressed?> or <<mouse down?> and <(mouse y) > (y position)>>>>> 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 <(y position) < [-180]> then\n        go to x: (-200) y: (0)\n        broadcast (Retry v)\n        set [speed y v] to [0]\n    end\n    if <(x position) > [220]> then\n        go to x: (-200) y: (0)\n        if <not <([costume # v] of [ground v]) = [19]>> then\n            broadcast (Next level v)\n        end\n    end\n    if <touching (spikes v)?> then\n        switch costume to (die2 v)\n        start sound [whoop v]\n        repeat (20)\n            change [ghost v] effect by (5)\n        end\n        broadcast (Retry v)\n        set [ghost v] effect to (0)\n        go to x: (-200) y: (0)\n    end\n    if <touching (bounce v)?> then\n        set [speed y v] to [25]\n    end\n    Set Costume\nend\n\nstart sound [oof XD v]\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 (ground 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))\n    if <<<key (w v) pressed?> or <<key (space v) pressed?> or <<key (up arrow v) pressed?> or <<mouse down?> and <(mouse y) > (y position)>>>>> and <([abs v] of (speed) ) > [3]>> then\n        if <(wall jump) = [0]> then\n            set [speed x v] to ((-1.2) * (speed))\n            set [speed y v] to [11]\n            set [falling? v] to [6]\n            set [wall jump v] to [15]\n        end\n    else\n        set [speed x v] to [0]\n    end\nend\nif <(speed) < [0]> then\n    change [frame v] by ((speed) / (-10))\nelse\n    change [frame v] by ((speed) / (10))\nend\n\ndefine Touch Ground <up?>\nchange [falling? v] by (1)\nrepeat until <not <touching (ground 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\ndefine Set Costume\nif <(falling?) < [6]> then\n    if <(frame) = [0]> then\n        switch costume to (stand2 v)\n    else\n        switch costume to ([floor v] of ((5) + ((frame) mod (17))) )\n    end\nelse\n    if <(speed y) > [0]> then\n        switch costume to (run_j1 v)\n    else\n        switch costume to (run_j2 v)\n    end\nend\n\nwhen [space v] key pressed\nset language to (en v)::tts\nset voice to (giant v)::tts\nspeak [Welcome to halloween, a platformer, try not to hit spikes. You can wall jump.]::tts\nspeak [Use the arrow keys to move, \(duh\)]::tts\nspeak [If you do hit spikes, you will have to listen to a horrible oof sound]::tts\n\nwhen flag clicked\nif <(username) = [huntedskelly]> then\n    speak [Hello huntedskelly, thank you for following me, I hope you like this project!]::tts\nend\n\nwhen I receive [next level v]\npoint in direction (90)\nset size to (40) %\nset rotation style [left-right v]\ngo to x: (-200) y: (0)\nshow\nset [speed y v] to [0]\nset [falling? v] to [10]\n\nwhen I receive [retry v]\npoint in direction (90)\nset size to (40) %\nset rotation style [left-right v]\ngo to x: (-200) y: (0)\nshow\nset [speed y v] to [0]\nset [falling? v] to [10]\n\nwhen flag clicked\nhide\n\n@Ground\n\nwhen I receive [next level v]\nnext costume\nnext backdrop\n\nwhen flag clicked\nhide\nswitch costume to (costume1 v)\nswitch backdrop to (backdrop1 v)\n\nwhen I receive [green flag clicked v]\nshow\n\nwhen flag clicked\nhide\n\n@Spikes\n\nwhen flag clicked\nhide\nswitch costume to (costume1 v)\n\nwhen I receive [next level v]\ngo to [back v] layer\nnext costume\n\nwhen I receive [green flag clicked v]\nshow\n\n@Bounce\n\nwhen flag clicked\nswitch costume to (1 v)\n\nwhen I receive [next level v]\nnext costume\n\nwhen flag clicked\nhide\n\nwhen I receive [green flag clicked v]\nshow\n\n@Thumbnail\n\nwhen flag clicked\nforever\n    show\n    go to [front v] layer\n    set [ghost v] effect to (100)\nend\n\nshow\ngo to [front v] layer\nset [ghost v] effect to (0)\nwait (1) seconds\nrepeat (20)\n    broadcast (Green Flag clicked v)\n    change [ghost v] effect by (5)\nend\n\n@Background stuff\n\nwhen I start as a clone\nshow\ngo to [back v] layer\ngo to [back v] layer\nrepeat until <(x position) < [-220]>\n    move (5) steps\nend\ndelete this clone\n\ndefine Start\nrepeat (100)\n    go to (random position v)\n    set size to (pick random (20) to (50)) %\n    set [ghost v] effect to (pick random (90) to (95))\n    point in direction (pick random (-70) to (-100))\n    create clone of (_myself_ v)\nend\n\nwhen I receive [green flag clicked v]\nStart\nforever\n    hide\n    point in direction (pick random (-70) to (-100))\n    go to x: (300) y: (pick random (-180) to (180))\n    set size to (pick random (20) to (50)) %\n    set [ghost v] effect to (pick random (90) to (95))\n    create clone of (_myself_ v)\nend\n\n@Sprite1\n\nwhen flag clicked\nforever\n    set size to (30) %\n    if <touching (mouse-pointer v)?> then\n        point in direction ((([sin v] of ((timer) * (300)) ) * (20)) + (90))\n        set [ghost v] effect to (0)\n    else\n        point in direction (90)\n        set [ghost v] effect to (70)\n    end\nend\n\nwhen this sprite clicked\nif <not <([costume # v] of [ground v]) = [19]>> then\n    broadcast (Next level v)\nend\n\nwhen flag clicked\nhide\n\nwhen I receive [green flag clicked v]\nshow\n\n@Sprite2\n\nwhen flag clicked\nforever\n    set size to (30) %\n    if <touching (mouse-pointer v)?> then\n        point in direction ((([sin v] of ((timer) * (300)) ) * (20)) + (90))\n        set [ghost v] effect to (0)\n    else\n        point in direction (90)\n        set [ghost v] effect to (70)\n    end\nend\n\nwhen this sprite clicked\nbroadcast (Retry v)\n\nwhen flag clicked\nhide\n\nwhen I receive [green flag clicked v]\nshow\n\n@Sprite3\n\nwhen flag clicked\nshow\nswitch costume to (costume1 v)\nset size to (50) %\nstart sound [Clock Ticking v]\nstart sound [firelaunch1 v]\nset [clone mode v] to [0]\ncreate clone of (_myself_ v)\ngo to x: (-400) y: (0)\npoint in direction (-170)\nrepeat (20)\n    change x by (((0) - (x position)) / (4))\n    turn right (((90) - (direction)) / (4)) degrees\nend\nrepeat (50)\n    point in direction ((([sin v] of ((timer) * (300)) ) * (50)) + (90))\n    set size to ((([sin v] of ((timer) * (300)) ) * (50)) + (100)) %\nend\npoint in direction (90)\nset [yv v] to [10]\nstop all sounds\nstart sound [Boom v]\nset [ghost v] effect to (0)\nrepeat (50)\n    Clone\n    change y by (Yv)\n    change [yv v] by (-1)\n    if <(y position) < [0]> then\n        set [ghost v] effect to ([abs v] of (y position) )\n    end\nend\nswitch costume to (costume5 v)\ngo to x: (0) y: (0)\nrepeat (10)\n    change [ghost v] effect by (-10)\nend\nwait (1) seconds\nrepeat (10)\n    change [ghost v] effect by (10)\nend\nhide\nbroadcast (Green Flag clicked v)\n\nwhen I start as a clone\nif <(Clone Mode) = [0]> then\n    point in direction (-170)\n    go to x: (400) y: (0)\n    repeat (20)\n        turn right (((90) - (direction)) / (4)) degrees\n        change x by (((0) - (x position)) / (4))\n    end\n    delete this clone\nelse\n    set size to (200) %\n    switch costume to (pick random (2) to (4))\n    set [turn v] to (pick random (-10) to (10))\n    set [ghost v] effect to (60)\n    go to [back v] layer\n    set [xv v] to (pick random (-30) to (30))\n    set [particles: yv v] to (pick random (5) to (80))\n    go to (sprite3 v)\n    repeat until <touching (_edge_ v)?>\n        turn right (Turn) degrees\n        change x by (Xv)\n        change y by (Particles: Yv)\n        change [particles: yv v] by (-1)\n    end\n    delete this clone\nend\n\ndefine Clone\nrepeat (50)\n    set [clone mode v] to [1]\n    create clone of (_myself_ v)\nend\n\n