Classic Platformer

Instructions: Arrow key ⇒ Move\n矢印キー ⇒ 移動\nSpace ⇒ See die\nスペースキー ⇒ やられた場所を見る\nLet's see "GOAL!!"\n「GOAL!!」という文字を見つけよう！\nCat is very tough\n体力は無限です。\n\nプラットフォーマーのプログラムが曖昧で、プレイヤーが埋まりまくっていたので、練習として作成しました。また、やられたところを表示するプログラムも作成したかったので、それの練習も兼ねて作成しました。プログラムの参考に @griffpatch 様の動画を参考にしました。\nwww.youtube.com/griffpatch(Youtubeチャンネル)\nhttps://youtu.be/D16hTnDGweo(第1回)\n\n参考：任天堂様「マリオメーカー」\n↑見ただけで、やってはいません(((

@Stage\n\nwhen flag clicked\nforever\n    erase all\nend\n\n@Main Menu\n\nwhen I receive [main menu v]\nwait (0.1) seconds\nset [ghost v] effect to (100)\nshow\nrepeat (10)\n    change [ghost v] effect by (-10)\nend\nforever\n    if <touching (mouse-pointer v)?> then\n        change size by ((0.2) * ((110) - (size)))\n    else\n        change size by ((0.2) * ((100) - (size)))\n    end\nend\n\nwhen flag clicked\ngo to x: (0) y: (-100)\nhide\n\nwhen this sprite clicked\nrepeat (10)\n    change [ghost v] effect by (10)\nend\nhide\nbroadcast (Start Game v)\n\n@Text\n\nwhen I receive [game over v]\nswitch costume to (game over v)\nset [ghost v] effect to (100)\nshow\nrepeat (50)\n    change [ghost v] effect by (-2)\nend\nbroadcast (Main Menu v)\n\nwhen I receive [start game v]\nrepeat (10)\n    change [ghost v] effect by (10)\nend\nhide\n\nwhen flag clicked\nswitch costume to (title v)\nshow\n\n@LIVES\n\nwhen flag clicked\ngo to x: (-100) y: (145)\nset [ghost v] effect to (50)\nforever\n    switch costume to (LIVES)\nend\n\n@DIEマーク\n\nwhen flag clicked\nset rotation style [don't rotate v]\ndelete all of [data v]\nrepeat (10)\n    add [0] to [data v]\nend\n\ndefine Find space (x) (y) max (max)\nshow\nset [temp v] to (direction)\nset [distance v] to [1]\npoint in direction (0)\nrepeat (max)\n    repeat (16)\n        go to x: (x) y: (y)\n        move (distance) steps\n        if <not <<touching (level v)?> or <<touching (platform v)?> or <touching (dangear v)?>>>> then\n            point in direction (Temp)\n            hide\n            stop [this script v]\n        end\n        turn right (22.5) degrees\n    end\n    change [distance v] by (1)\nend\ngo to x: (x) y: (y)\npoint in direction (Temp)\nhide\n\nwhen I receive [lose life v]\nreplace item (1) of [data v] with (☁ DIE 1)\nreplace item (2) of [data v] with (☁ DIE 2)\nreplace item (3) of [data v] with (☁ DIE 3)\nreplace item (4) of [data v] with (☁ DIE 4)\nreplace item (5) of [data v] with (☁ DIE 5)\nreplace item (6) of [data v] with (☁ DIE 6)\nreplace item (7) of [data v] with (☁ DIE 7)\nreplace item (8) of [data v] with (☁ DIE 8)\nreplace item (9) of [data v] with (☁ DIE 9)\nreplace item (10) of [data v] with (☁ DIE 10)\nDIE履歴更新 ((item # of (Level #) in [level list v]) + (10)) ((round (([x position v] of [cat v]) / (54))) + (5)) ((round (([y position v] of [cat v]) / (54))) + (5))\nif <(DIE MEMO) = [0]> then\n    DIE読み込み\n    DIE生成\nend\n\ndelete all of [level list v]\nforever\n    if <not <[level list v] contains (Level #)?>> then\n        add (Level #) to [level list v]\n    end\nend\n\nset [☁ die 1 v] to [0]\nset [☁ die 2 v] to [0]\nset [☁ die 3 v] to [0]\nset [☁ die 4 v] to [0]\nset [☁ die 5 v] to [0]\nset [☁ die 6 v] to [0]\nset [☁ die 7 v] to [0]\nset [☁ die 8 v] to [0]\nset [☁ die 9 v] to [0]\nset [☁ die 10 v] to [0]\n\ndefine DIE履歴更新 (level) (x) (y)\nset [a v] to [0]\nrepeat (10)\n    change [a v] by (1)\n    set [b v] to [1]\n    repeat (((length of (item (a) of [data v])) - (1)) / (6))\n        if <(join (letter ((b) + (1)) of (item (a) of [data v])) (join (letter ((b) + (2)) of (item (a) of [data v])) (join (letter ((b) + (3)) of (item (a) of [data v])) (letter ((b) + (4)) of (item (a) of [data v]))))) = (join (level) (join (x) (y)))> then\n            set [c v] to [0]\n            set [d v] to []\n            repeat (length of (item (a) of [data v]))\n                change [c v] by (1)\n                if <<(c) = ((b) + (5))> and <(join (letter ((b) + (5)) of (item (a) of [data v])) (letter ((b) + (6)) of (item (a) of [data v]))) < [99]>> then\n                    set [e v] to ((join (letter (c) of (item (a) of [data v])) (letter ((c) + (1)) of (item (a) of [data v]))) + (1))\n                    if <(length of (e)) = [1]> then\n                        set [e v] to (join [0] (e))\n                    end\n                    set [d v] to (join (d) (e))\n                else\n                    if <not <(c) = ((b) + (6))>> then\n                        set [d v] to (join (d) (letter (c) of (item (a) of [data v])))\n                    end\n                end\n            end\n            クラウド更新 (d)\n            stop [this script v]\n        end\n        change [b v] by (6)\n    end\nend\nset [a v] to [0]\nrepeat (10)\n    change [a v] by (1)\n    if <(length of (item (a) of [data v])) < [251]> then\n        クラウド更新 (join (item (a) of [data v]) (join (level) (join (x) (join (y) [00]))))\n        stop [this script v]\n    end\nend\n\ndefine DIE生成\nset [a v] to [0]\nrepeat ((length of [die v]) / (4))\n    if <(item ((a) + (1)) of [die v]) = (Level #)> then\n        go to x: ((item ((a) + (2)) of [die v]) * (54)) y: ((item ((a) + (3)) of [die v]) * (54))\n        Find space (x position) (y position) max [80]\n        set [最大id v] to (item ((a) + (4)) of [die v])\n        set [id v] to [1]\n        create clone of (_myself_ v)\n    end\n    change [a v] by (4)\nend\nset [die memo v] to [1]\n\ndefine DIE読み込み\ndelete all of [die v]\nset [a v] to [0]\nrepeat (10)\n    change [a v] by (1)\n    set [b v] to [1]\n    repeat (((length of (item (a) of [data v])) - (1)) / (6))\n        add (item ((join (letter ((b) + (1)) of (item (a) of [data v])) (letter ((b) + (2)) of (item (a) of [data v]))) - (10)) of [level list v]) to [die v]\n        add ((letter ((b) + (3)) of (item (a) of [data v])) - (5)) to [die v]\n        add ((letter ((b) + (4)) of (item (a) of [data v])) - (5)) to [die v]\n        add ((join (letter ((b) + (5)) of (item (a) of [data v])) (letter ((b) + (6)) of (item (a) of [data v]))) + (1)) to [die v]\n        change [b v] by (6)\n    end\nend\n\nwhen I start as a clone\nchange y by (10)\nset [ghost v] effect to (100)\nshow\nrepeat (5)\n    change [ghost v] effect by (-20)\n    change y by (-2)\nend\nif <[1] < (ID)> then\n    delete this clone\nelse\n    repeat ((最大ID) - (1))\n        change [id v] by (1)\n        create clone of (_myself_ v)\n        wait (0.03) seconds\n    end\nend\n\nwhen I receive [begin game v]\nset [die memo v] to [0]\ndelete this clone\n\ndefine クラウド更新 (内容)\nif <(a) = [1]> then\n    set [☁ die 1 v] to (内容)\nend\nif <(a) = [2]> then\n    set [☁ die 2 v] to (内容)\nend\nif <(a) = [3]> then\n    set [☁ die 3 v] to (内容)\nend\nif <(a) = [4]> then\n    set [☁ die 4 v] to (内容)\nend\nif <(a) = [5]> then\n    set [☁ die 5 v] to (内容)\nend\nif <(a) = [6]> then\n    set [☁ die 6 v] to (内容)\nend\nif <(a) = [7]> then\n    set [☁ die 7 v] to (内容)\nend\nif <(a) = [8]> then\n    set [☁ die 8 v] to (内容)\nend\nif <(a) = [9]> then\n    set [☁ die 9 v] to (内容)\nend\nif <(a) = [10]> then\n    set [☁ die 10 v] to (内容)\nend\n\nwhen [space v] key pressed\nif <(DIE MEMO) = [0]> then\n    replace item (1) of [data v] with (☁ DIE 1)\n    replace item (2) of [data v] with (☁ DIE 2)\n    replace item (3) of [data v] with (☁ DIE 3)\n    replace item (4) of [data v] with (☁ DIE 4)\n    replace item (5) of [data v] with (☁ DIE 5)\n    replace item (6) of [data v] with (☁ DIE 6)\n    replace item (7) of [data v] with (☁ DIE 7)\n    replace item (8) of [data v] with (☁ DIE 8)\n    replace item (9) of [data v] with (☁ DIE 9)\n    replace item (10) of [data v] with (☁ DIE 10)\n    DIE読み込み\n    DIE生成\nend\n\nwhen I receive [about to change level v]\nset [die memo v] to [0]\ndelete this clone\n\n@Cat\n\nwhen flag clicked\nbroadcast (Main Menu v)\n\ndefine move (move)\nchange [falling v] by (1)\nrepeat (move)\n    set [last position v] to (x position)\n    change x by ((speed x) / (move))\n    Level touching?\n    if <(Level touching) > [0]> then\n        Move x\n    end\n    set [last position v] to (y position)\n    change y by ((speed y) / (move))\n    Level touching?\n    if <(Level touching) > [0]> then\n        Move y\n    end\nend\n\ndefine Level touching?\nset rotation style [don't rotate v]\nswitch costume to (hitbox v2 v)\ncheck\nset costume (Level touching)\n\ndefine player control\nMoved - by platform\nControl - up and down\nControl - right and left\nmove (([abs v] of (speed x) ) + ([abs v] of (speed y) ))\nif <(x position) > [235]> then\n    Next level ((Level #) + (1)) [-235] []\nend\nif <(x position) < [-235]> then\n    Next level ((Level #) + (-1)) [235] []\nend\nif <(y position) > [180]> then\n    Next level ((Level #) + (100)) [] [-160]\nend\nif <(y position) < [-180]> then\n    Next level ((Level #) + (-100)) [] [180]\nend\nif <<touching (dangear v)?> and <(INVULNERABLE) = [0]>> then\n    broadcast (Lose Life v)\nend\nset costume (Level touching)\n\nwhen I receive [begin game v]\nNext level (SPAWN LEVEL) (SPAWN X) (SPAWN Y)\nset [ghost v] effect to (0)\npoint in direction (90)\nset [speed x v] to [0]\nset [speed y v] to [0]\nset [wall slide v] to [0]\nset [jumping v] to [0]\nset [long jump v] to [0]\nbroadcast (Change level v)\nset costume (Level touching)\nwait (0.1) seconds\nset [invulnerable v] to [0]\nforever\n    player control\nend\n\ndefine Fix position (direction)\nset [temp v] to (direction)\nset [distance v] to [1]\npoint in direction (direction)\nrepeat (256)\n    Level touching?\n    if <(Level touching) < [1]> then\n        point in direction (Temp)\n        stop [this script v]\n    end\n    move (distance) steps\n    turn right (180) degrees\n    change [distance v] by (1)\nend\n\ndefine Next level (level) (x) (y)\nset [level # v] to (level)\nbroadcast (About to change level v)\nbroadcast (Change level v)\nif <(x) > []> then\n    set x to (x)\nend\nif <(y) > []> then\n    set y to (y)\nend\n\nwhen I receive [change level v]\nwait (0) seconds\nFix position [0]\nFix position [90]\n\ndefine Control - right and left\nif <(long jump) > [0]> then\n    change [long jump v] by (-1)\n    stop [this script v]\nend\nset [key-x v] to (<key (right arrow v) pressed?> - <key (left arrow v) pressed?>)\nif <(KEY-X) = [0]> then\n    if <<(falling) > [2]> and <(wall slide) < [1]>> then\n        set [speed x v] to ((speed x) * (0.98))\n        stop [this script v]\n    end\n    if <([abs v] of (speed x) ) < [1]> then\n        set [frame v] to [0]\n        set [speed x v] to [0]\n    else\n        change [frame v] by (0.5)\n    end\nelse\n    change [speed x v] by ((KEY-X) * (1.5))\n    point in direction ((KEY-X) * (90))\n    change [frame v] by (1)\nend\nset [speed x v] to ((speed x) * (0.8))\n\ndefine Control - up and down\nif <key (up arrow v) pressed?> then\n    if <<(wall slide) > [0]> and <(jumping) = [0]>> then\n        set [jumping v] to [1]\n        set [falling v] to [3]\n        set [wall slide v] to [0]\n        turn right (180) degrees\n        change [speed x v] by (((direction) / (90)) * (7))\n        set [long jump v] to [12]\n        set [jumping v] to [1]\n        set [speed y v] to [15]\n    end\n    if <<(falling) < [3]> and <(jumping) = [0]>> then\n        set [jumping v] to [1]\n        set [falling v] to [3]\n    end\n    if <<(falling) < [3]> and <<(jumping) > [0]> and <(jumping) < [6]>>> then\n        set [jumping v] to [1]\n        set [speed y v] to [15]\n    end\nelse\n    set [jumping v] to [0]\nend\nchange [speed y v] by (-1)\nif <(wall slide) > [0]> then\n    Wall slide\n    if <(speed y) < [0]> then\n        set [speed y v] to ((speed y) * (0.6))\n    end\nend\n\ndefine set costume (level touching)\nset rotation style [left-right v]\nif <(wall slide) > [0]> then\n    switch costume to (hangon01 v)\n    stop [this script v]\nend\nif <(falling) < [1]> then\n    if <(frame) > [0]> then\n        switch costume to ((1) + ([floor v] of ((frame) mod (16)) ))\n    else\n        switch costume to (hit angle 0 v)\n        repeat (5)\n            check\n            if <(Level touching) < [1]> then\n                switch costume to ((costume [number v]) + (5))\n                set [level touching v] to (level touching)\n                stop [this script v]\n            end\n            next costume\n        end\n        switch costume to (stand v)\n        set [level touching v] to (level touching)\n    end\nelse\n    if <(speed y) > [0]> then\n        switch costume to (jump01 v)\n    else\n        switch costume to (run_j2 v)\n    end\nend\n\ndefine Move x\nWall slide\nchange y by (1)\nLevel touching?\nif <(Level touching) > [0]> then\n    change y by (1)\n    Level touching?\n    if <(Level touching) > [0]> then\n        change y by (-2)\n        set [speed x v] to [0]\n        set x to (last position)\n        stop [this script v]\n    end\n    set [speed x v] to ((speed x) * (0.8))\nend\nset [speed x v] to ((speed x) * (0.95))\nSlip\n\ndefine Move y\nset y to (last position)\nif <(speed y) > [0]> then\n    set [speed y v] to [0]\n    stop [this script v]\nend\nif <(falling) > [0]> then\n    set [falling v] to [0]\n    Slip\nend\nset [speed y v] to ((speed y) * (0.8))\n\ndefine Slip\nchange y by (-2)\nchange x by (1)\nLevel touching?\nif <(Level touching) < [1]> then\n    set [falling v] to [9]\n    change [speed x v] by (1)\n    stop [this script v]\nend\nchange x by (-2)\nLevel touching?\nif <(Level touching) < [1]> then\n    set [falling v] to [9]\n    change [speed x v] by (-1)\n    stop [this script v]\nend\nchange x by (1)\nchange y by (2)\n\ndefine Wall slide\nif <(falling) < [2]> then\n    set [wall slide v] to [0]\n    stop [this script v]\nend\nswitch costume to (hitbox wallslide v)\nset rotation style [left-right v]\ncheck\nset [wall slide v] to (Level touching)\nswitch costume to (hitbox v2 v)\nset rotation style [don't rotate v]\n\nwhen I receive [lose life v]\nset [invulnerable v] to [1]\nstop [other scripts in sprite v]\nstart sound [Oops v]\nrepeat (10)\n    change [ghost v] effect by (10)\nend\nwait (3) seconds\nchange [lives v] by (-1)\nif <(LIVES) > [-99999]> then\n    set [ghost v] effect to (0)\n    broadcast (Begin game v)\nelse\n    broadcast (Game Over v)\nend\n\ndefine check\nif <<touching (level v)?> or <touching (platform v)?>> then\n    set [level touching v] to [1]\nelse\n    set [level touching v] to [0]\nend\n\ndefine Moved - by platform\nbroadcast (check platform moving v)\nchange x by (PLATFORM DX)\nchange y by (PLATFORM DY)\nset [platform dx v] to []\nset [platform dy v] to []\nLevel touching?\nif <(Level touching) > [0]> then\n    Find space (x position) (y position) max [12]\n    if <<(Level touching) > [0]> and <(INVULNERABLE) = [0]>> then\n        broadcast (Lose Life v)\n    end\nend\n\ndefine Find space (x) (y) max (max)\nset [temp v] to (direction)\nset [distance v] to [1]\npoint in direction (0)\nrepeat (max)\n    repeat (16)\n        go to x: (x) y: (y)\n        move (distance) steps\n        Level touching?\n        if <(Level touching) < [1]> then\n            point in direction (Temp)\n            stop [this script v]\n        end\n        turn right (22.5) degrees\n    end\n    change [distance v] by (1)\nend\ngo to x: (x) y: (y)\npoint in direction (Temp)\n\nwhen I receive [start game v]\nset [spawn x v] to [-150]\nset [spawn y v] to [-50]\nset [spawn level v] to [1]\nset [lives v] to [5]\nbroadcast (Setup v) and wait\nbroadcast (Begin game v)\n\nwhen I receive [player - bounce v]\nset [speed y v] to [10]\n\n@Enemy\n\nwhen flag clicked\nhide\n\nwhen I start as a clone\nshow\nset [frame v] to [0]\nset [die v] to [0]\nforever\n    change [frame v] by (0.3)\n    switch costume to (red1 v)\n    Move - Left or Right\n    Move - Down\n    switch costume to (join [Red] ((([floor v] of (frame) ) mod (4)) + (1)))\n    if <(DIE) = [1]> then\n        add (ID) to [killed v]\n        switch costume to (red squish v)\n        wait (0.3) seconds\n        repeat (10)\n            change [ghost v] effect by (10)\n        end\n        delete this clone\n    end\n    if <<touching (cat v)?> and <(INVULNERABLE) = [0]>> then\n        if <([speed y v] of [cat v]) < [-3]> then\n            broadcast (Player - Bounce v)\n            start sound [Squish Pop v]\n            add (ID) to [killed v]\n            switch costume to (red squish v)\n            wait (0.3) seconds\n            repeat (10)\n                change [ghost v] effect by (10)\n            end\n            delete this clone\n        end\n        broadcast (Lose Life v)\n    end\nend\n\nwhen I receive [change level v]\nwait (0.1) seconds\nset [id v] to [0]\nPut enemy [100] [-10] [-90] [1]\nPut enemy [17] [-70] [90] [103]\nPut enemy [37] [-90] [90] [102]\nPut enemy [14] [-122] [-90] [203]\nPut enemy [135] [50] [-90] [204]\nPut enemy [-150] [-125] [-90] [4]\nPut enemy [140] [-125] [-90] [6]\n\nwhen I receive [about to change level v]\ndelete this clone\n\ndefine Move - Down\nchange [speed y v] by (-1)\nchange y by (speed y)\nrepeat until <not <touching (level v)?>>\n    change y by (1)\n    set [speed y v] to [0]\nend\n\ndefine Move - Left or Right\nmove (2) steps\nchange y by (-30)\nif <<touching (level v)?> or <<touching (platform v)?> or <touching (_edge_ v)?>>> then\n    move (30) steps\n    if <<touching (_edge_ v)?> or <not <<touching (level v)?> or <touching (platform v)?>>>> then\n        move (-32) steps\n        turn right (180) degrees\n        change y by (-4)\n        stop [this script v]\n    end\n    move (-30) steps\nend\nchange y by (30)\nrepeat (4)\n    if <not <<touching (level v)?> or <<touching (platform v)?> or <touching (_edge_ v)?>>>> then\n        stop [this script v]\n    end\n    change y by (1)\nend\nmove (-2) steps\nturn right (180) degrees\nchange y by (-4)\nmove (2) steps\nif <touching (platform v)?> then\n    set [die v] to [1]\nend\nmove (-2) steps\n\nwhen I receive [setup v]\ndelete all of [killed v]\n\ndefine Put enemy (x) (y) (direction) (level)\nchange [id v] by (1)\nif <(Level #) = (level)> then\n    if <not <[killed v] contains (ID)?>> then\n        go to x: (x) y: (y)\n        point in direction (direction)\n        create clone of (_myself_ v)\n    end\nend\n\nshow\nforever\n    if <not <key (space v) pressed?>> then\n        go to (mouse-pointer v)\n    end\nend\n\n@Level\n\nwhen flag clicked\ngo to x: (0) y: (0)\n\nwhen I receive [change level v]\nChange level\nforever\n    Stamp side line and shadow\nend\n\ndefine Change level\nswitch costume to (join [Level] (Level #))\n\ndefine Stamp side line and shadow\nset rotation style [don't rotate v]\nset [brightness v] effect to (-100)\nrepeat (8)\n    move (3) steps\n    stamp\n    move (-3) steps\n    turn right (45) degrees\nend\nset [brightness v] effect to (-100)\nset [ghost v] effect to (80)\nchange y by (-20)\nstamp\nchange y by (20)\nset [brightness v] effect to (0)\nset [ghost v] effect to (0)\n\n@Item\n\nwhen I receive [change level v]\nif <(Level #) = (my level)> then\n    show\nelse\n    hide\nend\n\nwhen I start as a clone\nif <(costume [name v]) = [flag0]> then\n    forever\n        if <(Level #) = (my level)> then\n            if <<(SPAWN LEVEL) = (my level)> and <<(SPAWN X) = (x position)> and <(SPAWN Y) = (y position)>>> then\n                switch costume to (flag1 v)\n            else\n                wait until <touching (cat v)?>\n                start sound [Coin v]\n                if <<(LIVES) < [5]> and <(costume [name v]) = [flag0]>> then\n                    change [lives v] by (1)\n                end\n                set [spawn level v] to (Level #)\n                set [spawn x v] to (x position)\n                set [spawn y v] to (y position)\n                switch costume to (flag1 v)\n            end\n        end\n    end\nelse\n    repeat until <touching (cat v)?>\n        change y by ((0.5) * ([sin v] of ((timer) * (180)) ))\n    end\n    set [my level v] to []\n    if <(costume [name v]) = [apple]> then\n        start sound [Chomp v]\n        change [apple v] by (1)\n    else\n        start sound [Collect v]\n        add (key ID) to [colected v]\n    end\n    repeat (20)\n        change y by (2)\n        change [ghost v] effect by (5)\n    end\n    delete this clone\nend\n\nwhen I receive [setup v]\nhide\ndelete all of [colected v]\nset [apple v] to [0]\nswitch costume to (apple v)\nSet item [-65] [-75] [1] [2]\nSet item [25] [150] [3] [3]\nSet item [84] [-140] [103] [3]\nSet item [-156] [-86] [102] [1]\nSet item [-170] [50] [101] [2]\nswitch costume to (key v)\nset [key id v] to [3]\nSet item [-170] [-95] [101] [1]\nset [key id v] to [104]\nSet item [-94] [36] [104] [1]\nswitch costume to (flag0 v)\nSet item [155] [-8] [3] [1]\nSet item [-100] [-112] [201] [1]\nSet item [-206] [-45] [203] [1]\nSet item [-180] [-114] [4] [1]\nSet item [-115] [-115] [106] [1]\nSet item [-160] [-104] [506] [1]\nSet item [140] [-127] [606] [1]\n\ndefine Set item (x) (y) (level) (repeat)\nset [my level v] to (level)\ngo to x: (x) y: (y)\nrepeat (repeat)\n    create clone of (_myself_ v)\n    change x by (45)\nend\nset [my level v] to []\n\nshow\nforever\n    if <not <key (space v) pressed?>> then\n        go to (mouse-pointer v)\n    end\nend\n\nwhen I receive [start game v]\ndelete this clone\n\n@Platform\n\nwhen I receive [change level v]\nswitch costume to (brank v)\nswitch costume to (join (Level #) [-])\nif <<(Level #) = [4]> or <(Level #) = [506]>> then\n    switch costume to (join (Level #) [-1])\n    create clone of (_myself_ v)\n    next costume\n    create clone of (_myself_ v)\nend\nif <(Level #) = [5]> then\n    go to x: (-160) y: (0)\n    switch costume to (5- v)\n    repeat (10)\n        create clone of (_myself_ v)\n        change x by (29)\n    end\nend\nif <not <(costume [name v]) = [brank]>> then\n    create clone of (_myself_ v)\nend\n\nwhen I receive [check platform moving v]\nTick (x position) (y position) (Level #)\nset [last x v] to (x position)\nset [last y v] to (y position)\nset [last level v] to (Level #)\n\ndefine Tick (new x) (new y) (level)\nif <(level) = (last level)> then\n    if <(Turn) > []> then\n        change y by (4)\n        if <touching (cat v)?> then\n            set [dx v] to (([x position v] of [cat v]) - (last x))\n            set [dy v] to (([y position v] of [cat v]) - (last y))\n            set [sin v] to ([sin v] of ((0) - (Turn)) )\n            set [cos v] to ([cos v] of ((0) - (Turn)) )\n            set [platform dx v] to ((((dx) * (cos)) - ((dy) * (sin))) - (dx))\n            set [platform dy v] to ((((dx) * (sin)) + ((dy) * (cos))) - (dy))\n        end\n    else\n        if <(new y) > (last y)> then\n            change y by (1)\n        else\n            set y to ((last y) + (1))\n        end\n        if <touching (cat v)?> then\n            set [platform dx v] to ((new x) - (last x))\n            set [platform dy v] to ((new y) - (last y))\n        end\n    end\n    go to x: (new x) y: (new y)\nend\n\ndefine Stamp side line and shadow\nset [brightness v] effect to (-100)\nset [temp v] to [0]\nrepeat (8)\n    change x by (([sin v] of (Temp) ) * (3))\n    change y by (([cos v] of (Temp) ) * (3))\n    stamp\n    change x by (([sin v] of (Temp) ) * (-3))\n    change y by (([cos v] of (Temp) ) * (-3))\n    change [temp v] by (45)\nend\nset [brightness v] effect to (-100)\nset [ghost v] effect to (80)\nchange y by (-20)\nstamp\nchange y by (20)\nset [brightness v] effect to (0)\nset [ghost v] effect to (0)\n\ndefine move (speed) (repeat) (time) (direction)\nrepeat (repeat)\n    if <(direction) = [x]> then\n        change x by (speed)\n    end\n    if <(direction) = [y]> then\n        change y by (speed)\n    end\nend\nwait (time) seconds\n\nwhen I start as a clone\nforever\n    Stamp side line and shadow\nend\n\nwhen I start as a clone\nset [turn v] to []\nif <(costume [name v]) = [3-]> then\n    go to x: (-163) y: (-40)\n    point in direction (90)\n    show\n    forever\n        wait until <touching (cat v)?>\n        if <[colected v] contains (Level #)?> then\n            move [4] [23] [1] [y]\n            move [-4] [23] [1] [y]\n        else\n            start sound [Low Squeak v]\n        end\n        wait until <not <touching (cat v)?>>\n    end\nend\nif <(costume [name v]) = [4-1]> then\n    go to x: (0) y: (-147)\n    point in direction (90)\n    show\n    set [turn v] to [-4]\n    forever\n        turn left (4) degrees\n    end\nend\nif <(costume [name v]) = [4-2]> then\n    go to x: (170) y: (180)\n    point in direction (90)\n    show\n    forever\n        move [-26] [10] [2] [y]\n        move [4] [65] [1] [y]\n    end\nend\nif <(costume [name v]) = [104-]> then\n    go to x: (141) y: (-53)\n    point in direction (90)\n    show\n    forever\n        wait until <touching (cat v)?>\n        if <[colected v] contains (Level #)?> then\n            move [4] [35] [1] [y]\n            move [-4] [35] [1] [y]\n        else\n            start sound [Low Squeak v]\n        end\n        wait until <not <touching (cat v)?>>\n    end\nend\nif <(costume [name v]) = [201-]> then\n    go to x: (40) y: (-88)\n    point in direction (90)\n    show\n    forever\n        move [2] [78] [1] [x]\n        move [-2] [78] [1] [x]\n    end\nend\nif <(costume [name v]) = [202-]> then\n    go to x: (-184) y: (-88)\n    point in direction (90)\n    show\n    forever\n        move [2] [142] [0] [x]\n        move [-2] [142] [1.5] [x]\n    end\nend\nif <(costume [name v]) = [105-]> then\n    go to x: (120) y: (130)\n    point in direction (90)\n    show\n    forever\n        move [-3] [86] [2] [y]\n        move [3] [86] [2] [y]\n    end\nend\nif <(costume [name v]) = [205-]> then\n    go to x: (120) y: (16)\n    point in direction (90)\n    show\n    forever\n        move [-3] [80] [3] [y]\n        move [3] [80] [2] [y]\n    end\nend\nif <(costume [name v]) = [5-]> then\n    show\n    forever\n        set y to ((-50) + ((32) * ([sin v] of (((x position) * (1.5)) + ((timer) * (80))) )))\n    end\nend\nif <(costume [name v]) = [6-]> then\n    go to x: (-460) y: (85)\n    show\n    forever\n        move [20] [24] [2] [x]\n        move [-5] [96] [1] [x]\n    end\nend\nif <(costume [name v]) = [106-]> then\n    go to x: (230) y: (-90)\n    show\n    set [turn v] to [1]\n    forever\n        turn right (1) degrees\n    end\nend\nif <(costume [name v]) = [406-]> then\n    go to x: (5) y: (30)\n    show\n    set [turn v] to [2]\n    forever\n        turn right (2) degrees\n    end\nend\nif <(costume [name v]) = [506-1]> then\n    go to x: (-450) y: (70)\n    show\n    forever\n        move [25] [9] [1] [x]\n        move [-9] [25] [2] [x]\n    end\nend\nif <(costume [name v]) = [506-2]> then\n    go to x: (450) y: (70)\n    show\n    forever\n        move [-25] [9] [1] [x]\n        move [9] [25] [2] [x]\n    end\nend\n\nwhen flag clicked\nhide\n\nwhen I receive [about to change level v]\ndelete this clone\n\n@Dangear\n\nwhen flag clicked\ngo to x: (0) y: (0)\n\nwhen I receive [change level v]\nhide\nChange level\n\ndefine Change level\nswitch costume to (blank v)\nswitch costume to (join [Level] (Level #))\nset y to (0)\nshow\nif <[lava level v] contains (Level #)?> then\n    forever\n        set y to ((3) * ([sin v] of ((timer) * (180)) ))\n    end\nend\n\nwhen I receive [change level v]\nwait (0.05) seconds\nif <not <(costume [name v]) = [brank]>> then\n    forever\n        Stamp side line and shadow\n    end\nend\n\ndefine Stamp side line and shadow\nset rotation style [don't rotate v]\nset [brightness v] effect to (-100)\nrepeat (8)\n    move (3) steps\n    stamp\n    move (-3) steps\n    turn right (45) degrees\nend\nset [brightness v] effect to (-100)\nset [ghost v] effect to (80)\nchange y by (-20)\nstamp\nchange y by (20)\nset [brightness v] effect to (0)\nset [ghost v] effect to (0)\n\n