Google T-Rex Platformer

Instructions: 日本語は下。三か月前ぐらいに作りましたw\n------------------------------------------------------------------------\n*I made this piece about three months ago.\n\n▼Description\nLet's go on an adventure under the blue sky!\nDepart for the goal! !\n\n▼How to operate\nOperate with arrow keys or tap.\nMobile friendly.\n\nIf you touch thorns or magma, you will die.\nPlease be careful.\n\nLet's have a simple conversation with the other party in the chat!\nEx. Hello!\nEx. Hi!\n------------------------------------------------------------------------\n\n▼説明\nあなたは青空の下で冒険をしよう！\nゴールを目指して出発！！\n\n▼操作方法\n矢印キー、またはタップで操作します。\nモバイル対応です。\n\nトゲや、マグマに触れると死んでしまいます。\n気を付けてください。\n\nチャットで相手と簡単な会話をしましょう！\n例.こんにちは！\n例.やあ！

@Stage\n\nwhen flag clicked\nset [level v] to [1]\nforever\n    broadcast (Tick v)\nend\n\n@Blank\n\n@Player\n\nwhen flag clicked\nbroadcast (Setup v)\nbroadcast (Start v)\n\nwhen I receive [reset v]\nshow\ngo to x: (0) y: (0)\nset [speed x v] to [0]\nset [speed y v] to [0]\nset [slope v] to [0]\nset [walljump v] to []\n\nwhen I receive [start v]\nbroadcast (Reset v)\nforever\n    Platformer [1.8] [22] [-1.5] [0.8] [35] [24] [-50] [-1]\n    Camera\nend\n\ndefine Platformer (speed) (jump) (gravity) (friction) (walljump x) (walljump y) (fall) (slide)\nset [old x v] to (x position)\nset [old y v] to (y position)\nif <(RESPAWN) = [no]> then\n    set rotation style [don't rotate v]\n    switch costume to (hitbox v)\n    if <<key (right arrow v) pressed?> and <not <(walljump) = [right]>>> then\n        change [speed x v] by (speed)\n    end\n    if <<key (left arrow v) pressed?> and <not <(walljump) = [left]>>> then\n        change [speed x v] by ((speed) * (-1))\n    end\n    set [speed x v] to ((speed x) * (friction))\n    change [speed y v] by (gravity)\n    change y by (speed y)\n    if <(speed y) < [0]> then\n        repeat until <not <touching (level hitbox v)?>>\n            change y by (1)\n            set [speed y v] to [0]\n            set [jump v] to [1]\n        end\n    else\n        repeat until <not <touching (level hitbox v)?>>\n            change y by (-1)\n            set [speed y v] to [0]\n            set [jump v] to [0]\n        end\n    end\n    change x by (speed x)\n    set [slope v] to [0]\n    if <<key (up arrow v) pressed?> and <(jump) = [1]>> then\n        set [speed y v] to (jump)\n        set [jump v] to [0]\n    end\n    repeat until <<(slope) = [8]> or <not <touching (level hitbox 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 x))\n        change y by ((0) - (slope))\n        if <<<key (right arrow v) pressed?> or <key (left arrow v) pressed?>> and <(speed y) < [0]>> then\n            set [speed y v] to (slide)\n            set [state v] to [slide]\n            if <key (up arrow v) pressed?> then\n                broadcast (WallJump v)\n                set [speed y v] to (walljump y)\n                if <(speed x) > [0]> then\n                    set [speed x v] to ((walljump x) * (-1))\n                    set [walljump v] to [right]\n                else\n                    set [speed x v] to (walljump x)\n                    set [walljump v] to [left]\n                end\n            end\n        end\n    end\n    if <(speed y) < (fall)> then\n        set [speed y v] to (fall)\n    end\n    if <<key (space v) pressed?> and <(dash) = [100]>> then\n        repeat (5)\n            change [speed x v] by ((direction) / (10))\n        end\n        set [dash v] to [0]\n    end\n    if <(dash) < [100]> then\n        change [dash v] by (1)\n    end\nend\nif <(speed x) < [0]> then\n    point in direction (-90)\nelse\n    point in direction (90)\nend\n\nwhen I receive [walljump v]\nwait until <([abs v] of (speed x) ) < [2]>\nset [walljump v] to []\n\nwhen I receive [start v]\nforever\n    Animation\nend\n\ndefine Animation\nif <(STATE) = [slide]> then\n    set [state v] to [slide]\nelse\n    if <(dash) < [50]> then\n        set [state v] to [dash]\n    else\n        if <(speed y) < [-5]> then\n            set [state v] to [fall]\n        else\n            if <(speed y) > [0]> then\n                set [state v] to [jump]\n            else\n                if <([abs v] of (speed x) ) > [1]> then\n                    set [state v] to [walk]\n                else\n                    set [state v] to [idle]\n                end\n            end\n        end\n    end\nend\nif <(STATE) = [slide]> then\n    Frame [11] [1] []\nelse\n    if <(STATE) = [fall]> then\n        Frame [10] [1] []\n    else\n        if <(STATE) = [jump]> then\n            Frame [9] [1] []\n        else\n            if <(STATE) = [dash]> then\n                Frame [12] [1] []\n            else\n                if <(STATE) = [walk]> then\n                    Frame [13] [8] (([abs v] of (speed x) ) / (20))\n                else\n                    Frame [1] [8] [0.3]\n                end\n            end\n        end\n    end\nend\nset rotation style [left-right v]\nset [state v] to []\n\ndefine Frame (start) (total) (speed)\nswitch costume to (idle v)\nswitch costume to ([floor v] of ((start) + ((frame) mod (total))) )\nchange [frame v] by (speed)\nif <(frame) > [1000]> then\n    set [frame v] to [0]\nend\n\ndefine Camera\nchange [x v] by ((x position) - (old x))\nchange [y v] by ((y position) - (old y))\nchange [scroll x v] by (round (((x) - (SCROLL X)) / (5)))\nchange [scroll y v] by (round (((y) - (SCROLL Y)) / (2)))\nif <(SCROLL X) < [480]> then\n    set [scroll x v] to [480]\nend\nif <(SCROLL X) > [2000]> then\n    set [scroll x v] to [2000]\nend\nif <(SCROLL Y) < [360]> then\n    set [scroll y v] to [360]\nend\ngo to x: ((x) + ((0) - (SCROLL X))) y: ((y) + ((0) - (SCROLL Y)))\n\nwhen I receive [setup v]\nif <(LEVEL) = [1]> then\n    set [player spawn x v] to [400]\n    set [player spawn y v] to [1060]\nelse\n    set [player spawn x v] to [400]\n    set [player spawn y v] to [1060]\nend\nbroadcast (Respawn v)\n\nwhen I receive [start v]\nforever\n    if <touching (danger v)?> then\n        broadcast (Respawn v)\n    end\nend\n\nwhen I receive [respawn v]\nset [respawn v] to [yes]\nbroadcast (Reset v)\nset [ghost v] effect to (100)\nset [x v] to (PLAYER SPAWN X)\nset [y v] to (PLAYER SPAWN Y)\nwait (1) seconds\nset [respawn v] to [no]\nclear graphic effects\nrepeat (5)\n    repeat (5)\n        change [brightness v] effect by (10)\n    end\n    clear graphic effects\nend\nclear graphic effects\n\n@Level\n\ndefine Level\ndelete all of [level v]\nif <(LEVEL) = [1]> then\n    add [0,0] to [level v]\n    add [0,1] to [level v]\n    add [0,2] to [level v]\n    add [1,0] to [level v]\n    add [1,1] to [level v]\n    add [1,2] to [level v]\n    add [2,0] to [level v]\n    add [2,1] to [level v]\n    add [2,2] to [level v]\n    add [3,0] to [level v]\n    add [3,1] to [level v]\n    add [3,2] to [level v]\nelse\n    add [0,0] to [level v]\n    add [0,1] to [level v]\n    add [0,2] to [level v]\n    add [1,0] to [level v]\n    add [1,1] to [level v]\n    add [1,2] to [level v]\n    add [2,0] to [level v]\n    add [2,1] to [level v]\n    add [2,2] to [level v]\n    add [3,0] to [level v]\n    add [3,1] to [level v]\n    add [3,2] to [level v]\nend\n\nwhen I start as a clone\ngo to [front v] layer\nforever\n    Tile (((tile column) * (480)) - (SCROLL X)) (((tile row) * (360)) - (SCROLL Y))\nend\n\ndefine Tile (x) (y)\ngo to x: (x) y: (y)\nswitch costume to (0,0 v)\nif <<(x position) = (x)> and <(y position) = (y)>> then\n    if <<<(tile column) > [0]> and <(tile row) > [0]>> and <<(tile column) < ((LEVEL WIDTH) + (1))> and <(tile row) < ((LEVEL HEIGHT) + (1))>>> then\n        show\n        switch costume to (item ((((tile column) * (LEVEL HEIGHT)) - (LEVEL HEIGHT)) + (tile row)) of [level v])\n    else\n        hide\n    end\nelse\n    hide\nend\nif <(x) > [480]> then\n    change [tile column v] by (-2)\nend\nif <(x) < [-480]> then\n    change [tile column v] by (2)\nend\nif <(y) > [360]> then\n    change [tile row v] by (-2)\nend\nif <(y) < [-360]> then\n    change [tile row v] by (2)\nend\n\nwhen I receive [start v]\nLevel\nset [level width v] to [4]\nset [level height v] to [3]\nset [tile column v] to [1]\nset [tile row v] to [1]\ncreate clone of (_myself_ v)\nset [tile column v] to [1]\nset [tile row v] to [2]\ncreate clone of (_myself_ v)\nset [tile column v] to [2]\nset [tile row v] to [1]\ncreate clone of (_myself_ v)\nset [tile column v] to [2]\nset [tile row v] to [2]\ncreate clone of (_myself_ v)\n\nwhen I receive [new level v]\ndelete this clone\n\n@Level Hitbox\n\nwhen I start as a clone\nforever\n    Tile (((tile column) * (480)) - (SCROLL X)) (((tile row) * (360)) - (SCROLL Y))\nend\n\ndefine Tile (x) (y)\ngo to x: (x) y: (y)\nswitch costume to (0,2 v)\nif <<(x position) = (x)> and <(y position) = (y)>> then\n    if <<<(tile column) > [0]> and <(tile row) > [0]>> and <<(tile column) < ((LEVEL WIDTH) + (1))> and <(tile row) < ((LEVEL HEIGHT) + (1))>>> then\n        show\n        switch costume to (item ((((tile column) * (LEVEL HEIGHT)) - (LEVEL HEIGHT)) + (tile row)) of [level v])\n    else\n        hide\n    end\nelse\n    hide\nend\nif <(x) > [480]> then\n    change [tile column v] by (-2)\nend\nif <(x) < [-480]> then\n    change [tile column v] by (2)\nend\nif <(y) > [360]> then\n    change [tile row v] by (-2)\nend\nif <(y) < [-360]> then\n    change [tile row v] by (2)\nend\n\nwhen I receive [start v]\nLevel\nset [ghost v] effect to (100)\nset [level width v] to [4]\nset [level height v] to [3]\nset [tile column v] to [1]\nset [tile row v] to [1]\ncreate clone of (_myself_ v)\nset [tile column v] to [1]\nset [tile row v] to [2]\ncreate clone of (_myself_ v)\nset [tile column v] to [2]\nset [tile row v] to [1]\ncreate clone of (_myself_ v)\nset [tile column v] to [2]\nset [tile row v] to [2]\ncreate clone of (_myself_ v)\n\ndefine Level\ndelete all of [level v]\nif <(LEVEL) = [1]> then\n    add [0,0] to [level v]\n    add [0,1] to [level v]\n    add [0,2] to [level v]\n    add [1,0] to [level v]\n    add [1,1] to [level v]\n    add [1,2] to [level v]\n    add [2,0] to [level v]\n    add [2,1] to [level v]\n    add [2,2] to [level v]\n    add [3,0] to [level v]\n    add [3,1] to [level v]\n    add [3,2] to [level v]\nelse\n    add [0,0] to [level v]\n    add [0,1] to [level v]\n    add [0,2] to [level v]\n    add [1,0] to [level v]\n    add [1,1] to [level v]\n    add [1,2] to [level v]\n    add [2,0] to [level v]\n    add [2,1] to [level v]\n    add [2,2] to [level v]\n    add [3,0] to [level v]\n    add [3,1] to [level v]\n    add [3,2] to [level v]\nend\n\nwhen I receive [new level v]\ndelete this clone\n\n@Checkpoint\n\nwhen I receive [start v]\nshow\nswitch costume to (costume1 v)\nset size to (600) %\nset [last checkpoint v] to [1]\n\ndefine Go to (x) (y)\ngo to x: (x) y: (y)\nif <<(x position) = (x)> and <(y position) = (y)>> then\n    if <(show) = [yes]> then\n        show\n    else\n        hide\n    end\nelse\n    hide\nend\ngo to [front v] layer\n\nwhen I receive [setup v]\ndelete all of [checkpoint x v]\ndelete all of [checkpoint y v]\nif <(LEVEL) = [1]> then\n    Checkpoint [1085] [1212]\nelse\n    Checkpoint [1085] [1212]\nend\nCycle Checkpoints\n\ndefine Checkpoint (x) (y)\nadd (x) to [checkpoint x v]\nadd (y) to [checkpoint y v]\n\ndefine Cycle Checkpoints\nwait (1) seconds\nforever\n    wait until <touching (player v)?>\n    if <(last checkpoint) > (length of [checkpoint x v])> then\n        set [show v] to [no]\n    else\n        set [show v] to [yes]\n        switch costume to (costume2 v)\n        set [player spawn x v] to (checkpoint x)\n        set [player spawn y v] to (checkpoint y)\n        wait (1) seconds\n        repeat (10)\n            change [ghost v] effect by (10)\n        end\n        change [last checkpoint v] by (1)\n        wait (0.01) seconds\n        clear graphic effects\n        switch costume to (costume1 v)\n    end\nend\n\nwhen I receive [tick v]\nGo to (((SCROLL X) - (checkpoint x)) * (-1)) (((SCROLL Y) - (checkpoint y)) * (-1))\nset [checkpoint x v] to (item (last checkpoint) of [checkpoint x v])\nset [checkpoint y v] to (item (last checkpoint) of [checkpoint y v])\n\n@Danger\n\ndefine Clone (x) (y)\nset [x v] to (x)\nset [y v] to (y)\ncreate clone of (_myself_ v)\n\nwhen I receive [setup v]\nif <(LEVEL) = [1]> then\n    Clone [1375] [607]\n    Clone [1448] [607]\n    Clone [1521] [607]\nelse\n    Clone [1375] [607]\n    Clone [1448] [607]\n    Clone [1521] [607]\nend\n\ndefine Go to (x) (y)\ngo to x: (x) y: (y)\nif <<([abs v] of ((x) - (x position)) ) < [15]> and <([abs v] of ((y) - (y position)) ) < [15]>> then\n    show\nelse\n    hide\nend\n\nwhen I start as a clone\nshow\ngo to [front v] layer\nforever\n    Go to (((SCROLL X) - (x)) * (-1)) (((SCROLL Y) - (y)) * (-1))\nend\n\nwhen I receive [new level v]\ndelete this clone\n\n@End\n\nwhen I receive [start v]\nset size to (600) %\n\nwhen I receive [setup v]\nif <(LEVEL) = [1]> then\n    set [x v] to [2150]\n    set [y v] to [1175]\nelse\n    set [x v] to [2150]\n    set [y v] to [1175]\nend\n\nwhen I receive [start v]\nwait until <touching (player v)?>\nwait (1) seconds\nchange [level v] by (1)\nbroadcast (New Level v)\nbroadcast (Setup v)\nbroadcast (Start v)\n\ndefine Go to (x) (y)\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    hide\nend\n\nwhen I receive [tick v]\nGo to (((SCROLL X) - (x)) * (-1)) ((((SCROLL Y) - (y)) * (-1)) + (([sin v] of ((timer) * (100)) ) * (10)))\n\n@Background\n\ndefine Level\ndelete all of [level v]\nif <(LEVEL) = [1]> then\n    add [0,0] to [level v]\n    add [0,1] to [level v]\n    add [0,2] to [level v]\n    add [1,0] to [level v]\n    add [1,1] to [level v]\n    add [1,2] to [level v]\n    add [2,0] to [level v]\n    add [2,1] to [level v]\n    add [2,2] to [level v]\n    add [3,0] to [level v]\n    add [3,1] to [level v]\n    add [3,2] to [level v]\nelse\n    add [0,0] to [level v]\n    add [0,1] to [level v]\n    add [0,2] to [level v]\n    add [1,0] to [level v]\n    add [1,1] to [level v]\n    add [1,2] to [level v]\n    add [2,0] to [level v]\n    add [2,1] to [level v]\n    add [2,2] to [level v]\n    add [3,0] to [level v]\n    add [3,1] to [level v]\n    add [3,2] to [level v]\nend\n\nwhen I receive [start v]\nLevel\nset [level width v] to [4]\nset [level height v] to [3]\nset [tile column v] to [1]\nset [tile row v] to [1]\ncreate clone of (_myself_ v)\nset [tile column v] to [1]\nset [tile row v] to [2]\ncreate clone of (_myself_ v)\nset [tile column v] to [2]\nset [tile row v] to [1]\ncreate clone of (_myself_ v)\nset [tile column v] to [2]\nset [tile row v] to [2]\ncreate clone of (_myself_ v)\n\nwhen I start as a clone\ngo to [back v] layer\ngo [forward v] (1) layers\nforever\n    Tile (((tile column) * (480)) - (((SCROLL X) / (1.5)) + (100))) (((tile row) * (360)) - (((SCROLL Y) / (1.5)) + (350)))\nend\n\ndefine Tile (x) (y)\ngo to x: (x) y: (y)\nswitch costume to (0,0 v)\nif <<(x position) = (x)> and <(y position) = (y)>> then\n    if <<<(tile column) > [0]> and <(tile row) > [0]>> and <<(tile column) < ((LEVEL WIDTH) + (1))> and <(tile row) < ((LEVEL HEIGHT) + (1))>>> then\n        show\n        switch costume to (item ((((tile column) * (LEVEL HEIGHT)) - (LEVEL HEIGHT)) + (tile row)) of [level v])\n    else\n        hide\n    end\nelse\n    hide\nend\nif <(x) > [480]> then\n    change [tile column v] by (-2)\nend\nif <(x) < [-480]> then\n    change [tile column v] by (2)\nend\nif <(y) > [360]> then\n    change [tile row v] by (-2)\nend\nif <(y) < [-360]> then\n    change [tile row v] by (2)\nend\n\nwhen I receive [new level v]\ndelete this clone\n\n@Background2\n\nwhen flag clicked\nhide\nset [x v] to [0]\nset [y v] to [1300]\ncreate clone of (_myself_ v)\nchange [x v] by (480)\ncreate clone of (_myself_ v)\n\nwhen I start as a clone\nshow\nforever\n    go to [back v] layer\n    go to x: ((((((SCROLL X) / (8)) - (x)) * (-1)) mod (960)) - (480)) y: ((((SCROLL Y) - (y)) * (-1)) / (8))\nend\n\n@Thumbnail\n\nwhen flag clicked\ngo to x: (0) y: (0)\ngo to [front v] layer\nset [ghost v] effect to (100)\nshow\n\n