_-AtRacTiOn-_(platformer)

Instructions: (curated April the 10nth)\n\nThis is atraction a platformer unic in its way.\n\nArrow keys to move and (R) to reset.\n\nAvoide the spikes and........... youl see\n\nthanks to @--Yveltal-- fo the link\nFORKPHORUS LINK: \nhttps://forkphorus.github.io/app.html?id=385933554\n\nGOOD GAMING\n\n\n\n\n

@Stage\n\nwhen flag clicked\nforever\n    switch backdrop to (1 v)\nend\n\n@player\n\nwhen flag clicked\nset size to (50) %\nforever\n    if <(gravity way) = [down]> then\n        change [speed y v] by (-1)\n        change y by (SPEED Y)\n        touch ground <(SPEED Y) > [0]>\n    end\n    if <(gravity way) = [up]> then\n        change [speed y v] by (1)\n        change y by (SPEED Y)\n        touch ground <[0] > (SPEED Y)>\n    end\n    if <(gravity way) = [right]> then\n        change [speed y v] by (1)\n        change x by (SPEED Y)\n        touch ground <[0] > (SPEED Y)>\n    end\n    if <(gravity way) = [left]> then\n        change [speed y v] by (-1)\n        change x by (SPEED Y)\n        touch ground <(SPEED Y) > [0]>\n    end\nend\n\ndefine touch ground <up?>\nif <(gravity way) = [down]> then\n    change [falling? v] by (1)\n    repeat until <not <touching (level v)?>>\n        if <up?> then\n            change y by (-1)\n        else\n            set [falling? v] to [0]\n            change y by (1)\n        end\n        set [speed y v] to [0]\n    end\nend\nif <(gravity way) = [up]> then\n    change [falling? v] by (-1)\n    repeat until <not <touching (level v)?>>\n        if <up?> then\n            change y by (1)\n        else\n            set [falling? v] to [0]\n            change y by (-1)\n        end\n        set [speed y v] to [0]\n    end\nend\nif <(gravity way) = [right]> then\n    change [falling? v] by (-1)\n    repeat until <not <touching (level v)?>>\n        if <up?> then\n            change x by (1)\n        else\n            set [falling? v] to [0]\n            change x by (-1)\n        end\n        set [speed y v] to [0]\n    end\nend\nif <(gravity way) = [left]> then\n    change [falling? v] by (-1)\n    repeat until <not <touching (level v)?>>\n        if <up?> then\n            change x by (-1)\n        else\n            set [falling? v] to [0]\n            change x by (1)\n        end\n        set [speed y v] to [0]\n    end\nend\n\ndefine walk (direction) (speed)\nif <(gravity way) = [down]> then\n    point in direction (direction)\n    change x by (speed)\n    set [slope v] to [0]\n    repeat until <<(slope) = [8]> or <not <touching (level v)?>>>\n        change y by (1)\n        change [slope v] by (1)\n    end\n    if <(slope) = [8]> then\n        change x by ((0) - (speed))\n        change y by ((0) - (slope))\n    end\nend\nif <(gravity way) = [up]> then\n    point in direction (direction)\n    change x by (speed)\n    set [slope v] to [0]\n    repeat until <<(slope) = [8]> or <not <touching (level v)?>>>\n        change y by (1)\n        change [slope v] by (1)\n    end\n    if <(slope) = [8]> then\n        change x by ((0) - (speed))\n        change y by ((0) - (slope))\n    end\nend\nif <(gravity way) = [right]> then\n    point in direction (direction)\n    change y by (speed)\n    set [slope v] to [0]\n    repeat until <<(slope) = [8]> or <not <touching (level v)?>>>\n        change x by (1)\n        change [slope v] by (1)\n    end\n    if <(slope) = [8]> then\n        change y by ((0) - (speed))\n        change x by ((0) - (slope))\n    end\nend\nif <(gravity way) = [left]> then\n    point in direction (direction)\n    change y by (speed)\n    set [slope v] to [0]\n    repeat until <<(slope) = [8]> or <not <touching (level v)?>>>\n        change x by (1)\n        change [slope v] by (1)\n    end\n    if <(slope) = [8]> then\n        change y by ((0) - (speed))\n        change x by ((0) - (slope))\n    end\nend\n\nwhen flag clicked\nset size to (40) %\nforever\n    set rotation style [left-right v]\n    if <(gravity way) = [down]> then\n        if <<key (up arrow v) pressed?> and <(falling?) < [3]>> then\n            set [speed y v] to [9]\n        end\n        if <key (right arrow v) pressed?> then\n            set [slope v] to [0]\n            walk [90] [6]\n        end\n        if <key (left arrow v) pressed?> then\n            set [slope v] to [0]\n            walk [-90] [-6]\n        end\n    end\n    if <(gravity way) = [up]> then\n        if <<key (down arrow v) pressed?> and <[-3] < (falling?)>> then\n            set [speed y v] to [-9]\n        end\n        if <key (right arrow v) pressed?> then\n            set [slope v] to [0]\n            walk [90] [6]\n        end\n        if <key (left arrow v) pressed?> then\n            set [slope v] to [0]\n            walk [-90] [-6]\n        end\n    end\n    if <(gravity way) = [right]> then\n        if <<key (left arrow v) pressed?> and <[-3] < (falling?)>> then\n            set [speed y v] to [-10]\n        end\n        if <key (up arrow v) pressed?> then\n            set [slope v] to [0]\n            walk [90] [6]\n        end\n        if <key (down arrow v) pressed?> then\n            set [slope v] to [0]\n            walk [-90] [-6]\n        end\n    end\n    if <(gravity way) = [left]> then\n        if <<key (right arrow v) pressed?> and <[-3] < (falling?)>> then\n            set [speed y v] to [10]\n        end\n        if <key (up arrow v) pressed?> then\n            set [slope v] to [0]\n            walk [90] [6]\n        end\n        if <key (down arrow v) pressed?> then\n            set [slope v] to [0]\n            walk [-90] [-6]\n        end\n    end\nend\n\nwhen flag clicked\ngo to x: (0) y: (0)\nset [gravity way v] to [down]\nforever\n    if on edge, bounce\nend\n\nwhen flag clicked\nforever\n    create clone of (_myself_ v)\n    if <<touching (objects v)?> and <touching color (#00e4ff)?>> then\n        broadcast (transition. v)\n        go to x: (0) y: (0)\n        change [level v] by (1)\n    end\n    if <<touching (objects v)?> and <touching color (#ff0000)?>> then\n        set [gravity way v] to [up]\n    end\n    if <<touching (objects v)?> and <touching color (#001fff)?>> then\n        set [gravity way v] to [down]\n    end\n    if <<touching (objects v)?> and <touching color (#00ff00)?>> then\n        set [gravity way v] to [right]\n    end\n    if <<touching (objects v)?> and <touching color (#fff400)?>> then\n        set [gravity way v] to [left]\n    end\n    if <<touching (objects v)?> and <touching color (#ffffff)?>> then\n        set [gravity way v] to (item (LEVEL) of [gravity way v])\n        wait (0.09) seconds\n        go to x: (0) y: (0)\n    end\n    if <key (r v) pressed?> then\n        go to x: (0) y: (0)\n        set [gravity way v] to (item (LEVEL) of [gravity way v])\n    end\nend\n\nwhen I start as a clone\nset size to (50) %\nrepeat (20)\n    change [ghost v] effect by (10)\n    change size by (-10)\nend\ndelete this clone\n\nset [level v] to [7]\n\n@light\n\nwhen flag clicked\nhide\nset [clone number v] to [0]\nrepeat (4)\n    change [clone number v] by (1)\n    create clone of (_myself_ v)\nend\n\nwhen I start as a clone\nhide\nshow\ngo to [back v] layer\nif <(clone number) = [1]> then\n    go [forward v] (1) layers\n    forever\n        set [ghost v] effect to (60)\n        set size to ((([sin v] of ((timer) * (100)) ) * (15)) + (100)) %\n        point in direction ((([sin v] of ((timer) * (-90)) ) * (100)) + (160))\n        go to (player v)\n    end\nend\nif <(clone number) = [2]> then\n    forever\n        set [ghost v] effect to (60)\n        set size to ((([sin v] of ((timer) * (100)) ) * (25)) + (125)) %\n        point in direction ((([sin v] of ((timer) * (50)) ) * (100)) + (160))\n        go to (player v)\n    end\nend\nif <(clone number) = [3]> then\n    forever\n        set [ghost v] effect to (60)\n        set size to ((([sin v] of ((timer) * (100)) ) * (35)) + (150)) %\n        point in direction ((([sin v] of ((timer) * (-50)) ) * (100)) + (160))\n        go to (player v)\n    end\nend\nif <(clone number) = [4]> then\n    forever\n        set [ghost v] effect to (60)\n        set size to ((([sin v] of ((timer) * (100)) ) * (35)) + (175)) %\n        point in direction ((([sin v] of ((timer) * (90)) ) * (100)) + (160))\n        go to (player v)\n    end\nend\n\n@level\n\nwhen flag clicked\nset [level v] to [1]\ngo to [front v] layer\nforever\n    switch costume to (LEVEL)\nend\n\nset [level v] to [8]\n\n@objects\n\ndefine place block at X (x) Y (y) object name (object) direction (direction) (pack?) wich way X (?)\npoint in direction (direction)\ngo to x: (x) y: (y)\nswitch costume to (object)\nif <(pack?) = [pack]> then\n    repeat until <<touching (level v)?> or <touching (_edge_ v)?>>\n        create clone of (_myself_ v)\n        if <[up] = (?)> then\n            change y by (20)\n        end\n        if <[down] = (?)> then\n            change y by (-20)\n        end\n        if <[right] = (?)> then\n            change x by (20)\n        end\n        if <[left] = (?)> then\n            change x by (-20)\n        end\n    end\nelse\n    create clone of (_myself_ v)\nend\nstop [this script v]\n\nwhen flag clicked\nforever\n    show\n    if <(LEVEL) = [1]> then\n        place block at X [215] Y [122] object name [portal] direction [90] [] wich way X []\n        place block at X [-150] Y [-140] object name [up] direction [90] [] wich way X []\n        place block at X [] Y [] object name [last] direction [] [] wich way X []\n    end\n    if <(LEVEL) = [2]> then\n        place block at X [-150] Y [-140] object name [portal] direction [90] [] wich way X []\n        place block at X [-150] Y [150] object name [right] direction [90] [] wich way X []\n        place block at X [220] Y [0] object name [down] direction [90] [] wich way X []\n        place block at X [] Y [] object name [last] direction [] [] wich way X []\n    end\n    if <(LEVEL) = [3]> then\n        place block at X [-200] Y [-150] object name [portal] direction [90] [] wich way X []\n        place block at X [150] Y [-50] object name [right] direction [90] [] wich way X []\n        place block at X [60] Y [105] object name [left] direction [90] [] wich way X []\n        place block at X [] Y [] object name [last] direction [] [] wich way X []\n    end\n    if <(LEVEL) = [4]> then\n        place block at X [-82.5] Y [-100] object name [spikes] direction [0] [pack] wich way X [up]\n        place block at X [-200] Y [-100] object name [right] direction [90] [] wich way X []\n        place block at X [-200] Y [-50] object name [right] direction [90] [] wich way X []\n        place block at X [-200] Y [0] object name [right] direction [90] [] wich way X []\n        place block at X [-200] Y [50] object name [right] direction [90] [] wich way X []\n        place block at X [-200] Y [100] object name [right] direction [90] [] wich way X []\n        place block at X [-200] Y [150] object name [portal] direction [] [] wich way X []\n        place block at X [] Y [] object name [last] direction [] [] wich way X []\n    end\n    if <(LEVEL) = [5]> then\n        place block at X [-220] Y [160] object name [portal] direction [90] [] wich way X []\n        place block at X [-200] Y [80] object name [right] direction [90] [] wich way X []\n        place block at X [200] Y [-150] object name [left] direction [90] [] wich way X []\n        place block at X [-50] Y [-150] object name [up] direction [90] [] wich way X []\n        place block at X [156] Y [50] object name [spikes] direction [0] [] wich way X []\n        place block at X [156] Y [0] object name [spikes] direction [0] [] wich way X []\n        place block at X [150] Y [-150] object name [spikes] direction [90] [] wich way X []\n        place block at X [125] Y [-150] object name [spikes] direction [90] [] wich way X []\n        place block at X [] Y [] object name [last] direction [] [] wich way X []\n    end\n    if <(LEVEL) = [6]> then\n        place block at X [200] Y [20] object name [left] direction [90] [] wich way X []\n        place block at X [200] Y [-140] object name [down] direction [90] [] wich way X []\n        place block at X [-210] Y [140] object name [portal] direction [90] [] wich way X []\n        place block at X [44] Y [0] object name [spikes] direction [180] [] wich way X []\n        place block at X [93] Y [-50] object name [spikes] direction [180] [] wich way X []\n        place block at X [155] Y [-100] object name [spikes] direction [180] [] wich way X []\n        place block at X [80] Y [-146] object name [spikes] direction [90] [] wich way X []\n        place block at X [-20] Y [-146] object name [spikes] direction [90] [] wich way X []\n        place block at X [12] Y [-146] object name [spikes] direction [90] [] wich way X []\n        place block at X [] Y [] object name [last] direction [] [] wich way X []\n    end\n    if <(LEVEL) = [7]> then\n        place block at X [120] Y [-152] object name [spikes] direction [90] [] wich way X []\n        place block at X [100] Y [-152] object name [spikes] direction [90] [] wich way X []\n        place block at X [80] Y [-152] object name [spikes] direction [90] [] wich way X []\n        place block at X [60] Y [-152] object name [spikes] direction [90] [] wich way X []\n        place block at X [60] Y [-9] object name [spikes] direction [90] [] wich way X []\n        place block at X [-110] Y [-19] object name [spikes] direction [90] [] wich way X []\n        place block at X [220] Y [-150] object name [up] direction [90] [] wich way X []\n        place block at X [120] Y [157] object name [spikes] direction [-90] [pack] wich way X [left]\n        place block at X [180] Y [130] object name [spikes] direction [-90] [] wich way X []\n        place block at X [90] Y [98] object name [spikes] direction [-90] [] wich way X []\n        place block at X [40] Y [65] object name [right] direction [90] [] wich way X []\n        place block at X [-50] Y [80] object name [down] direction [90] [] wich way X []\n        place block at X [-200] Y [120] object name [portal] direction [90] [] wich way X []\n        place block at X [] Y [] object name [last] direction [] [] wich way X []\n    end\n    if <(LEVEL) = [8]> then\n        place block at X [200] Y [-145] object name [portal] direction [90] [] wich way X []\n        place block at X [30] Y [-98] object name [spikes] direction [90] [pack] wich way X [right]\n        place block at X [-50] Y [-98] object name [spikes] direction [90] [pack] wich way X [left]\n        place block at X [-100] Y [79] object name [spikes] direction [90] [] wich way X []\n        place block at X [-100] Y [52] object name [spikes] direction [-90] [] wich way X []\n        place block at X [-160] Y [10] object name [down] direction [90] [] wich way X []\n        place block at X [-65] Y [0] object name [up] direction [90] [] wich way X []\n        place block at X [-100] Y [158] object name [spikes] direction [-90] [pack] wich way X [left]\n        place block at X [100] Y [158] object name [spikes] direction [-90] [pack] wich way X [right]\n        place block at X [210] Y [130] object name [down] direction [90] [] wich way X []\n        place block at X [120] Y [80] object name [left] direction [90] [] wich way X []\n        place block at X [120] Y [-159] object name [spikes] direction [90] [] wich way X []\n        place block at X [80] Y [-159] object name [spikes] direction [90] [] wich way X []\n        place block at X [40] Y [-159] object name [spikes] direction [90] [] wich way X []\n        place block at X [220] Y [83] object name [spikes] direction [-90] [] wich way X []\n        place block at X [125] Y [51] object name [spikes] direction [-90] [pack] wich way X [left]\n        place block at X [50] Y [-27] object name [spikes] direction [-90] [] wich way X []\n        place block at X [-20] Y [-27] object name [spikes] direction [-90] [] wich way X []\n        place block at X [-198] Y [90] object name [right] direction [90] [] wich way X []\n        place block at X [] Y [] object name [last] direction [] [] wich way X []\n    end\n    if <(LEVEL) = [9]> then\n        place block at X [-200] Y [-100] object name [right] direction [90] [] wich way X []\n        place block at X [0] Y [-100] object name [up] direction [90] [] wich way X []\n        place block at X [0] Y [70] object name [down] direction [90] [] wich way X []\n        place block at X [200] Y [70] object name [left] direction [90] [] wich way X []\n        place block at X [] Y [] object name [last] direction [] [] wich way X []\n    end\nend\n\nwhen I start as a clone\nshow\ngo to [front v] layer\nif <(costume [name v]) = [portal]> then\n    forever\n        point in direction ((([sin v] of ((timer) * (50)) ) * (100)) + (200))\n        set size to ((([sin v] of ((timer) * (100)) ) * (15)) + (50)) %\n        wait (0) seconds\n        delete this clone\n    end\nelse\n    if <(costume [name v]) = [spikes]> then\n        set size to (100) %\n        wait (0) seconds\n        delete this clone\n    else\n        forever\n            set size to ((([sin v] of ((timer) * (100)) ) * (15)) + (50)) %\n            wait (0) seconds\n            delete this clone\n        end\n    end\nend\n\nset [level v] to [9]\n\n@thumbnail\n\nwhen flag clicked\ngo to x: (0) y: (0)\ngo to x: (0) y: (0)\ngo to [front v] layer\nshow\ngo to [front v] layer\nshow\ngo to [front v] layer\nforever\n    go to [front v] layer\n    show\n    go to [front v] layer\n    show\n    go to [front v] layer\n    set [ghost v] effect to (100)\nend\n\n