Jungle - A Scrolling Platformer
@Stage\n\n@blank\n\n@Pen\n\ndefine Print text: (text) At X: (x) Y: (y) Letter size: (letter size) Color: (r) (g) (b) (a) Pen size: (pen size) Wrap at X: (wrap x) Italics: (italic)\npen up\nset pen color to (((a) * (16777216)) + (((r) * (65536)) + (((g) * (256)) + (b))))\nset pen size to (pen size)\ngo to x: (x) y: (y)\nset [i v] to [1]\nset [temp y v] to (y)\nrepeat (length of (text))\n    switch costume to (letter (i) of (text))\n    set [current character \(encoded\) v] to (item (costume [number v]) of [default font v])\n    set [temp x v] to (x position)\n    set [j v] to [4]\n    set x to ((temp x) + (((letter (2) of (Current character \(encoded\))) - (1)) * (letter size)))\n    set y to ((temp y) + ((letter (3) of (Current character \(encoded\))) * (letter size)))\n    repeat (((length of (Current character \(encoded\))) - (3)) / (2))\n        if <(letter (j) of (Current character \(encoded\))) = [e]> then\n            point in direction (0)\n            move ((2) * (letter size)) steps\n            pen down\n            pen up\n        else\n            if <(letter (j) of (Current character \(encoded\))) = [f]> then\n                point in direction (0)\n                move ((3) * (letter size)) steps\n                pen down\n                pen up\n            else\n                if <(letter (j) of (Current character \(encoded\))) = [a]> then\n                    pen down\n                    pen up\n                    point in direction (0)\n                    move ((2) * (letter size)) steps\n                else\n                    if <(letter (j) of (Current character \(encoded\))) = [z]> then\n                        point in direction (90)\n                        move ((2) * (letter size)) steps\n                    else\n                        pen down\n                        point in direction ((letter (j) of (Current character \(encoded\))) * (45))\n                        if <(((direction) + (90)) mod (180)) > [0]> then\n                            if <((direction) mod (180)) > [0]> then\n                                turn right ((italic) / (2)) degrees\n                            else\n                                turn right (italic) degrees\n                            end\n                        end\n                        if <(letter ((j) + (1)) of (Current character \(encoded\))) = [0]> then\n                            move ((1.41) * (letter size)) steps\n                        else\n                            move ((letter ((j) + (1)) of (Current character \(encoded\))) * (letter size)) steps\n                        end\n                    end\n                end\n            end\n        end\n        change [j v] by (2)\n        pen up\n    end\n    change [i v] by (1)\n    set y to (temp y)\n    set x to ((temp x) + ((letter (1) of (Current character \(encoded\))) * (letter size)))\n    if <(costume [number v]) = [65]> then\n        set [current character \(encoded\) v] to [0]\n        set [j v] to (i)\n        repeat until <<(letter (j) of (text)) = [ ]> or <(j) > (length of (text))>>\n            switch costume to (letter (j) of (text))\n            change [current character \(encoded\) v] by (letter (1) of (item (costume [number v]) of [default font v]))\n            change [j v] by (1)\n        end\n        if <((Current character \(encoded\)) + (temp x)) > ((wrap x) + (x))> then\n            change y by ((-13) * (letter size))\n            set x to (x)\n            set [temp y v] to (y position)\n        end\n    end\nend\n\ndefine init levels\ndelete all of [all level data v]\nadd [1] to [all level data v]\nadd [-100;100;-100;100;-50;-100;255;] to [all level data v]\nadd [-50;50;300;400;0;-100;255;] to [all level data v]\nadd [-50;50;600;700;100;0;255;] to [all level data v]\nadd [-300;-200;700;800;200;100;255;] to [all level data v]\nadd [-500;-400;600;700;300;200;255;] to [all level data v]\nadd [-600;-500;300;400;400;300;65280;] to [all level data v]\nadd [2] to [all level data v]\nadd [-100;100;-100;100;-50;-100;255;] to [all level data v]\nadd [-50;50;200;1000;-50;-100;255;] to [all level data v]\nadd [-100;100;300;350;100;-50;16711680;] to [all level data v]\nadd [-100;100;500;550;100;-50;16711680;] to [all level data v]\nadd [-100;100;700;750;100;-50;16711680;] to [all level data v]\nadd [-50;50;950;1000;200;-50;16711680;] to [all level data v]\nadd [-50;50;1000;1100;-50;-100;65280;] to [all level data v]\nadd [3] to [all level data v]\nadd [-100;100;-100;100;-50;-100;255;] to [all level data v]\nadd [-50;50;400;500;-50;-100;16776960;] to [all level data v]\nadd [-50;50;600;700;400;350;255;] to [all level data v]\nadd [-50;50;900;1000;500;450;16776960;] to [all level data v]\nadd [-100;100;1100;1200;900;400;16711680;] to [all level data v]\nadd [-50;50;1400;1500;500;450;65280;] to [all level data v]\nadd [4] to [all level data v]\nadd [-100;100;-100;100;-50;-100;255;] to [all level data v]\nadd [-50;50;200;300;0;-50;255;] to [all level data v]\nadd [-50;50;200;300;250;200;255;] to [all level data v]\nadd [-100;100;300;350;400;-50;16711680;] to [all level data v]\nadd [-100;-50;200;300;400;-50;16711680;] to [all level data v]\nadd [50;100;200;300;400;-50;16711680;] to [all level data v]\nadd [-50;50;400;500;350;300;255;] to [all level data v]\nadd [-150;-50;650;750;350;300;255;] to [all level data v]\nadd [-50;50;950;1050;350;300;255;] to [all level data v]\nadd [50;150;1400;1500;350;300;255;] to [all level data v]\nadd [-50;50;1800;1900;350;300;65280;] to [all level data v]\nadd [5] to [all level data v]\nadd [-100;100;-100;100;-50;-100;255;] to [all level data v]\nadd [-50;50;200;300;-50;-100;16776960;] to [all level data v]\nadd [-50;50;200;300;400;300;16776960;] to [all level data v]\nadd [-150;150;300;350;800;-1000;255;] to [all level data v]\nadd [-150;150;550;600;800;-1000;255;] to [all level data v]\nadd [-150;-100;350;550;800;-1000;255;] to [all level data v]\nadd [100;150;350;550;800;-1000;255;] to [all level data v]\nadd [-100;0;350;450;800;700;16711680;] to [all level data v]\nadd [0;100;350;450;600;500;16711680;] to [all level data v]\nadd [0;100;450;550;400;300;16711680;] to [all level data v]\nadd [-100;0;450;550;200;100;16711680;] to [all level data v]\nadd [-100;0;350;450;0;-100;16711680;] to [all level data v]\nadd [0;100;350;450;-300;-400;16711680;] to [all level data v]\nadd [-100;100;350;550;-900;-1000;65280;] to [all level data v]\nadd [6] to [all level data v]\nadd [-100;100;-100;100;-50;-100;255;] to [all level data v]\nadd [-100;100;400;600;-50;-100;16776960;] to [all level data v]\nadd [300;500;600;800;400;350;16776960;] to [all level data v]\nadd [700;900;200;400;800;750;16776960;] to [all level data v]\nadd [800;1000;-200;0;1200;1150;16776960;] to [all level data v]\nadd [875;925;-600;-550;1200;1150;65280;] to [all level data v]\nadd [7] to [all level data v]\nadd [-100;100;-100;100;-50;-100;255;] to [all level data v]\nadd [-50;50;200;450;-50;-100;255;] to [all level data v]\nadd [-150;-50;300;350;100;-50;16711680;] to [all level data v]\nadd [50;150;300;350;100;-50;16711680;] to [all level data v]\nadd [-150;150;300;350;500;100;16711680;] to [all level data v]\nadd [150;200;300;350;400;150;16711680;] to [all level data v]\nadd [-250;-50;300;350;400;300;255;] to [all level data v]\nadd [50;150;350;450;100;50;255;] to [all level data v]\nadd [100;200;700;800;100;50;16776960;] to [all level data v]\nadd [-100;0;500;600;400;350;255;] to [all level data v]\nadd [-400;-300;50;150;400;350;65280;] to [all level data v]\nadd [8] to [all level data v]\nadd [-100;100;-100;100;-50;-100;255;] to [all level data v]\nadd [-50;50;400;500;50;0;255;] to [all level data v]\nadd [-50;50;800;900;150;100;255;] to [all level data v]\nadd [-100;100;1100;1150;200;0;16711680;] to [all level data v]\nadd [-50;50;1250;1350;150;100;65280;] to [all level data v]\nadd [9] to [all level data v]\nset [i v] to ((item # of (LEVEL) in [all level data v]) + (1))\nset [temp v] to []\ndelete all of [this level data v]\nrepeat until <<(item (i) of [all level data v]) = ((LEVEL) + (1))> or <(i) > (length of [all level data v])>>\n    set [other i v] to [1]\n    repeat until <(other i) > (length of (item (i) of [all level data v]))>\n        if <(letter (other i) of (item (i) of [all level data v])) = [;]> then\n            add (temp) to [this level data v]\n            set [temp v] to []\n        else\n            set [temp v] to (join (temp) (letter (other i) of (item (i) of [all level data v])))\n        end\n        change [other i v] by (1)\n    end\n    change [i v] by (1)\nend\n\ndefine init\nset [cam x v] to [0]\nset [cam y v] to [0]\nset [cam z v] to [0]\nset [cam x rot v] to [0]\nset [cam y rot v] to [0]\nset [gravity v] to [0]\nset [jump cooldown v] to [10]\nset [x vel v] to [0]\nset [z vel v] to [0]\nerase all\nif <(LEVEL) > [8]> then\n    Print text: [YOU WON] At X: [-160] Y: [50] Letter size: [6] Color: [255] [255] [255] [0] Pen size: [10] Wrap at X: [1000] Italics: [0]\n    Print text: (join [YOUR TIME: ] (TIME)) At X: [-130] Y: [0] Letter size: [1] Color: [255] [255] [255] [0] Pen size: [2] Wrap at X: [1000] Italics: [0]\n    Print text: (join [WORLD RECORD: ] (☁ best time)) At X: [-130] Y: [-30] Letter size: [1] Color: [255] [255] [255] [0] Pen size: [2] Wrap at X: [1000] Italics: [0]\n    if <(☁ best time) > (TIME)> then\n        Print text: [You beat the record, congratulations! :D] At X: [-150] Y: [-100] Letter size: [1] Color: [255] [255] [255] [0] Pen size: [2] Wrap at X: [1000] Italics: [0]\n        set [☁ best time v] to (TIME)\n    end\n    stop [all v]\nend\ninit levels\n\nwhen flag clicked\nreset timer\nset [next second v] to [0]\nset [fps time v] to [0]\nset [time v] to [0]\nset [level v] to [1]\nbroadcast (start v)\n\ndefine Render\nset [i v] to [1]\nrepeat ((length of [to sort v]) / (2))\n    set [temp v] to (item (i) of [to sort v])\n    set pen size to ((10) - ((item ((i) + (1)) of [to sort v]) / (100)))\n    Draw Cube (item (temp) of [this level data v]) (item ((temp) + (4)) of [this level data v]) (item ((temp) + (2)) of [this level data v]) (item ((temp) + (1)) of [this level data v]) (item ((temp) + (5)) of [this level data v]) (item ((temp) + (3)) of [this level data v]) (item ((temp) + (6)) of [this level data v])\n    change [i v] by (2)\nend\n\nwhen I receive [start v]\ninit\nforever\n    erase all\n    switch costume to (epic pte v)\n    Calculate Trig Values\n    Sorting\n    Render\n    Get keys\n    Print text: (join [FPS: ] (FPS)) At X: [-220] Y: [150] Letter size: [1] Color: [255] [255] [255] [0] Pen size: [2] Wrap at X: [1000] Italics: [0]\n    Print text: (join [TIME: ] (TIME)) At X: [130] Y: [150] Letter size: [1] Color: [255] [255] [255] [0] Pen size: [2] Wrap at X: [1000] Italics: [0]\n    Print text: (join [WORLD RECORD: ] (☁ best time)) At X: [80] Y: [130] Letter size: [1] Color: [255] [255] [255] [0] Pen size: [2] Wrap at X: [1000] Italics: [0]\n    Print text: (join [LEVEL: ] (LEVEL)) At X: [-30] Y: [150] Letter size: [1] Color: [255] [255] [255] [0] Pen size: [2] Wrap at X: [1000] Italics: [0]\n    if <(timer) > (next second)> then\n        set [fps v] to (fps time)\n        change [next second v] by (1)\n        set [fps time v] to [0]\n    end\n    change [time v] by (1)\n    change [fps time v] by (1)\nend\n\ndefine Sorting\ndelete all of [to sort v]\nset [i v] to [1]\nrepeat ((length of [this level data v]) / (7))\n    add (i) to [to sort v]\n    set [x1 v] to (((item ((i) + (0)) of [this level data v]) + (item ((i) + (1)) of [this level data v])) / (2))\n    set [y1 v] to (((item ((i) + (4)) of [this level data v]) + (item ((i) + (5)) of [this level data v])) / (2))\n    set [z1 v] to (((item ((i) + (2)) of [this level data v]) + (item ((i) + (3)) of [this level data v])) / (2))\n    add ([sqrt v] of ((((cam x) - (x1)) * ((cam x) - (x1))) + ((((cam y) - (y1)) * ((cam y) - (y1))) + (((cam z) - (z1)) * ((cam z) - (z1))))) ) to [to sort v]\n    change [i v] by (7)\nend\nset [i v] to [2]\nrepeat (((length of [to sort v]) / (2)) - (1))\n    set [temp v] to (i)\n    change [i v] by (2)\n    repeat until <<(item (i) of [to sort v]) < (item (temp) of [to sort v])> or <[0] = (temp)>>\n        change [temp v] by (-2)\n    end\n    if <not <(i) = ((temp) + (2))>> then\n        insert (item (i) of [to sort v]) at ((temp) + (1)) of [to sort v] \n        delete ((i) + (1)) of [to sort v]\n        insert (item (i) of [to sort v]) at ((temp) + (1)) of [to sort v] \n        delete ((i) + (1)) of [to sort v]\n    end\nend\n\ndefine Get keys\nif <<key (w v) pressed?> or <key (z v) pressed?>> then\n    change [z vel v] by ((1) * (cos Y))\n    change [x vel v] by ((-1) * (sin Y))\nend\nif <key (s v) pressed?> then\n    change [z vel v] by ((-1) * (cos Y))\n    change [x vel v] by ((1) * (sin Y))\nend\nif <<key (a v) pressed?> or <key (q v) pressed?>> then\n    change [z vel v] by ((-1) * (sin Y))\n    change [x vel v] by ((-1) * (cos Y))\nend\nif <key (d v) pressed?> then\n    change [z vel v] by ((1) * (sin Y))\n    change [x vel v] by ((1) * (cos Y))\nend\nchange [cam z v] by (Z Vel)\nchange [cam x v] by (X Vel)\nCheck collisions sides\nset [x vel v] to ((X Vel) * (0.9))\nset [z vel v] to ((Z Vel) * (0.9))\nif <<key (space v) pressed?> and <(Jump cooldown) = [0]>> then\n    change [gravity v] by (20)\n    change [jump cooldown v] by (10)\nend\nif <key (left arrow v) pressed?> then\n    change [cam y rot v] by (5)\nend\nif <key (right arrow v) pressed?> then\n    change [cam y rot v] by (-5)\nend\nif <<key (up arrow v) pressed?> and <(Cam X Rot) < [80]>> then\n    change [cam x rot v] by (5)\nend\nif <<key (down arrow v) pressed?> and <[-80] < (Cam X Rot)>> then\n    change [cam x rot v] by (-5)\nend\nchange [cam y v] by (Gravity)\nchange [gravity v] by (-1)\nCheck Collisions floor\n\ndefine Check collisions sides\nset [i v] to [1]\nrepeat ((length of [this level data v]) / (7))\n    if <<<(cam y) < ((item ((i) + (4)) of [this level data v]) + (49))> and <((item ((i) + (5)) of [this level data v]) + (49)) < (cam y)>> and <<<(item (i) of [this level data v]) < (cam x)> and <(cam x) < (item ((i) + (1)) of [this level data v])>> and <<(item ((i) + (2)) of [this level data v]) < (cam z)> and <(cam z) < (item ((i) + (3)) of [this level data v])>>>> then\n        if <(item ((i) + (6)) of [this level data v]) = [16711680]> then\n            broadcast (start v)\n            stop [this script v]\n        else\n            change [cam z v] by ((-1) * (Z Vel))\n            change [cam x v] by ((-1) * (X Vel))\n            set [z vel v] to [0]\n            set [x vel v] to [0]\n        end\n    end\n    change [i v] by (7)\nend\n\nif <(item ((i) + (6)) of [this level data v]) = [65280]> then\n    change [level v] by (1)\n    broadcast (start v)\n    stop [this script v]\nelse\nend\n\ndefine Check Collisions floor\nset [i v] to [1]\nrepeat ((length of [this level data v]) / (7))\n    if <<<(cam y) < ((item ((i) + (4)) of [this level data v]) + (50))> and <((item ((i) + (5)) of [this level data v]) + (50)) < (cam y)>> and <<<(item (i) of [this level data v]) < (cam x)> and <(cam x) < (item ((i) + (1)) of [this level data v])>> and <<(item ((i) + (2)) of [this level data v]) < (cam z)> and <(cam z) < (item ((i) + (3)) of [this level data v])>>>> then\n        if <(item ((i) + (6)) of [this level data v]) = [255]> then\n            set [cam y v] to ((item ((i) + (4)) of [this level data v]) + (50))\n            set [gravity v] to [0]\n            set [jump cooldown v] to [0]\n        else\n            if <(item ((i) + (6)) of [this level data v]) = [16711680]> then\n                broadcast (start v)\n                stop [this script v]\n            else\n                if <(item ((i) + (6)) of [this level data v]) = [65280]> then\n                    change [level v] by (1)\n                    broadcast (start v)\n                    stop [this script v]\n                else\n                    set [cam y v] to ((item ((i) + (4)) of [this level data v]) + (50))\n                    set [gravity v] to [30]\n                    set [jump cooldown v] to [10]\n                end\n            end\n        end\n    end\n    change [i v] by (7)\nend\nif <(cam y) < [-2000]> then\n    broadcast (start v)\n    stop [this script v]\nend\n\ndefine Draw Cube (x1) (y1) (z1) (x2) (y2) (z2) (color)\nset pen color to (color)\nDraw Line (x1) (y1) (z1) to (x1) (y2) (z1)\nDraw Line (x1) (y2) (z1) to (x2) (y2) (z1)\nDraw Line (x2) (y2) (z1) to (x2) (y1) (z1)\nDraw Line (x2) (y1) (z1) to (x1) (y1) (z1)\nDraw Line (x1) (y1) (z2) to (x1) (y2) (z2)\nDraw Line (x1) (y2) (z2) to (x2) (y2) (z2)\nDraw Line (x2) (y2) (z2) to (x2) (y1) (z2)\nDraw Line (x2) (y1) (z2) to (x1) (y1) (z2)\nDraw Line (x1) (y1) (z1) to (x1) (y1) (z2)\nDraw Line (x1) (y2) (z1) to (x1) (y2) (z2)\nDraw Line (x2) (y2) (z1) to (x2) (y2) (z2)\nDraw Line (x2) (y1) (z1) to (x2) (y1) (z2)\n\ndefine Set Point 1: (x1) (y1) (z1)\nset [x1 v] to (x1)\nset [y1 v] to (y1)\nset [z1 v] to (z1)\n\ndefine Set Point 2: (x2) (y2) (z2)\nset [x2 v] to (x2)\nset [y2 v] to (y2)\nset [z2 v] to (z2)\n\ndefine Draw Line (x1) (y1) (z1) to (x2) (y2) (z2)\nSet Point 1: ((x1) - (cam x)) ((y1) - (cam y)) ((z1) - (cam z))\nSet Point 2: ((x2) - (cam x)) ((y2) - (cam y)) ((z2) - (cam z))\nSet Point 1: (((z1) * (sin Y)) + ((x1) * (cos Y))) (y1) (((z1) * (cos Y)) - ((x1) * (sin Y)))\nSet Point 2: (((z2) * (sin Y)) + ((x2) * (cos Y))) (y2) (((z2) * (cos Y)) - ((x2) * (sin Y)))\nSet Point 1: (x1) (((y1) * (cos X)) - ((z1) * (sin X))) (((y1) * (sin X)) + ((z1) * (cos X)))\nSet Point 2: (x2) (((y2) * (cos X)) - ((z2) * (sin X))) (((y2) * (sin X)) + ((z2) * (cos X)))\nif <not <<(z1) < [30]> and <(z2) < [30]>>> then\n    Z Clipping\n    Set Screen Point 1: ((300) * ((x1) / (z1))) ((300) * ((y1) / (z1)))\n    Set Screen Point 2: ((300) * ((x2) / (z2))) ((300) * ((y2) / (z2)))\n    XY Clipping\n    go to x: (x1) y: (y1)\n    pen down\n    go to x: (x2) y: (y2)\n    pen up\nend\n\ndefine Z Clipping\nif <<(z1) < [30]> or <(z2) < [30]>> then\n    set [temp v] to (((30) - (z1)) / ((z2) - (z1)))\n    if <(z1) < [30]> then\n        Set Point 1: ((x1) + (((x2) - (x1)) * (temp))) ((y1) + (((y2) - (y1)) * (temp))) (30)\n    else\n        if <(z2) < [30]> then\n            Set Point 2: ((x1) + (((x2) - (x1)) * (temp))) ((y1) + (((y2) - (y1)) * (temp))) (30)\n        end\n    end\nend\n\ndefine Set Screen Point 2: (x2) (y2)\nset [x2 v] to (x2)\nset [y2 v] to (y2)\n\ndefine XY Clipping\nset [temp v] to (((y2) - (y1)) / ((x2) - (x1)))\nif <(x1) > [240]> then\n    if <(x2) > [240]> then\n        stop [this script v]\n    else\n        Set Screen Point 1: (240) ((y1) + (((240) - (x1)) * (temp)))\n    end\nend\nif <(y1) > [180]> then\n    if <(y2) > [180]> then\n        stop [this script v]\n    else\n        Set Screen Point 1: ((x1) + (((180) - (y1)) / (temp))) (180)\n    end\nend\nif <(x1) < [-240]> then\n    if <(x2) < [-240]> then\n        stop [this script v]\n    else\n        Set Screen Point 1: (-240) ((y1) + (((-240) - (x1)) * (temp)))\n    end\nend\nif <(y1) < [-180]> then\n    if <(y2) < [-180]> then\n        stop [this script v]\n    else\n        Set Screen Point 1: ((x1) + (((-180) - (y1)) / (temp))) (-180)\n    end\nend\nif <(x2) > [240]> then\n    Set Screen Point 2: (240) ((y1) + (((240) - (x1)) * (temp)))\nend\nif <(y2) > [180]> then\n    Set Screen Point 2: ((x1) + (((180) - (y1)) / (temp))) (180)\nend\nif <(x2) < [-240]> then\n    Set Screen Point 2: (-240) ((y1) + (((-240) - (x1)) * (temp)))\nend\nif <(y2) < [-180]> then\n    Set Screen Point 2: ((x1) + (((-180) - (y1)) / (temp))) (-180)\nend\n\ndefine Set Screen Point 1: (x1) (y1)\nset [x1 v] to (x1)\nset [y1 v] to (y1)\n\ndefine Calculate Trig Values\nset [sin x v] to ([sin v] of (Cam X Rot) )\nset [cos x v] to ([cos v] of (Cam X Rot) )\nset [sin y v] to ([sin v] of (Cam Y Rot) )\nset [cos y v] to ([cos v] of (Cam Y Rot) )\n\nset [cam z v] to [225]\n\nwhen flag clicked\nforever\n    play sound [Chaoz Fantasy v] until done\nend\n\nset [cam x v] to [200]\nset [cam y v] to [700]\nset [cam z v] to [-100]\nset [level v] to [4]\nPrint text: [3D PLATFORMER] At X: [-200] Y: [100] Letter size: [4] Color: [255] [255] [255] [0] Pen size: [8] Wrap at X: [1000] Italics: [0]\nPrint text: [By squarepoint] At X: [-200] Y: [-100] Letter size: [4] Color: [255] [255] [255] [0] Pen size: [8] Wrap at X: [1000] Italics: [0]\n\nset [level v] to [5]\n\n@3d platform thumb\n\nwhen flag clicked\nhide\n\nforever\n    set [ghost v] effect to (100)\nend\n\n
矢印キーまたは、マウスで操作できます！\nタブレット端末・スマートフォンでも、操作できます！\n\nスライムを操作してゴールを目指しましょう!!\n\nいいね・お気に入りを押すと隠しステージが出てきたりして(出ます)\n\n\n