[Test] 3D Platformer
@Stage\n\nwhen I receive [fire v]\nplay sound [concrete_impact_ v] until done\n\n@Sprite1\n\ndefine None\nset pen color to (((((number1) * (16777216)) + ((number2) * (65536))) + ((number3) * (256))) + (number4))\n\ndefine None\nset [x2 v] to (x2)\nset [y2 v] to (y2)\n\ndefine Draw Cubes\nARGB Alpha (200) Red (255) Green (100) Blue (100)\nset [cnt v] to (length of [cube x v])\nrepeat (length of [cube x v])\n    set pen size to (((VF) / (300)) * ((4) / (([sqrt v] of ((([sqrt v] of ((((item (cnt) of [cube x v]) - (Cam X)) * ((item (cnt) of [cube x v]) - (Cam X))) + (((item (cnt) of [cube z v]) - (Cam Z)) * ((item (cnt) of [cube z v]) - (Cam Z)))) ) * ([sqrt v] of ((((item (cnt) of [cube x v]) - (Cam X)) * ((item (cnt) of [cube x v]) - (Cam X))) + (((item (cnt) of [cube z v]) - (Cam Z)) * ((item (cnt) of [cube z v]) - (Cam Z)))) )) + (((item (cnt) of [cube y v]) - (Cam Y)) * ((item (cnt) of [cube y v]) - (Cam Y)))) ) / (1000))))\n    set [cube x v] to ((item (cnt) of [cube size v]) / (2))\n    set [cube y v] to ((item (cnt) of [cube size v]) / (2))\n    set [cube z v] to ((item (cnt) of [cube size v]) / (2))\n    Draw line ((Cube x) + (item (cnt) of [cube x v])) ((Cube y) + (item (cnt) of [cube y v])) (((Cube z) * (-1)) + (item (cnt) of [cube z v])) to (((Cube x) * (-1)) + (item (cnt) of [cube x v])) ((Cube y) + (item (cnt) of [cube y v])) (((Cube z) * (-1)) + (item (cnt) of [cube z v]))\n    Draw line (((Cube x) * (-1)) + (item (cnt) of [cube x v])) ((Cube y) + (item (cnt) of [cube y v])) (((Cube z) * (-1)) + (item (cnt) of [cube z v])) to (((Cube x) * (-1)) + (item (cnt) of [cube x v])) (((Cube y) * (-1)) + (item (cnt) of [cube y v])) (((Cube z) * (-1)) + (item (cnt) of [cube z v]))\n    Draw line (((Cube x) * (-1)) + (item (cnt) of [cube x v])) (((Cube y) * (-1)) + (item (cnt) of [cube y v])) (((Cube z) * (-1)) + (item (cnt) of [cube z v])) to ((Cube x) + (item (cnt) of [cube x v])) (((Cube y) * (-1)) + (item (cnt) of [cube y v])) (((Cube z) * (-1)) + (item (cnt) of [cube z v]))\n    Draw line ((Cube x) + (item (cnt) of [cube x v])) (((Cube y) * (-1)) + (item (cnt) of [cube y v])) (((Cube z) * (-1)) + (item (cnt) of [cube z v])) to ((Cube x) + (item (cnt) of [cube x v])) ((Cube y) + (item (cnt) of [cube y v])) (((Cube z) * (-1)) + (item (cnt) of [cube z v]))\n    Draw line ((Cube x) + (item (cnt) of [cube x v])) ((Cube y) + (item (cnt) of [cube y v])) (((Cube z) * (-1)) + (item (cnt) of [cube z v])) to ((Cube x) + (item (cnt) of [cube x v])) ((Cube y) + (item (cnt) of [cube y v])) ((Cube z) + (item (cnt) of [cube z v]))\n    Draw line ((Cube x) + (item (cnt) of [cube x v])) ((Cube y) + (item (cnt) of [cube y v])) ((Cube z) + (item (cnt) of [cube z v])) to ((Cube x) + (item (cnt) of [cube x v])) (((Cube y) * (-1)) + (item (cnt) of [cube y v])) ((Cube z) + (item (cnt) of [cube z v]))\n    Draw line ((Cube x) + (item (cnt) of [cube x v])) (((Cube y) * (-1)) + (item (cnt) of [cube y v])) ((Cube z) + (item (cnt) of [cube z v])) to ((Cube x) + (item (cnt) of [cube x v])) (((Cube y) * (-1)) + (item (cnt) of [cube y v])) (((Cube z) * (-1)) + (item (cnt) of [cube z v]))\n    Draw line (((Cube x) * (-1)) + (item (cnt) of [cube x v])) (((Cube y) * (-1)) + (item (cnt) of [cube y v])) ((Cube z) + (item (cnt) of [cube z v])) to (((Cube x) * (-1)) + (item (cnt) of [cube x v])) ((Cube y) + (item (cnt) of [cube y v])) ((Cube z) + (item (cnt) of [cube z v]))\n    Draw line (((Cube x) * (-1)) + (item (cnt) of [cube x v])) ((Cube y) + (item (cnt) of [cube y v])) ((Cube z) + (item (cnt) of [cube z v])) to (((Cube x) * (-1)) + (item (cnt) of [cube x v])) ((Cube y) + (item (cnt) of [cube y v])) (((Cube z) * (-1)) + (item (cnt) of [cube z v]))\n    Draw line (((Cube x) * (-1)) + (item (cnt) of [cube x v])) (((Cube y) * (-1)) + (item (cnt) of [cube y v])) ((Cube z) + (item (cnt) of [cube z v])) to (((Cube x) * (-1)) + (item (cnt) of [cube x v])) (((Cube y) * (-1)) + (item (cnt) of [cube y v])) (((Cube z) * (-1)) + (item (cnt) of [cube z v]))\n    Draw line (((Cube x) * (-1)) + (item (cnt) of [cube x v])) (((Cube y) * (-1)) + (item (cnt) of [cube y v])) ((Cube z) + (item (cnt) of [cube z v])) to ((Cube x) + (item (cnt) of [cube x v])) (((Cube y) * (-1)) + (item (cnt) of [cube y v])) ((Cube z) + (item (cnt) of [cube z v]))\n    Draw line (((Cube x) * (-1)) + (item (cnt) of [cube x v])) ((Cube y) + (item (cnt) of [cube y v])) ((Cube z) + (item (cnt) of [cube z v])) to ((Cube x) + (item (cnt) of [cube x v])) ((Cube y) + (item (cnt) of [cube y v])) ((Cube z) + (item (cnt) of [cube z v]))\n    change [cnt v] by (-1)\nend\n\ndefine XY Clipping\nset [m 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 point1 (240) ((Y1) + (((240) - (X1)) * (m)))\n    end\nend\nif <(Y1) > [180]> then\n    if <(Y2) > [180]> then\n        stop [this script v]\n    else\n        Set screen point1 ((X1) + (((180) - (Y1)) / (m))) (180)\n    end\nend\nif <(X1) < [-240]> then\n    if <(X2) < [-240]> then\n        stop [this script v]\n    else\n        Set screen point1 (-240) ((Y1) + (((-240) - (X1)) * (m)))\n    end\nend\nif <(Y1) < [-180]> then\n    if <(Y2) < [-180]> then\n        stop [this script v]\n    else\n        Set screen point1 ((X1) + (((-180) - (Y1)) / (m))) (-180)\n    end\nend\nif <(X2) > [240]> then\n    Set screen point2 (240) ((Y1) + (((240) - (X1)) * (m)))\nend\nif <(Y2) > [180]> then\n    Set screen point2 ((X1) + (((180) - (Y1)) / (m))) (180)\nend\nif <(X2) < [-240]> then\n    Set screen point2 (-240) ((Y1) + (((-240) - (X1)) * (m)))\nend\nif <(Y2) < [-180]> then\n    Set screen point2 ((X1) + (((-180) - (Y1)) / (m))) (-180)\nend\n\ndefine Z Clipping\nif <<(Z1) < (near plane)> or <(Z2) < (near plane)>> then\n    set [percent v] to (((near plane) - (Z1)) / ((Z2) - (Z1)))\n    if <(Z1) < (near plane)> then\n        Set point1 ((X1) + (((X2) - (X1)) * (percent))) ((Y1) + (((Y2) - (Y1)) * (percent))) (near plane)\n    else\n        if <(Z2) < (near plane)> then\n            Set point2 ((X1) + (((X2) - (X1)) * (percent))) ((Y1) + (((Y2) - (Y1)) * (percent))) (near plane)\n        end\n    end\nend\n\ndefine Culculate tring values\nset [sin x v] to ([sin v] of (rot X) )\nset [cos x v] to ([cos v] of (rot X) )\nset [sin y v] to ([sin v] of (rot Y) )\nset [cos y v] to ([cos v] of (rot Y) )\n\ndefine None\nset [x1 v] to (x1)\nset [y1 v] to (y1)\nset [z1 v] to (z1)\n\nwhen flag clicked\nset [rot x v] to [0]\nset [rot y v] to [0]\nset [p x v] to [0]\nset [p y v] to [100]\nset [p z v] to [-150]\nset [near plane v] to [30]\nset [z speed v] to [0]\nset [x speed v] to [0]\nset [to vf v] to [150]\nset [vf v] to (to VF)\nforever\n    set [rot speed v] to ((300) / (VF))\n    change [rot x v] by (rot X Speed)\n    change [rot x v] by (Reaction)\n    change [rot y v] by (rot Y Speed)\n    set [cam x v] to (P X)\n    set [cam z v] to (P Z)\n    set [cam y v] to ((P Y) + (120))\n    set [rot x speed v] to ((rot X Speed) * (0.6))\n    set [rot y speed v] to ((rot Y Speed) * (0.6))\n    set [reaction v] to ((Reaction) * (0.6))\n    change [vf v] by (((to VF) - (VF)) * (0.5))\n    if <key (up arrow v) pressed?> then\n        change [rot x speed v] by (rot Speed)\n    end\n    if <key (down arrow v) pressed?> then\n        change [rot x speed v] by ((rot Speed) * (-1))\n    end\n    if <key (right arrow v) pressed?> then\n        change [rot y speed v] by ((rot Speed) * (-1))\n    end\n    if <key (left arrow v) pressed?> then\n        change [rot y speed v] by (rot Speed)\n    end\n    change [p y v] by (Y Speed)\n    Collision (Cube)\n    if <(Collision \(Cube\) Result) = [1]> then\n        if <(Y Speed) > [0]> then\n            set [going up v] to [1]\n        else\n            set [going up v] to [0]\n        end\n        set [y speed v] to [0]\n        if <(Going up) = [0]> then\n            Go up\n            if <key (space v) pressed?> then\n                set [y speed v] to [26]\n            end\n        end\n        set [x speed v] to ((X Speed) * (0.65))\n        set [z speed v] to ((Z speed) * (0.65))\n    else\n        set [x speed v] to ((X Speed) * (0.65))\n        set [z speed v] to ((Z speed) * (0.65))\n    end\n    if <key (a v) pressed?> then\n        change [x speed v] by (([cos v] of (rot Y) ) * (-5))\n        change [z speed v] by (([sin v] of (rot Y) ) * (-5))\n    end\n    if <key (d v) pressed?> then\n        change [x speed v] by (([cos v] of (rot Y) ) * (5))\n        change [z speed v] by (([sin v] of (rot Y) ) * (5))\n    end\n    if <key (w v) pressed?> then\n        change [x speed v] by (([cos v] of ((rot Y) + (90)) ) * (5))\n        change [z speed v] by (([sin v] of ((rot Y) + (90)) ) * (5))\n    end\n    if <key (s v) pressed?> then\n        change [x speed v] by (([cos v] of ((rot Y) + (90)) ) * (-5))\n        change [z speed v] by (([sin v] of ((rot Y) + (90)) ) * (-5))\n    end\n    change [p z v] by (Z speed)\n    Collision (Cube)\n    if <(Collision \(Cube\) Result) = [1]> then\n        change [p z v] by ((Z speed) * (-1))\n    end\n    change [p x v] by (X Speed)\n    Collision (Cube)\n    if <(Collision \(Cube\) Result) = [1]> then\n        change [p x v] by ((X Speed) * (-1))\n    end\n    change [y speed v] by (-2)\n    if <(P Y) < [-4000]> then\n        set [rot x v] to [0]\n        set [rot y v] to [0]\n        set [z speed v] to [0]\n        set [x speed v] to [0]\n        set [p x v] to [0]\n        set [p y v] to [100]\n        set [p z v] to [-150]\n    end\nend\n\ndefine None\nadd (x) to [cube x v]\nadd (y) to [cube y v]\nadd (z) to [cube z v]\nadd (s) to [cube size v]\n\ndefine None\nadd (x) to [target x v]\nadd (y) to [target y v]\nadd (z) to [target z v]\n\nwhen flag clicked\ndelete (all) of [ball x v]\ndelete (all) of [ball y v]\ndelete (all) of [ball z v]\ndelete (all) of [ball x power v]\ndelete (all) of [ball y power v]\ndelete (all) of [ball z power v]\ndelete (all) of [ball count v]\ndelete (all) of [ball type v]\ndelete (all) of [cube x v]\ndelete (all) of [cube y v]\ndelete (all) of [cube z v]\ndelete (all) of [cube size v]\ndelete (all) of [target x v]\ndelete (all) of [target y v]\ndelete (all) of [target z v]\nMake the map\n\nwhen flag clicked\nforever\n    wait until <key (c v) pressed?>\n    set [to vf v] to [2500]\n    wait until <not <key (c v) pressed?>>\n    wait until <key (c v) pressed?>\n    set [to vf v] to [150]\n    wait until <not <key (c v) pressed?>>\nend\n\nwhen flag clicked\nforever\n    Collison\n    Culculate tring values\n    Move balls\n    Draw Target\n    Draw Cubes\n    Draw balls\n    if <(to VF) = [2500]> then\n        Draw Mark\n    else\n        set pen size to (8)\n        ARGB Alpha (255) Red (200) Green (200) Blue (200)\n        pen up\n        go to x: (0) y: (0)\n        pen down\n        pen up\n    end\nend\n\ndefine None\nadd (x) to [ball x v]\nadd (y) to [ball y v]\nadd (z) to [ball z v]\nadd (((speed) * (([sin v] of (rot y) ) * (-1))) * ([cos v] of (rot x) )) to [ball x power v]\nadd ((speed) * ([sin v] of (rot x) )) to [ball y power v]\nadd (((speed) * ([cos v] of (rot y) )) * ([cos v] of (rot x) )) to [ball z power v]\nadd [0] to [ball count v]\nadd (type) to [ball type v]\n\ndefine None\nset [x2 v] to (x2)\nset [y2 v] to (y2)\nset [z2 v] to (z2)\n\ndefine Collison\nset [cnt v] to (length of [target x v])\nrepeat (length of [target x v])\n    set [cnt2 v] to (length of [ball type v])\n    repeat (length of [ball type v])\n        if <(item (cnt2) of [ball type v]) = [Bullet]> then\n            if <<[20] > ([sqrt v] of ((((item (cnt) of [target z v]) - (item (cnt2) of [ball z v])) * ((item (cnt) of [target z v]) - (item (cnt2) of [ball z v]))) + (((item (cnt) of [target y v]) - (item (cnt2) of [ball y v])) * ((item (cnt) of [target y v]) - (item (cnt2) of [ball y v])))) )> and <[20] > ([sqrt v] of ((((item (cnt) of [target x v]) - (item (cnt2) of [ball x v])) * ((item (cnt) of [target x v]) - (item (cnt2) of [ball x v]))) + (((item (cnt) of [target y v]) - (item (cnt2) of [ball y v])) * ((item (cnt) of [target y v]) - (item (cnt2) of [ball y v])))) )>> then\n                repeat (50)\n                    Make a Ball (item (cnt) of [target x v]) (item (cnt) of [target y v]) (item (cnt) of [target z v]) rot x (pick random (1) to (360)) rot y (pick random (1) to (360)) Speed (pick random (1) to (10)) Type [Particle]\n                end\n                delete (cnt) of [target x v]\n                delete (cnt) of [target y v]\n                delete (cnt) of [target z v]\n            end\n        end\n        change [cnt2 v] by (-1)\n    end\n    change [cnt v] by (-1)\nend\n\ndefine Move balls\nset [cnt v] to (length of [ball x v])\nrepeat (length of [ball x v])\n    if <(item (cnt) of [ball count v]) > [60]> then\n        delete (cnt) of [ball x v]\n        delete (cnt) of [ball y v]\n        delete (cnt) of [ball z v]\n        delete (cnt) of [ball x power v]\n        delete (cnt) of [ball y power v]\n        delete (cnt) of [ball z power v]\n        delete (cnt) of [ball count v]\n        delete (cnt) of [ball type v]\n    else\n        replace item (cnt) of [ball x v] with ((item (cnt) of [ball x v]) + (item (cnt) of [ball x power v]))\n        replace item (cnt) of [ball y v] with ((item (cnt) of [ball y v]) + (item (cnt) of [ball y power v]))\n        replace item (cnt) of [ball z v] with ((item (cnt) of [ball z v]) + (item (cnt) of [ball z power v]))\n        if <(item (cnt) of [ball type v]) = [Bullet]> then\n            replace item (cnt) of [ball x power v] with ((item (cnt) of [ball x power v]) * (1))\n            replace item (cnt) of [ball y power v] with ((item (cnt) of [ball y power v]) - (0.05))\n            replace item (cnt) of [ball z power v] with ((item (cnt) of [ball z power v]) * (1))\n        end\n        if <(item (cnt) of [ball type v]) = [Particle]> then\n            replace item (cnt) of [ball y power v] with ((item (cnt) of [ball y power v]) - (1))\n        end\n        replace item (cnt) of [ball count v] with ((item (cnt) of [ball count v]) + (1))\n    end\n    change [cnt v] by (-1)\nend\n\ndefine None\nSet point1 ((x1) - (Cam X)) ((y1) - (Cam Y)) ((z1) - (Cam Z))\nSet point2 ((x2) - (Cam X)) ((y2) - (Cam Y)) ((z2) - (Cam Z))\nSet point1 (((Z1) * (sin Y)) + ((X1) * (cos Y))) (Y1) (((Z1) * (cos Y)) - ((X1) * (sin Y)))\nSet point2 (((Z2) * (sin Y)) + ((X2) * (cos Y))) (Y2) (((Z2) * (cos Y)) - ((X2) * (sin Y)))\nSet point1 (X1) (((Y1) * (cos X)) - ((Z1) * (sin X))) (((Y1) * (sin X)) + ((Z1) * (cos X)))\nSet point2 (X2) (((Y2) * (cos X)) - ((Z2) * (sin X))) (((Y2) * (sin X)) + ((Z2) * (cos X)))\nif <not <<(Z1) < (near plane)> and <(Z2) < (near plane)>>> then\n    Z Clipping\n    Set screen point1 ((VF) * ((X1) / (Z1))) ((VF) * ((Y1) / (Z1)))\n    Set screen point2 ((VF) * ((X2) / (Z2))) ((VF) * ((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 None\nset [x1 v] to (x1)\nset [y1 v] to (y1)\n\ndefine Draw Target\nset [cnt v] to (length of [target x v])\nrepeat (length of [target x v])\n    set pen size to (((VF) / (300)) * ((10) / (([sqrt v] of ((([sqrt v] of ((((item (cnt) of [target x v]) - (Cam X)) * ((item (cnt) of [target x v]) - (Cam X))) + (((item (cnt) of [target z v]) - (Cam Z)) * ((item (cnt) of [target z v]) - (Cam Z)))) ) * ([sqrt v] of ((((item (cnt) of [target x v]) - (Cam X)) * ((item (cnt) of [target x v]) - (Cam X))) + (((item (cnt) of [target z v]) - (Cam Z)) * ((item (cnt) of [target z v]) - (Cam Z)))) )) + (((item (cnt) of [target y v]) - (Cam Y)) * ((item (cnt) of [target y v]) - (Cam Y)))) ) / (1000))))\n    ARGB Alpha (150) Red (65) Green (105) Blue (225)\n    Draw line (item (cnt) of [target x v]) (item (cnt) of [target y v]) (item (cnt) of [target z v]) to (item (cnt) of [target x v]) (item (cnt) of [target y v]) (item (cnt) of [target z v])\n    change [cnt v] by (-1)\nend\n\ndefine Go up\nrepeat until <(Collision \(Cube\) Result) = [0]>\n    Collision (Cube)\n    change [p y v] by (1)\nend\n\nrepeat (5)\n    Make a Cube (0) (-200) ((cnt) * (200)) size: (200)\n    change [cnt v] by (1)\nend\n\ndefine Collision (Cube)\nset [collision \(cube\) result v] to [0]\nset [cnt v] to (length of [cube x v])\nrepeat (length of [cube x v])\n    if <<([abs v] of ((P X) - (item (cnt) of [cube x v])) ) < (((item (cnt) of [cube size v]) / (2)) + (30))> and <<([abs v] of ((P Z) - (item (cnt) of [cube z v])) ) < (((item (cnt) of [cube size v]) / (2)) + (30))> and <([abs v] of (((P Y) + (60)) - (item (cnt) of [cube y v])) ) < (((item (cnt) of [cube size v]) / (2)) + (120))>>> then\n        set [collision \(cube\) result v] to [1]\n        stop [this script v]\n    end\n    change [cnt v] by (-1)\nend\n\ndefine Draw balls\nset [cnt v] to (length of [ball x v])\nrepeat (length of [ball x v])\n    if <(item (cnt) of [ball type v]) = [Bullet]> then\n        set pen size to (((VF) / (300)) * ((1) / (([sqrt v] of ((([sqrt v] of ((((item (cnt) of [ball x v]) - (Cam X)) * ((item (cnt) of [ball x v]) - (Cam X))) + (((item (cnt) of [ball z v]) - (Cam Z)) * ((item (cnt) of [ball z v]) - (Cam Z)))) ) * ([sqrt v] of ((((item (cnt) of [ball x v]) - (Cam X)) * ((item (cnt) of [ball x v]) - (Cam X))) + (((item (cnt) of [ball z v]) - (Cam Z)) * ((item (cnt) of [ball z v]) - (Cam Z)))) )) + (((item (cnt) of [ball y v]) - (Cam Y)) * ((item (cnt) of [ball y v]) - (Cam Y)))) ) / (1000))))\n        ARGB Alpha (100) Red (255) Green (215) Blue (0)\n    end\n    if <(item (cnt) of [ball type v]) = [Particle]> then\n        set pen size to (((VF) / (300)) * ((4) / (([sqrt v] of ((([sqrt v] of ((((item (cnt) of [ball x v]) - (Cam X)) * ((item (cnt) of [ball x v]) - (Cam X))) + (((item (cnt) of [ball z v]) - (Cam Z)) * ((item (cnt) of [ball z v]) - (Cam Z)))) ) * ([sqrt v] of ((((item (cnt) of [ball x v]) - (Cam X)) * ((item (cnt) of [ball x v]) - (Cam X))) + (((item (cnt) of [ball z v]) - (Cam Z)) * ((item (cnt) of [ball z v]) - (Cam Z)))) )) + (((item (cnt) of [ball y v]) - (Cam Y)) * ((item (cnt) of [ball y v]) - (Cam Y)))) ) / (1000))))\n        ARGB Alpha (200) Red (255) Green (20) Blue (147)\n    end\n    Draw line (item (cnt) of [ball x v]) (item (cnt) of [ball y v]) (item (cnt) of [ball z v]) to (item (cnt) of [ball x v]) (item (cnt) of [ball y v]) (item (cnt) of [ball z v])\n    change [cnt v] by (-1)\nend\n\ndefine Make the map\nMake a Cube (0) (-400) (0) size: (400)\nMake a Cube (-300) (0) (700) size: (200)\nMake a Cube (0) (-150) (400) size: (200)\nMake a Cube (0) (0) (1100) size: (200)\nMake a Cube (500) (0) (850) size: (200)\nMake a Cube (300) (100) (600) size: (200)\nMake a Cube (700) (250) (500) size: (200)\nrepeat (20)\n    Make Target (pick random (-700) to (1200)) (pick random (0) to (500)) (pick random (-200) to (1500))\nend\n\ndefine Draw Mark\nset pen size to (2)\nARGB Alpha (255) Red (200) Green (200) Blue (200)\npen up\ngo to x: (-10) y: (0)\npen down\ngo to x: (10) y: (0)\npen up\ngo to x: (0) y: (-10)\npen down\ngo to x: (0) y: (10)\npen up\n\n@FPS\n\ndefine FPS\nif <[1] < (timer)> then\n    set [fps v] to (Count)\n    set [count v] to [0]\n    reset timer\n    wait (0) seconds\nend\n\nwhen flag clicked\nset [count v] to [0]\nreset timer\nforever\n    change [count v] by (1)\n    FPS\nend\n\n@Back Pack\n\nwhen flag clicked\nhide\nset [scene v] to [1]\nSet Data\nforever\n    erase all\n    Write (join [FPS:] ([fps v] of [fps v])) X (-230) Y (-165) Size (20) Thickness (3) Type (1) ARGB [] UI [] Link [] ARGB Mouse on []\nend\n\ndefine None\nadd (chara) to [characters v]\nadd (data) to [char data v]\nadd (width) to [char width v]\n\ndefine Binary Search: Search [] from []\nset [count3 v] to ((Count3) * (2))\nif <(element) < (letter (Count2) of (Avilable Characters))> then\n    set [count2 v] to ((Count2) + (([ceiling v] of ((length of (string1)) / (Count3)) ) * (-1)))\n    Binary Search: Search (element) from (string1)\nelse\n    if <not <(element) = (letter (Count2) of (string1))>> then\n        set [count2 v] to ((Count2) + ([ceiling v] of ((length of (string1)) / (Count3)) ))\n        Binary Search: Search (element) from (string1)\n    end\nend\n\ndefine Bubble Sort\nset [count1 v] to [0]\nrepeat (length of [characters v])\n    set [count2 v] to (length of [characters v])\n    repeat ((length of [characters v]) - (Count1))\n        if <(item (Count2) of [characters v]) < (item ((Count2) - (1)) of [characters v])> then\n            set [bubble sort:save v] to (item ((Count2) - (1)) of [characters v])\n            replace item ((Count2) - (1)) of [characters v] with (item (Count2) of [characters v])\n            replace item (Count2) of [characters v] with (Bubble Sort:Save)\n            set [bubble sort:save v] to (item ((Count2) - (1)) of [char data v])\n            replace item ((Count2) - (1)) of [char data v] with (item (Count2) of [char data v])\n            replace item (Count2) of [char data v] with (Bubble Sort:Save)\n            set [bubble sort:save v] to (item ((Count2) - (1)) of [char width v])\n            replace item ((Count2) - (1)) of [char width v] with (item (Count2) of [char width v])\n            replace item (Count2) of [char width v] with (Bubble Sort:Save)\n        end\n        change [count2 v] by (-1)\n    end\n    change [count1 v] by (1)\nend\n\nset [test v] to [0]\n\ndelete (all) of [width data v]\nset [length v] to [0]\nset [count1 v] to [1]\nrepeat (length of (sentence))\n    set [count2 v] to [1]\n    repeat until <(item (Count2) of [characters v]) = (letter (Count1) of (sentence))>\n        change [count2 v] by (1)\n    end\n    if <<[10] < (Count2)> and <(Count2) < [37]>> then\n        switch costume to (digital v)\n        switch costume to (letter (Count1) of (sentence))\n        if <not <(costume [number v]) = [1]>> then\n            change [count2 v] by (26)\n        end\n    end\n    change [length v] by (((item (Count2) of [char width v]) * (size)) * ((3) / (33)))\n    add (item (Count2) of [char width v]) to [width data v]\n    change [count1 v] by (1)\nend\nchange [length v] by (((size) * (0.1)) * ((Count1) - (2)))\nset [start v] to ((x) - (((type) - (1)) * ((Length) / (2))))\nif <<(ui y/n) = [y]> and <<([abs v] of ((y) - (mouse y)) ) < ((size) / (2))> and <<(mouse x) > ((Start) - ((2) * ((size) / (6))))> and <(mouse x) < (((Start) + (((length of (sentence)) * (((4) * (size)) / (6))) + (((length of (sentence)) - (1)) * (((size) * (0.9)) - (((4) * (size)) / (6)))))) - ((2) * ((size) / (6))))>>>> then\n    set pen color to (join [0x] (argb mouse))\n    if <<mouse down?> and <(Clicked) = [0]>> then\n        if <(letter (1) of (link)) = [@]> then\n            broadcast (link)\n        else\n            set [scene v] to (link)\n        end\n        set [clicked v] to [1]\n    end\n    if <not <mouse down?>> then\n        set [clicked v] to [0]\n    end\nelse\n    set pen color to (join [0x] (argb))\nend\nset pen size to (t)\npen up\nset [count1 v] to [1]\nrepeat (length of (sentence))\n    set [count2 v] to [1]\n    repeat until <<(item (Count2) of [characters v]) = (letter (Count1) of (sentence))> or <(Count2) = (length of [characters v])>>\n        change [count2 v] by (1)\n    end\n    if <<[10] < (Count2)> and <(Count2) < [37]>> then\n        switch costume to (digital v)\n        switch costume to (letter (Count1) of (sentence))\n        if <not <(costume [number v]) = [1]>> then\n            change [count2 v] by (26)\n        end\n    end\n    set [drawn chara width v] to [0]\n    set [count4 v] to [1]\n    repeat ((Count1) - (1))\n        set [drawn chara width v] to ((Drawn Chara Width) + (item (Count4) of [width data v]))\n        change [count4 v] by (1)\n    end\n    set [count3 v] to [1]\n    repeat until <<(Count3) = (length of (item (Count2) of [char data v]))> or <(Count3) > (length of (item (Count2) of [char data v]))>>\n        if <(letter (Count3) of (item (Count2) of [char data v])) = [u]> then\n            pen up\n            change [count3 v] by (1)\n        else\n            if <(letter (Count3) of (item (Count2) of [char data v])) = [d]> then\n                pen down\n                change [count3 v] by (1)\n            else\n                if <(letter ((Count3) + (1)) of (item (Count2) of [char data v])) = [-]> then\n                    go to x: (((Start) + ((((Drawn Chara Width) * (size)) * (0.1)) + (((Count1) - (1)) * ((size) * (0.1))))) + ((((letter (Count3) of (item (Count2) of [char data v])) - (3)) * (size)) / (9))) y: ((y) + (((((letter ((Count3) + (2)) of (item (Count2) of [char data v])) * (-1)) - (4)) * (size)) / (9)))\n                    change [count3 v] by (3)\n                else\n                    go to x: (((Start) + ((((Drawn Chara Width) * (size)) * (0.1)) + (((Count1) - (1)) * ((size) * (0.1))))) + ((((letter (Count3) of (item (Count2) of [char data v])) - (3)) * (size)) / (9))) y: ((y) + ((((letter ((Count3) + (1)) of (item (Count2) of [char data v])) - (4)) * (size)) / (9)))\n                    change [count3 v] by (2)\n                end\n            end\n        end\n    end\n    pen up\n    change [count1 v] by (1)\nend\n\ndefine None\ndelete (all) of [width data v]\ndelete (all) of [char data to write v]\nset [length v] to [0]\nset [count1 v] to [1]\nrepeat (length of (sentence))\n    set [count2 v] to ([floor v] of ((length of (Avilable Characters)) / (2)) )\n    set [count3 v] to [2]\n    Binary Search: Search (letter (Count1) of (sentence)) from (Avilable Characters)\n    if <[35] < (Count2)> then\n        switch costume to (digital v)\n        switch costume to (letter (Count1) of (sentence))\n        if <(costume [number v]) = [1]> then\n            add (item (Count2) of [char data v]) to [char data to write v]\n            add (item (Count2) of [char width v]) to [width data v]\n            change [length v] by (((item (Count2) of [char width v]) * (size)) * ((3) / (33)))\n        else\n            add (item (Count2) of [char data\[capital\] v]) to [char data to write v]\n            add (item (Count2) of [char width\[capital\] v]) to [width data v]\n            change [length v] by (((item (Count2) of [char width\[capital\] v]) * (size)) * ((3) / (33)))\n        end\n    else\n        add (item (Count2) of [char data v]) to [char data to write v]\n        add (item (Count2) of [char width v]) to [width data v]\n        change [length v] by (((item (Count2) of [char width v]) * (size)) * ((3) / (33)))\n    end\n    change [count1 v] by (1)\nend\nchange [length v] by (((size) * (0.1)) * ((Count1) - (2)))\nset [start v] to ((x) - (((type) - (1)) * ((Length) / (2))))\nif <<(ui y/n) = [y]> and <<([abs v] of ((y) - (mouse y)) ) < ((size) / (2))> and <<(mouse x) > ((Start) - ((2) * ((size) / (6))))> and <(mouse x) < ((Start) + (Length))>>>> then\n    set pen color to (join [0x] (argb mouse))\n    if <<mouse down?> and <(Clicked) = [0]>> then\n        if <(letter (1) of (link)) = [@]> then\n            broadcast (link)\n        else\n            set [scene v] to (link)\n        end\n        set [clicked v] to [1]\n    end\n    if <not <mouse down?>> then\n        set [clicked v] to [0]\n    end\nelse\n    set pen color to (join [0x] (argb))\nend\nset pen size to (t)\npen up\nset [count1 v] to [1]\nrepeat (length of (sentence))\n    set [drawn chara width v] to [0]\n    set [count4 v] to [1]\n    repeat ((Count1) - (1))\n        set [drawn chara width v] to ((Drawn Chara Width) + (item (Count4) of [width data v]))\n        change [count4 v] by (1)\n    end\n    set [count3 v] to [1]\n    repeat until <<(Count3) = (length of (item (Count1) of [char data to write v]))> or <(Count3) > (length of (item (Count1) of [char data to write v]))>>\n        if <(letter (Count3) of (item (Count1) of [char data to write v])) = [u]> then\n            pen up\n            change [count3 v] by (1)\n        else\n            if <(letter (Count3) of (item (Count1) of [char data to write v])) = [d]> then\n                pen down\n                change [count3 v] by (1)\n            else\n                if <(letter ((Count3) + (1)) of (item (Count1) of [char data to write v])) = [-]> then\n                    go to x: (((Start) + ((((Drawn Chara Width) * (size)) * (0.1)) + (((Count1) - (1)) * ((size) * (0.1))))) + ((((letter (Count3) of (item (Count1) of [char data to write v])) - (3)) * (size)) / (9))) y: ((y) + (((((letter ((Count3) + (2)) of (item (Count1) of [char data to write v])) * (-1)) - (4)) * (size)) / (9)))\n                    change [count3 v] by (3)\n                else\n                    go to x: (((Start) + ((((Drawn Chara Width) * (size)) * (0.1)) + (((Count1) - (1)) * ((size) * (0.1))))) + ((((letter (Count3) of (item (Count1) of [char data to write v])) - (3)) * (size)) / (9))) y: ((y) + ((((letter ((Count3) + (1)) of (item (Count1) of [char data to write v])) - (4)) * (size)) / (9)))\n                    change [count3 v] by (2)\n                end\n            end\n        end\n    end\n    pen up\n    change [count1 v] by (1)\nend\n\nchange [count2 v] by (1)\n\ndefine None\nadd (string1) to [characters\[capital\] v]\nadd (string2) to [char data\[capital\] v]\nadd (number1) to [char width\[capital\] v]\n\ndefine Set Capital letters' datas\ndelete (all) of [characters\[capital\] v]\ndelete (all) of [char data\[capital\] v]\ndelete (all) of [char width\[capital\] v]\nset [count1 v] to [1]\nrepeat until <(item (Count1) of [characters v]) = [a]>\n    Add Capital letter Chara: [] Data: [] Width (0)\n    change [count1 v] by (1)\nend\nAdd Capital letter Chara: [A] Data: [00d2740u13d33] Width (5)\nAdd Capital letter Chara: [B] Data: [00d0727363443413000u03d2334] Width (5)\nAdd Capital letter Chara: [C] Data: [41d30100205173746] Width (5)\nAdd Capital letter Chara: [D] Data: [00d073755523000] Width (6)\nAdd Capital letter Chara: [E] Data: [40d000747u04d44] Width (5)\nAdd Capital letter Chara: [F] Data: [00d0737u04d34] Width (4)\nAdd Capital letter Chara: [G] Data: [43d4130100205173746u33d5351] Width (6)\nAdd Capital letter Chara: [H] Data: [00d07u04d44u40d47] Width (5)\nAdd Capital letter Chara: [I] Data: [07d27u00d20u17d10] Width (3)\nAdd Capital letter Chara: [J] Data: [07d37u27d221000] Width (4)\nAdd Capital letter Chara: [K] Data: [00d07u30d03u03d37] Width (4)\nAdd Capital letter Chara: [L] Data: [07d0040] Width (5)\nAdd Capital letter Chara: [M] Data: [00d07234740] Width (5)\nAdd Capital letter Chara: [N] Data: [00d074047] Width (5)\nAdd Capital letter Chara: [O] Data: [02d0517475552401002] Width (6)\nAdd Capital letter Chara: [P] Data: [00d073746453404] Width (5)\nAdd Capital letter Chara: [Q] Data: [02d0517475552401002u42d50] Width (6)\nAdd Capital letter Chara: [R] Data: [00d073746453404u04d40] Width (5)\nAdd Capital letter Chara: [S] Data: [47d1706043443413000] Width (5)\nAdd Capital letter Chara: [T] Data: [07d47u27d20] Width (5)\nAdd Capital letter Chara: [U] Data: [07d0210304247] Width (5)\nAdd Capital letter Chara: [V] Data: [07d2047] Width (5)\nAdd Capital letter Chara: [W] Data: [07d20374067] Width (7)\nAdd Capital letter Chara: [X] Data: [00d47u07d40] Width (5)\nAdd Capital letter Chara: [Y] Data: [07d2420u24d47] Width (5)\nAdd Capital letter Chara: [Z] Data: [07d570050] Width (6)\n\ndefine Set Data\ndelete (all) of [characters v]\ndelete (all) of [char data v]\ndelete (all) of [char width v]\nAdd Chara data Chara: [0] Data: [01d0718384741301001] Width: (5)\nAdd Chara data Chara: [1] Data: [07d1810u00d20] Width: (3)\nAdd Chara data Chara: [2] Data: [06d07183847460040] Width: (5)\nAdd Chara data Chara: [3] Data: [07d1838474745244341301001] Width: (5)\nAdd Chara data Chara: [4] Data: [30d380353] Width: (6)\nAdd Chara data Chara: [5] Data: [01d00304143340408u07d47] Width: (5)\nAdd Chara data Chara: [6] Data: [04d34434130100107183847] Width: (5)\nAdd Chara data Chara: [7] Data: [06d084820] Width: (5)\nAdd Chara data Chara: [8] Data: [14d344341301001031405071838474534 ] Width: (5)\nAdd Chara data Chara: [9] Data: [01d10304147381807051444 ] Width: (5)\nAdd Chara data Chara: [a] Data: [03d1424333140u31d2010011232] Width: (5)\nAdd Chara data Chara: [b] Data: [07d0110203133241403] Width: (4)\nAdd Chara data Chara: [c] Data: [34d1403011030] Width: (4)\nAdd Chara data Chara: [d] Data: [37d3120100103142433] Width: (4)\nAdd Chara data Chara: [e] Data: [41d301001031434433202] Width: (5)\nAdd Chara data Chara: [f] Data: [10d162736u04d34] Width: (4)\nAdd Chara data Chara: [g] Data: [0-2d1-32-33-23324140301102032] Width: (4)\nAdd Chara data Chara: [h] Data: [07d00u03d14243330] Width: (4)\nAdd Chara data Chara: [i] Data: [07d07u05d00] Width: (1)\nAdd Chara data Chara: [j] Data: [35d35u34d3-22-31-30-2] Width: (4)\nAdd Chara data Chara: [k] Data: [07d00u34d0230] Width: (4)\nAdd Chara data Chara: [l] Data: [07d00] Width: (1)\nAdd Chara data Chara: [m] Data: [04d00u03d142320u23d344440] Width: (5)\nAdd Chara data Chara: [n] Data: [04d00u03d14243430] Width: (4)\nAdd Chara data Chara: [o] Data: [01d0314243331201001] Width: (4)\nAdd Chara data Chara: [p] Data: [0-4d0314243331201001] Width: (4)\nAdd Chara data Chara: [q] Data: [3-4d3324140301102031] Width: (4)\nAdd Chara data Chara: [r] Data: [04d00u01d132434] Width: (4)\nAdd Chara data Chara: [s] Data: [43d341403123241301001] Width: (5)\nAdd Chara data Chara: [t] Data: [04d34u17d10] Width: (4)\nAdd Chara data Chara: [u] Data: [04d01102031u34d30] Width: (4)\nAdd Chara data Chara: [v] Data: [04d2044] Width: (5)\nAdd Chara data Chara: [w] Data: [04d10243044] Width: (5)\nAdd Chara data Chara: [x] Data: [04d30u34d00] Width: (4)\nAdd Chara data Chara: [y] Data: [03d20u34d201-3] Width: (4)\nAdd Chara data Chara: [z] Data: [04d340030] Width: (4)\nAdd Chara data Chara: [ ] Data: [] Width: (3)\nAdd Chara data Chara: [?] Data: [20d20u21d2333444637170605] Width: (5)\nAdd Chara data Chara: [!] Data: [00d10110100u02d12170702] Width: (2)\nAdd Chara data Chara: ["] Data: [08d07u18d17] Width: (2)\nAdd Chara data Chara: [#] Data: [03d43u15d55u12d26u32d46] Width: (6)\nAdd Chara data Chara: [$] Data: [47d17060434434101u20d28] Width: (5)\nAdd Chara data Chara: [%] Data: [00d46u05d15160605u30d40413130] Width: (5)\nAdd Chara data Chara: [&] Data: [50d1416273746453413020110304153] Width: (6)\nAdd Chara data Chara: ['] Data: [08d07] Width: (1)\nAdd Chara data Chara: [\(] Data: [10d020517] Width: (2)\nAdd Chara data Chara: [\)] Data: [00d121507] Width: (2)\nAdd Chara data Chara: [*] Data: [05d27u07d25u06d26] Width: (3)\nAdd Chara data Chara: [+] Data: [04d44u26d22] Width: (5)\nAdd Chara data Chara: [,] Data: [10d0-1] Width: (2)\nAdd Chara data Chara: [-] Data: [04d44] Width: (5)\nAdd Chara data Chara: [.] Data: [00d00] Width: (1)\nAdd Chara data Chara: [/] Data: [00d27] Width: (3)\nAdd Chara data Chara: [:] Data: [07d05u03d01] Width: (1)\nAdd Chara data Chara: [;] Data: [17d15u13d01] Width: (2)\nAdd Chara data Chara: [<] Data: [46d0442] Width: (5)\nAdd Chara data Chara: [=] Data: [05d45u03d43] Width: (5)\nAdd Chara data Chara: [>] Data: [06d4402] Width: (5)\nAdd Chara data Chara: [\[] Data: [10d000717] Width: (2)\nAdd Chara data Chara: [\] Data: [20d07] Width: (3)\nAdd Chara data Chara: [\]] Data: [00d101707] Width: (2)\nBubble Sort\nset [avilable characters v] to (Characters)\nSet Capital letters' datas\n\n
NEW VERSION AVAILABLE !!!!!! Below one supports face rendering and back face culling.\nhttps://scratch.mit.edu/projects/389001796/\nW,A,S and D to move.\nArrow keys to see around. \nC to zoom.\nSpace to jump\nW,A,S,Dで移動。矢印キーで見渡す。\nCでズーム。\nスペースキーでジャンプ。