#2 Cave  Platformer！洞窟プラットフォーマー
@Stage\n\nwhen I receive [tick v]\ndelete all of [stuff v]\nadd (join ((mouse x) + (SCROLL X)) (join [, ] (mouse y))) to [stuff v]\nadd (join ([x v] of [player v]) (join [, ] ([y v] of [player v]))) to [stuff v]\n\nwhen flag clicked\nset volume to (50) %\nforever\n    play sound [906563_Twenty-Six-O-Eight-Loop v] until done\nend\n\n@Blank\n\nset [beaten? v] to [0]\nset [extra player v] to [1]\n\n@Player\n\nwhen flag clicked\nhide\ngo to [front v] layer\nbroadcast (Play Game v) and wait\n\nwhen I receive [play game v]\nset [level v] to [1]\nforever\n    broadcast (Reset v) and wait\n    broadcast (Set up v) and wait\n    Game On\n    repeat until <(EXIT) > []>\n        Tick\n        broadcast (Tick v) and wait\n    end\n    if <(EXIT) = [Win]> then\n        broadcast (Win Screen v)\n    else\n        Game - Die\n    end\nend\n\ndefine Game On\nset [x v] to [-160]\nset [y v] to [-52]\nset [scroll x v] to [0]\nset [sx v] to [0]\nset [sy v] to [0]\nset [in air v] to [0]\nset [exit v] to []\nset [move v] to [0]\nset volume to (100) %\nset size to (75) %\nclear graphic effects\nshow\n\ndefine Tick\nswitch costume to (1 v)\nset rotation style [don't rotate v]\nif <(Move) = [0]> then\n    reset timer\nend\nif <<<key (right arrow v) pressed?> or <key (d v) pressed?>> or <<mouse down?> and <(mouse x) > (x position)>>> then\n    point in direction (90)\n    change [sx v] by (2.2)\n    set [move v] to [1]\nend\nif <<<key (left arrow v) pressed?> or <key (a v) pressed?>> or <<mouse down?> and <(mouse x) < (x position)>>> then\n    point in direction (-90)\n    change [sx v] by (-2.2)\n    set [move v] to [1]\nend\nset [sx v] to ((sx) * (0.8))\nif <([abs v] of (sx) ) > [0.9]> then\n    Change Player x by (round (sx))\nend\nif <<<key (up arrow v) pressed?> or <key (w v) pressed?>> or <<mouse down?> and <(mouse y) > (y position)>>> then\n    set [move v] to [1]\n    if <(in air) < [4]> then\n        set [sy v] to [12]\n    end\n    if <(in air) < [1]> then\n        start sound [Jump v]\n    end\nend\nif <(sy) > [-20]> then\n    change [sy v] by (-1)\nend\nChange player y by (sy)\nPosition\nTest - Die\nset [scroll x v] to (x)\nif <(SCROLL X) < [0]> then\n    set [scroll x v] to [0]\nend\nif <(SCROLL X) > ((480) * (11))> then\n    set [scroll x v] to ((480) * (11))\nend\nif <(x) < [-240]> then\n    set [x v] to [-240]\nend\nif <(x) > [5520]> then\n    set [x v] to [5520]\nend\nset rotation style [left-right v]\nPosition\nif <<(y) < [-180]> or <touching (enemies v)?>> then\n    set [exit v] to [Die]\nend\nif <touching (flag v)?> then\n    set [exit v] to [Win]\nend\nAnimate\n\ndefine Change player y by (sy)\nchange [y v] by (sy)\nchange [in air v] by (1)\nPosition\nrepeat until <not <<touching (level v)?> or <touching (platforms v)?>>>\n    if <(sy) > [0]> then\n        change [y v] by (-1)\n    else\n        change [y v] by (1)\n        set [in air v] to [0]\n    end\n    Position\n    set [sy v] to (round ((sy) * (0.91)))\nend\n\ndefine Position\ngo to x: ((x) - (SCROLL X)) y: (y)\n\ndefine Change Player x by (sx)\nchange [x v] by (sx)\nPosition\nif <<touching (level v)?> or <touching (platforms v)?>> then\n    repeat (12)\n        change [y v] by (1)\n        Position\n        if <not <<touching (level v)?> or <touching (platforms v)?>>> then\n            stop [this script v]\n        end\n    end\n    change [y v] by (-12)\n    repeat until <not <<touching (level v)?> or <touching (platforms v)?>>>\n        if <(sx) > [0]> then\n            change [x v] by (-1)\n        else\n            change [x v] by (1)\n        end\n        Position\n    end\nend\n\ndefine Game - Die\nset [exit v] to []\nif <([moves v] of [ghost v]) > (length of [positions v])> then\n    start sound [Lose v]\nelse\n    start sound [Punch - Gaming Sound Effect \(HD\) v]\nend\nrepeat (5)\n    hide\n    wait (0.1) seconds\n    show\n    wait (0.1) seconds\nend\nhide\nwait (0.5) seconds\n\ndefine Test - Die\nif <touching (lava v)?> then\n    set [exit v] to [Die]\nend\n\ndefine Animate\nif <(in air) > [0]> then\n    switch costume to (11 v)\nelse\n    if <([abs v] of (sx) ) > [0.9]> then\n        switch costume to (([floor v] of (((timer) * (12)) mod (8)) ) + (2))\n    else\n        switch costume to (2 v)\n    end\nend\n\nwhen I receive [win screen v]\nstop [other scripts in sprite v]\nstart sound [Win v]\n\nif <(Move) = [1]> then\n    add (x) to [positions v]\n    add (y) to [positions v]\n    add (costume [number v]) to [positions v]\n    add (direction) to [positions v]\nend\n\n@Level\n\nwhen I receive [tick v]\nswitch costume to (bypass v)\nset size to ((1) / ()) %\ngo to x: ((x) - (SCROLL X)) y: (y)\nswitch costume to (costume)\nset size to (100) %\nif <([abs v] of (x position) ) > [500]> then\n    hide\nelse\n    show\nend\n\nwhen I receive [set up v]\nshow\nset [x v] to [0]\nset [y v] to [0]\nif <(LEVEL) = [1]> then\n    switch costume to (1 v)\n    Clone\nend\n\nwhen I receive [reset v]\ndelete this clone\n\ndefine Clone at x: (x) y: (y)\ncreate clone of (_myself_ v)\nchange [x v] by (x)\nchange [y v] by (y)\n\nwhen flag clicked\n\nwhen I start as a clone\nshow\n\ndefine Clone\nset [costume v] to [1]\nrepeat (11)\n    Clone at x: [480] y: [0]\n    change [costume v] by (1)\nend\n\n@Enemies\n\ndefine Make Clone (clone) Bound 1 (bound 1) Bound 2 (bound 2) x (x) y (y)\nset [clone v] to (clone)\nset [bounds 1 v] to (bound 1)\nset [bounds 2 v] to (bound 2)\nset [x v] to (x)\nset [y v] to (y)\nset [direction v] to [1]\ncreate clone of (_myself_ v)\n\nwhen I start as a clone\nshow\nforever\n    if <(Clone) = [1]> then\n        if <([abs v] of (x position) ) < [280]> then\n            if <(x) < (Bounds 1)> then\n                set [direction v] to [1]\n            end\n            if <(x) > (Bounds 2)> then\n                set [direction v] to [2]\n            end\n            if <(Direction) = [1]> then\n                change [x v] by (2)\n            end\n            if <(Direction) = [2]> then\n                change [x v] by (-2)\n            end\n        end\n    end\nend\n\nwhen I receive [tick v]\nswitch costume to (bypass v)\nset size to ((1) / ()) %\ngo to x: ((x) - (SCROLL X)) y: (y)\nswitch costume to (enemy v)\nset size to (100) %\nset rotation style [left-right v]\nif <(Direction) = [1]> then\n    point in direction (90)\nelse\n    point in direction (-90)\nend\nif <([abs v] of (x position) ) > [280]> then\n    hide\nelse\n    show\nend\n\nwhen I receive [reset v]\nbroadcast (Delete Clones v)\nMake Clone [1] Bound 1 [760] Bound 2 [1010] x [1010] y [-85]\nMake Clone [1] Bound 1 [1385] Bound 2 [1585] x [1585] y [-12]\nMake Clone [1] Bound 1 [1780] Bound 2 [2055] x [2055] y [-106]\nMake Clone [1] Bound 1 [2540] Bound 2 [2800] x [2800] y [74]\nMake Clone [1] Bound 1 [3802] Bound 2 [4073] x [4073] y [29]\nMake Clone [1] Bound 1 [0] Bound 2 [0] x [-300] y [250]\n\nwhen I receive [delete clones v]\ndelete this clone\n\n@Platforms\n\ndefine Clone Platform (x) (y)\nset [x v] to (x)\nset [y v] to (y)\nset [fade v] to [0]\nset [ghost v] to [0]\nset [tick v] to [0]\nclear graphic effects\ncreate clone of (_myself_ v)\n\nwhen I receive [tick v]\nswitch costume to (bypass v)\nset size to ((1) / ()) %\ngo to x: ((x) - (SCROLL X)) y: (y)\nswitch costume to (disappearing v)\nset size to (100) %\nif <(Fade) = [1]> then\n    change [tick v] by (1)\n    if <(Tick) > [20]> then\n        change [ghost v] by (10)\n        change [tick v] by (1)\n    end\n    if <(Ghost) > [100]> then\n        hide\n        change [tick v] by (1)\n        if <(Tick) > [250]> then\n            set [ghost v] to [100]\n            set [fade v] to [0]\n            set [tick v] to [0]\n        end\n    end\nelse\n    show\n    if <(Ghost) > [0]> then\n        change [ghost v] by (-10)\n    end\nend\nif <([abs v] of (x position) ) > [300]> then\n    set [ghost v] effect to (0)\nelse\n    set [ghost v] effect to (Ghost)\nend\n\nwhen I receive [reset v]\nwait (0) seconds\nClone Platform [3197] [-65]\nClone Platform [3579] [-36]\nClone Platform [4145] [-166]\nClone Platform [4245] [-166]\nClone Platform [4345] [-166]\nClone Platform [4445] [-166]\nClone Platform [4618] [29]\nClone Platform [4618] [-166]\nClone Platform [4718] [-166]\nClone Platform [4818] [-166]\nClone Platform [4918] [-166]\nClone Platform [4718] [-61]\nClone Platform [4818] [-61]\nClone Platform [-300] [0]\n\nwhen I receive [delete clones v]\ndelete this clone\n\nwhen I start as a clone\nshow\nforever\n    if <<touching (player v)?> and <([in air v] of [player v]) = [0]>> then\n        set [fade v] to [1]\n    end\nend\n\nbroadcast (Reset v)\n\nbroadcast (Delete Clones v)\n\n@Thumbnail\n\nwhen flag clicked\nset [ghost v] effect to (100)\nforever\n    go to [front v] layer\nend\n\n@Flag\n\nwhen I receive [tick v]\nswitch costume to (bypass v)\nset size to ((1) / ()) %\ngo to x: ((5453) - (SCROLL X)) y: (-20)\nswitch costume to (flag v)\nset size to (100) %\n\n@Text:\n\ndefine Write Text (text)\ngo to x: (-150) y: (153)\nset [i v] to [1]\nrepeat (length of (text))\n    switch costume to (letter (i) of (text))\n    change [i v] by (1)\n    create clone of (_myself_ v)\n    change x by (20)\nend\n\nwhen I start as a clone\nshow\n\nwhen I receive [delete text v]\ndelete this clone\n\nwhen I receive [tick v]\nbroadcast (Delete Text v)\nWrite Text (timer)\ngo to x: (-197) y: (153)\nswitch costume to (time v)\n\n@Scrolling Background\n\nwhen I receive [tick v]\ngo to [back v] layer\nset [ghost v] effect to (60)\nset x to ((((SCROLL X) / (-1.3)) mod (480)) + (-480))\n\n@Win\n\nwhen flag clicked\nhide\n\nwhen I receive [win screen v]\nshow\ngo to [front v] layer\nset [ghost v] effect to (100)\nswitch costume to (2 v)\nchange [☁ complete variable v] by (1)\nif <(Beaten?) = [1]> then\n    switch costume to (3 v)\nend\nset [beaten? v] to [1]\nset [extra player v] to [1]\ncreate clone of (_myself_ v)\nswitch costume to (1 v)\nrepeat (10)\n    change [ghost v] effect by (-3)\nend\n\nwhen I start as a clone\nshow\ngo to [front v] layer\nset [ghost v] effect to (100)\nrepeat (10)\n    change [ghost v] effect by (-10)\nend\n\nwhen I receive [delete clones v]\ndelete this clone\n\nwhen I receive [win screen v]\nwait (0.15) seconds\nchange [☁ beat the game variable v] by (1)\n\n@Ghost\n\nwhen I receive [tick v]\nif <<([move v] of [player v]) = [1]> and <<(timer) > [0.5]> and <<(Beaten?) = [1]> and <(Extra Player) = [1]>>>> then\n    show\n    set [x v] to (item ((Moves) - (3)) of [positions v])\n    switch costume to (bypass v)\n    set size to ((1) / ()) %\n    go to x: ((x) - (SCROLL X)) y: (item ((Moves) - (2)) of [positions v])\n    switch costume to (item ((Moves) - (1)) of [positions v])\n    point in direction (item (Moves) of [positions v])\n    set size to (75) %\n    change [moves v] by (4)\nend\n\nwhen I receive [reset v]\nhide\nset [moves v] to [4]\ngo to x: (-160) y: (-58)\nset rotation style [left-right v]\n\nwhen flag clicked\nwait (0.1) seconds\nbroadcast (Player v)\nwait until <([move v] of [player v]) = [1]>\nstop [other scripts in sprite v]\nforever\n    wait until <(Moves) > (length of [positions v])>\n    set [exit v] to [Lose]\n    wait until <not <(Moves) > (length of [positions v])>>\n    broadcast (Player v)\nend\n\nwhen I receive [player v]\nforever\n    if <<key (space v) pressed?> and <(Beaten?) = [1]>> then\n        set [extra player v] to ((1) - (Extra Player))\n        if <(Extra Player) = [1]> then\n            set [pitch v] effect to (20)\n        else\n            set [pitch v] effect to (-20)\n        end\n        start sound [pop v]\n        wait until <not <key (space v) pressed?>>\n    end\nend\n\n
============= 3D PLATFORMER ==============\n\nINSTRUCTIONS:\n - WASD/ZQSD to move\n - Arrows to turn\n - Space to jump\n - Get to the green exit in the fastest time possible! There are 8 levels.\n - If you wanna make your own levels there are instructions inside :D\n\nand yes, i'll make a non-wireframe 3d platformer someday :D\n\nSecond level is possible! Instead of jumping on top of the last red block, you need to jump to the side, and then when you pass it you come back in the center and land on top of the green block.