White place｜A platformer
@Stage\n\nwhen flag clicked\nhide variable [your time v]\nset [your time v] to [0]\nset [bgm volume v] to [100]\nhide variable [number of clicks on the "skip" button v]\nset [number of clicks on the "skip" button v] to [0]\nset volume to (BGm volume) %\nset [level v] to [1]\nswitch backdrop to (backdrop1 v)\nwait until <(timer) > [6]>\nswitch backdrop to (backdrop2 v)\nbroadcast (Intro end v)\n\nwhen I receive [start v]\nswitch backdrop to (backdrop3 v)\n\nwhen I receive [back v]\nswitch backdrop to (backdrop2 v)\n\nwhen I receive [credits v]\nswitch backdrop to (backdrop4 v)\n\nwhen I receive [bgm on v]\nset [bgm volume v] to [0]\nset volume to (BGm volume) %\n\nwhen I receive [bgm off v]\nset [bgm volume v] to [100]\nset volume to (BGm volume) %\n\nwhen I receive [start v]\nreset timer\nwait until <(level) = [20]>\nset [your time v] to (timer)\nif <(your time) = (your time)> then\n    set [☁ your time v] to (your time)\n    set [☁ number of clicks on the "skip" button v] to (number of clicks on the "Skip" button)\nend\nshow (your time)\n\ndefine show (record)\nset [your time v] to (join (record) [ second])\nshow variable [number of clicks on the "skip" button v]\nshow variable [your time v]\n\nwhen I receive [skip v]\nchange [number of clicks on the "skip" button v] by (1)\nif <(level) < [20]> then\n    change [level v] by (1)\n    broadcast (next v)\n    broadcast (reset v)\nend\n\nwhen I receive [intro end v]\nhide variable [your time v]\nset [your time v] to [0]\nset [bgm volume v] to [100]\nhide variable [number of clicks on the "skip" button v]\nset [number of clicks on the "skip" button v] to [0]\nset volume to (BGm volume) %\nset [level v] to [1]\nswitch backdrop to (backdrop2 v)\nstop [other scripts in sprite v]\nforever\n    play sound [Tobu Itro - Sunburst \[NCS Release\] v] until done\nend\n\n@Platforming Script\n\nwhen I receive [next v]\nerase all\ndelete this clone\n\ndefine Side Collsion\nif <<touching (ground and wall v)?> or <<touching (botton v)?> or <touching color (#81b1f6)?>>> then\n    change y by (1)\n    if <<touching (ground and wall v)?> or <<touching (botton v)?> or <touching color (#81b1f6)?>>> then\n        change y by (1)\n        if <<touching (ground and wall v)?> or <<touching (botton v)?> or <touching color (#81b1f6)?>>> then\n            change y by (1)\n            if <<touching (ground and wall v)?> or <<touching (botton v)?> or <touching color (#81b1f6)?>>> then\n                change y by (1)\n                if <<touching (ground and wall v)?> or <<touching (botton v)?> or <touching color (#81b1f6)?>>> then\n                    change y by (1)\n                    if <<touching (ground and wall v)?> or <<touching (botton v)?> or <touching color (#81b1f6)?>>> then\n                        change x by ((Change in x) * (-1))\n                        change y by (-5)\n                        if <<<<key (w v) pressed?> or <key (up arrow v) pressed?>> or <(.JSP_Jump?) = [1]>> and <not <touching (spikes v)?>>> then\n                            if <(Change in x) > [0]> then\n                                set [change in x v] to [-5]\n                            else\n                                set [change in x v] to [5]\n                            end\n                            set [change in y v] to [10]\n                        else\n                            set [change in x v] to [0]\n                        end\n                    end\n                end\n            end\n        end\n    end\nend\n\ndefine Gravity\nchange [change in y v] by (-1)\nchange y by (change in y)\nif <<touching (ground and wall v)?> or <<touching (botton v)?> or <touching color (#81b1f6)?>>> then\n    change y by ((-1) * (change in y))\n    set [change in y v] to [0]\nend\nchange y by (-1)\nif <<<touching (ground and wall v)?> or <<touching (botton v)?> or <touching color (#81b1f6)?>>> and <not <touching (spikes v)?>>> then\n    if <<<key (w v) pressed?> or <key (up arrow v) pressed?>> or <(.JSP_Jump?) = [1]>> then\n        set [change in y v] to [15]\n    end\nend\nchange y by (1)\n\nwhen flag clicked\ngo to x: (-225) y: (-98)\nset rotation style [left-right v]\nswitch costume to (stand or walking v)\npoint in direction (90)\nset [change in y v] to [0]\nset [change in x v] to [0]\nhide\n\ndefine reset pos (level)\nclear graphic effects\nset [.jps_movex v] to [0]\nset [.jsp_movey v] to [0]\nset [change in x v] to [0]\nset [change in y v] to [0]\nif <(level) = (level)> then\n    go to x: (item (level) of [reset x v]) y: (item (level) of [reset y v])\n    point in direction (90)\nend\n\nwhen I receive [reset v]\nreset pos (level)\nerase all\ndelete this clone\n\nwhen I receive [start v]\ngo to x: (item (level) of [reset x v]) y: (item (level) of [reset y v])\nforever\n    if <(Transitions) = [n]> then\n        if <<<key (d v) pressed?> or <key (right arrow v) pressed?>> or <(.JPS_MoveX) > [0]>> then\n            change [change in x v] by (1)\n            switch costume to (stand or walking v)\n            point in direction (90)\n        end\n        if <<<key (a v) pressed?> or <key (left arrow v) pressed?>> or <(.JPS_MoveX) < [0]>> then\n            change [change in x v] by (-1)\n            switch costume to (stand or walking v)\n            point in direction (-90)\n        end\n        set [change in x v] to ((change in x) * (0.9))\n        change x by (change in x)\n        Side Collsion\n        Gravity\n        if <touching (spikes v)?> then\n            repeat (2)\n                switch costume to (hurt v)\n                repeat (4)\n                    change [ghost v] effect by (25)\n                end\n                repeat (4)\n                    change [ghost v] effect by (-25)\n                end\n            end\n            switch costume to (cube v)\n            if <<(level) > [10]> and <(level) < [13]>> then\n                create clone of (_myself_ v)\n            else\n                stamp\n            end\n            reset pos (level)\n            switch costume to (stand or walking v)\n        end\n        if <touching (crystal v)?> then\n            broadcast (next v)\n            change [level v] by (1)\n            reset pos (level)\n        end\n        if <(y position) < [-178]> then\n            switch costume to (hurt v)\n            repeat (5)\n                change y by ((2.5) - ((y position) * (0.1)))\n                change [ghost v] effect by (5)\n            end\n            repeat (15)\n                change y by (((2.5) - ((y position) * (0.1))) * (-0.5))\n                change [ghost v] effect by (6)\n            end\n            switch costume to (stand or walking v)\n            reset pos (level)\n        end\n    end\nend\n\nwhen I receive [intro end v]\ngo to x: () y: (-99)\nshow\n\nwhen I start as a clone\nSide Collsion\nforever\n    if <not <<touching (ground and wall v)?> or <<<touching (spikes v)?> and <([costume # v] of [spikes v]) < [11]>> or <touching color (#81b1f6)?>>>> then\n        change y by (-5)\n    end\nend\n\nwhen flag clicked\nerase all\ndelete this clone\n\n@ground and wall\n\nwhen flag clicked\nset [#clone v] to [0]\nswitch costume to (1 v)\nhide\n\nwhen I receive [start v]\nstop [other scripts in sprite v]\ngo to x: () y: ()\nswitch costume to (1 v)\nshow\nforever\n    if <(backdrop [number v]) = [3]> then\n        go to [back v] layer\n        go [forward v] (1) layers\n        switch costume to (level)\n    end\nend\n\nwhen I receive [intro end v]\nset [#clone v] to [1]\ncreate clone of (_myself_ v)\nset [#clone v] to [2]\ncreate clone of (_myself_ v)\n\nwhen I start as a clone\nswitch costume to (1 v)\nshow\nif <(#clone) = [1]> then\n    move the gound1 []\nend\nif <(#clone) = [2]> then\n    move the gound2 [-469]\nend\n\ndefine move the gound2 (x2)\nset x to (x2)\nforever\n    change x by (-5)\n    if <(x position) < [-469]> then\n        set x to (469)\n    end\nend\n\ndefine move the gound1 (x1)\nset x to (x1)\nforever\n    change x by (-5)\n    if <(x position) < [-469]> then\n        set x to (469)\n    end\nend\n\n@Spikes\n\nwhen flag clicked\nswitch costume to (1 v)\nhide\n\nwhen I receive [start v]\nshow\nforever\n    go to [back v] layer\n    switch costume to (level)\n    if <<(level) = [11]> and <(Transitions) = [n]>> then\n        glide (1) secs to x: (60) y: (-50)\n        glide (1) secs to x: (-60) y: (-50)\n    else\n        if <<(level) = [12]> and <(Transitions) = [n]>> then\n            glide (1) secs to x: (135) y: (20)\n            glide (1) secs to x: (135) y: (-80)\n        else\n            go to x: (0) y: (0)\n        end\n    end\nend\n\nwhen I receive [next v]\nwait until <(level) = [11]>\nrepeat until <<(Transitions) = [n]> and <<(x position) = [-60]> and <(y position) = [-50]>>>\n    go to x: (-60) y: (-50)\nend\n\nwhen I receive [next v]\nwait until <(level) = [12]>\nrepeat until <<(Transitions) = [n]> and <<(x position) = [135]> and <(y position) = [-80]>>>\n    go to x: (135) y: (-80)\nend\n\nwhen I receive [next v]\nwait until <(level) = [13]>\nrepeat until <<(Transitions) = [n]> and <<(x position) = [0]> and <(y position) = [0]>>>\n    go to x: (0) y: (0)\nend\n\n@botton\n\nwhen this sprite clicked\nif <(costume [name v]) = (costume [name v])> then\n    set [brightness v] effect to (-20)\n    broadcast (costume [name v])\n    stop [this script v]\nend\n\nwhen flag clicked\nhide\nbutton [start]\nbutton [credits]\nbutton [back]\nbutton [reset]\nbutton [bgm on]\nbutton [skip]\n\nwhen [r v] key pressed\nif <(backdrop [number v]) = [3]> then\n    broadcast (reset v)\n    stop [this script v]\nend\n\ndefine button (text)\nswitch costume to (text)\ncreate clone of (_myself_ v)\nswitch costume to ( v)\n\nwhen I start as a clone\nif <(costume [name v]) = [start]> then\n    forever\n        if <(backdrop [number v]) = [2]> then\n            float [15] pos []\n            go to [back v] layer\n            show\n        else\n            hide\n        end\n    end\nend\nif <(costume [name v]) = [credits]> then\n    forever\n        if <(backdrop [number v]) = [2]> then\n            float [-30] pos []\n            go to [back v] layer\n            show\n        else\n            hide\n        end\n    end\nend\nif <(costume [name v]) = [back]> then\n    forever\n        if <(backdrop [number v]) = [4]> then\n            go to x: (190) y: (155)\n            go to [back v] layer\n            show\n        else\n            hide\n        end\n    end\nend\nif <(costume [name v]) = [reset]> then\n    forever\n        if <(backdrop [number v]) = [3]> then\n            set size to (40) %\n            swing (item (level) of [button x v]) (item (level) of [button y v])\n            switch costume to (reset v)\n            show\n        else\n            hide\n        end\n    end\nend\nif <(costume [name v]) = [bgm on]> then\n    forever\n        if <<(backdrop [number v]) = [2]> or <(backdrop [number v]) = [3]>> then\n            set size to (40) %\n            float [-150] pos [-210]\n            show\n            if <(BGm volume) = [100]> then\n                switch costume to (bgm on v)\n            else\n                if <(BGm volume) = [0]> then\n                    switch costume to (bgm off v)\n                end\n            end\n        else\n            hide\n        end\n    end\nend\nif <(costume [name v]) = [skip]> then\n    forever\n        if <<(backdrop [number v]) = [3]> and <(level) < [20]>> then\n            go to x: (item (level) of [skip x v]) y: (item (level) of [skip y v])\n            set size to (100) %\n            show\n        else\n            hide\n        end\n    end\nend\n\nwhen I start as a clone\nset [#swing v] to [0]\nset [#float v] to [0]\nset size to (100) %\nforever\n    if <touching (mouse-pointer v)?> then\n        change size by (((120) - (size)) * (0.1))\n        set [brightness v] effect to (20)\n    else\n        change size by (((100) - (size)) * (0.1))\n        set [brightness v] effect to (0)\n    end\nend\n\ndefine float (y) pos (x)\ngo to x: (x) y: (y)\nchange y by ((((([sin v] of (#float) ) * (10)) + (y)) - (y)) * (1))\nchange [#float v] by (3)\n\ndefine swing (x) (y)\ngo to x: ((([sin v] of (#swing) ) * (10)) + (x)) y: (y)\nchange [#swing v] by (3)\n\n@PlatformerJoyStick\n\nwhen flag clicked\nhide\ndelete this clone\n\nwhen I start as a clone\nset [ghost v] effect to (40)\ngo to [front v] layer\nswitch costume to (js_stick v)\nrepeat until <not <mouse down?>>\n    go to (platformerjoystick v)\n    set [ø:jsp_difx v] to ((mouse x) - ([x position v] of [platformerjoystick v]))\n    set [ø:jsp_dify v] to ((mouse y) - ([y position v] of [platformerjoystick v]))\n    set [.jps_movex v] to (Ø:JSP_DifX)\n    set [.jsp_movey v] to (Ø:JSP_DifY)\n    if <(Ø:JSP_DifX) > (Ø:JSP_Max*)> then\n        set [.jps_movex v] to (Ø:JSP_Max*)\n    end\n    if <(Ø:JSP_DifX) < ((Ø:JSP_Max*) * (-1))> then\n        set [.jps_movex v] to ((Ø:JSP_Max*) * (-1))\n    end\n    if <(Ø:JSP_DifY) > (Ø:JSP_Max*)> then\n        set [.jsp_movey v] to (Ø:JSP_Max*)\n    end\n    if <(Ø:JSP_DifY) < ((Ø:JSP_Max*) * (-1))> then\n        set [.jsp_movey v] to ((Ø:JSP_Max*) * (-1))\n    end\n    go to x: ((x position) + (.JPS_MoveX)) y: ((y position) + (.JSP_MoveY))\n    if <((.JSP_MoveY) / (Ø:JSP_Max*)) > ((Ø:JSP_JumpDZ) - (0.01))> then\n        set [.jsp_jump? v] to [1]\n        set [brightness v] effect to (20)\n    else\n        set [.jsp_jump? v] to [0]\n        set [brightness v] effect to (0)\n    end\n    set [.jps_movex v] to (((.JPS_MoveX) / (Ø:JSP_Max*)) * (Ø:JSP_Max))\n    set [.jsp_movey v] to (((.JSP_MoveY) / (Ø:JSP_Max*)) * (Ø:JSP_Max))\nend\nset [.jps_movex v] to [0]\nset [.jsp_movey v] to [0]\nset [.jsp_jump? v] to [0]\ndelete this clone\n\ndefine JSP | Size: (size) Max Movement Speed (max) Jump deadzone: (jdz)\nset rotation style [don't rotate v]\nswitch costume to (js_base v)\nset [ghost v] effect to (40)\nset size to (((size) * (500)) + (1000)) %\nset [ø:jsp_max v] to (max)\nset [ø:jsp_max* v] to ((size) / (100))\nset [ø:jsp_jumpdz v] to (jdz)\nforever\n    wait until <mouse down?>\n    show\n    go to [front v] layer\n    go to (mouse-pointer v)\n    create clone of (_myself_ v)\n    wait until <not <mouse down?>>\n    hide\nend\n\nwhen I receive [start v]\nwait (0.1) seconds\nJSP | Size: [2] Max Movement Speed [5] Jump deadzone: [1]\n\n@text\n\nwhen flag clicked\nswitch costume to (1 v)\nhide\n\nwhen I receive [start v]\nshow\nrepeat until <(level) > [4]>\n    go to [back v] layer\n    go [forward v] (3) layers\n    switch costume to (level)\nend\nhide\n\n@cover\n\nwhen flag clicked\n\ngo to [front v] layer\nset [ghost v] effect to (100)\nshow\n\n@Spriteffect\n\nwhen I start as a clone\nset rotation style [all around v]\nset [color v] effect to (-10)\nset [brightness v] effect to (10)\ngo to [back v] layer\nset size to (80) %\nshow\nrepeat until <(size) < [20]>\n    switch costume to (costume1 v)\n    if <([direction v] of [platforming script v]) = [90]> then\n        turn left (15) degrees\n    else\n        if <([direction v] of [platforming script v]) = [-90]> then\n            turn right (15) degrees\n        end\n    end\n    change size by (-5)\nend\ndelete this clone\n\nwhen flag clicked\nhide\nforever\n    go to (platforming script v)\nend\n\nwhen I receive [start v]\nforever\n    wait (0.2) seconds\n    create clone of (spriteffect v)\nend\n\n@Crystal\n\nwhen flag clicked\nhide\n\nwhen I receive [start v]\nswitch costume to (light v)\ncreate clone of (_myself_ v)\nswitch costume to (crystal v)\nforever\n    if <not <(level) = [20]>> then\n        go to x: (item (level) of [crystal x v]) y: (item (level) of [crystal y v])\n        go to [back v] layer\n        go [forward v] (1) layers\n        set size to (60) %\n        show\n    else\n        hide\n        stop [other scripts in sprite v]\n        stop [this script v]\n    end\nend\n\nwhen I start as a clone\nforever\n    if <not <(level) = [20]>> then\n        set size to (50) %\n        switch costume to (light v)\n        go to x: (item (level) of [crystal x v]) y: (item (level) of [crystal y v])\n        go to [back v] layer\n        show\n        turn right (1) degrees\n    else\n        hide\n        delete this clone\n    end\nend\n\n@intro\n\nwhen flag clicked\nif <(intro?) = [0]> then\n    set [intro? v] to [1]\n    reset timer\n    start sound [Intro Song v]\n    switch costume to (color ball1 v)\n    hide\n    repeat (5)\n        slide down [0.2]\n    end\n    wait until <(timer) > [3]>\n    switch costume to (name v)\n    create clone of (_myself_ v)\n    wait until <(timer) > [3.5]>\n    switch costume to (color ball1 v)\n    repeat (40)\n        create clone of (_myself_ v)\n    end\nelse\n    broadcast (Intro end v)\nend\n\nwhen I start as a clone\nif <(costume [number v]) < [6]> then\n    show\n    go to x: (0) y: (500)\n    repeat until <(round (y position)) = [0]>\n        change y by (((0) - (y position)) / (10))\n    end\n    slide up [0.1] (costume [number v])\nend\n\ndefine slide down (sec)\nwait (sec) seconds\nnext costume\ncreate clone of (_myself_ v)\nhide\n\ndefine slide up (sec) (costume num)\nif <(costume [number v]) = (costume num)> then\n    wait until <(timer) > [6]>\n    wait ((sec) * (costume num)) seconds\n    repeat until <(round (y position)) = [500]>\n        change y by (((500) - (y position)) / (8))\n        change [ghost v] effect by (10)\n        go to [front v] layer\n    end\nend\n\nwhen I receive [start v]\nwait until <(timer) > [9]>\nstop [other scripts in sprite v]\ndelete this clone\n\nwhen I start as a clone\nif <(costume [number v]) = [6]> then\n    go to x: (0) y: (0)\n    set rotation style [all around v]\n    show\n    set size to (5) %\n    repeat (50)\n        change size by (((100) - (size)) / (5))\n        go to [front v] layer\n        point in direction ((90) + (([sin v] of ((timer) * (400)) ) * (5)))\n    end\n    wait until <(timer) > [5]>\n    repeat (50)\n        change size by (((5) - (size)) / (5))\n        change [ghost v] effect by (5)\n        turn right (15) degrees\n    end\n    go to [back v] layer\n    hide\nend\nif <(costume [number v]) = [7]> then\n    set size to (pick random (40) to (100)) %\n    set [color v] effect to (pick random (0) to (25))\n    set [brightness v] effect to (20)\n    go to x: (pick random (-5) to (5)) y: (pick random (-5) to (5))\n    point in direction (pick random (-180) to (180))\n    set [#g v] to (pick random (20) to (40))\n    go to [front v] layer\n    go [backward v] (1) layers\n    show\n    repeat until <(y position) < [-170]>\n        move (#g) steps\n        set [#g v] to ((#g) * (0.992))\n    end\n    delete this clone\nend\n\nwhen I start as a clone\nforever\n    if <(costume [number v]) = [7]> then\n        if <touching (_edge_ v)?> then\n            delete this clone\n        end\n    end\nend\n\n@title\n\nwhen flag clicked\nhide\n\nwhen I receive [intro end v]\ngo to [back v] layer\nset [#i v] to [0]\nforever\n    if <(backdrop [number v]) = [2]> then\n        change [#i v] by (6)\n        set y to (([cos v] of (#i) ) * (10))\n        point in direction ((([cos v] of ((#i) * (1.2)) ) * (5)) + (90))\n        set size to ((((1000) - (size)) * (0.1)) - (([cos v] of ((timer) * (100)) ) * (10))) %\n        show\n    else\n        hide\n    end\nend\n\nwhen I receive [start v]\nhide\n\nwhen I receive [start v]\nstop [other scripts in sprite v]\nhide\n\n@Snow\n\nwhen I start as a clone\ngo to x: (pick random (-240) to (240)) y: (180)\nshow\nset size to (pick random (30) to (100)) %\nglide (pick random (2) to (4)) secs to x: (x position) y: (-180)\ndelete this clone\n\nwhen I start as a clone\nforever\n    change x by ([cos v] of (#sine) )\nend\n\nwhen I receive [intro end v]\nforever\n    change [#sine v] by (6)\n    wait (0) seconds\n    hide\nend\n\nwhen I receive [intro end v]\nset [#sine v] to [0]\nforever\n    create clone of (_myself_ v)\n    wait (pick random (0.05) to (0.09)) seconds\nend\n\n@Transitions\n\nwhen flag clicked\nset [transitions v] to [n]\nswitch costume to (1 v)\n\nwhen I receive [next v]\nshow\ngo to [front v] layer\nswitch costume to (level)\nset [transitions v] to [y]\nwait (2) seconds\nset [transitions v] to [n]\nhide\n\nwhen I receive [intro end v]\nset [transitions v] to [n]\nswitch costume to (1 v)\nhide\n\n