-Grassland - Platformer Engine

Instructions: 新作ゲーム公開！A new game has been released!\nhttps://scratch.mit.edu/projects/952054271/\n\nIf you press ❤️ and ⭐️, you can become invincible.\n❤️と⭐️で無敵になれます。\n↓見てね！Take a look！\nhttps://scratch.mit.edu/projects/968229789/\nControl with arrow keys or tap\nPlease score in the comments section!\nPromotion is for followers only\n矢印キーまたはタップで操作してください\nスコアはコメント欄で！\n宣伝はフォローしてからです

@Stage\n\nwhen I receive [play v]\nforever\n    play sound [Open Secrets v] until done\nend\n\n@Player\n\nwhen I receive [reset v]\nset [x velocity v] to [0]\nset [y velocity v] to [0]\nif <<(Level) = [9]> or <<(Level) = [16]> or <<(Level) = [17]> or <<(Level) = [24]> or <(Level) = [25]>>>>> then\n    go to x: (-198) y: (-90)\nelse\n    go to x: (-198) y: (0)\nend\n\ndefine trick\nif <<<key (up arrow v) pressed?> or <key (space v) pressed?>> or <<key (w v) pressed?> or <<mouse down?> and <(y position) < (mouse y)>>>> then\n    if <(size) = [7]> then\n        set [y velocity v] to [8]\n    else\n        set [y velocity v] to [10]\n    end\n    wait until <not <<key (up arrow v) pressed?> or <<key (space v) pressed?> or <<key (w v) pressed?> or <<mouse down?> and <(y position) < (mouse y)>>>>>>\nend\n\nwhen flag clicked\nforever\n    trick\nend\n\nwhen I receive [reset v]\nif <<(Level) = [11]> or <<(Level) = [15]> or <(Level) = [26]>>> then\n    set size to (10) %\nend\nif <<(Level) = [12]> or <<(Level) = [16]> or <(Level) = [18]>>> then\n    set size to (7) %\nend\n\nwhen I receive [play v]\nset size to (10) %\nbroadcast (Reset v)\nset [level v] to [1]\nforever\n    if <<key (right arrow v) pressed?> or <<key (d v) pressed?> or <<mouse down?> and <(x position) < (mouse x)>>>> then\n        switch costume to (player2 v)\n        if <(size) = [7]> then\n            change [x velocity v] by (1.75)\n        else\n            change [x velocity v] by (1.5)\n        end\n    end\n    if <<key (left arrow v) pressed?> or <<key (a v) pressed?> or <<mouse down?> and <(mouse x) < (x position)>>>> then\n        switch costume to (player3 v)\n        if <(size) = [7]> then\n            change [x velocity v] by (-1.75)\n        else\n            change [x velocity v] by (-1.5)\n        end\n    end\n    set [x velocity v] to ((X velocity) * (0.85))\n    change x by (X velocity)\n    if <touching (ground v)?> then\n        change y by (1)\n        if <touching (ground v)?> then\n            change y by (1)\n            if <touching (ground v)?> then\n                change y by (1)\n                if <touching (ground v)?> then\n                    change y by (1)\n                    if <touching (ground v)?> then\n                        change y by (-4)\n                        change x by ((X velocity) * (-1))\n                    end\n                end\n            end\n        end\n    end\n    change [y velocity v] by (-1)\n    change y by (Y velocity)\n    if <touching (ground v)?> then\n        change y by ((Y velocity) - ((Y velocity) * (2)))\n        set [y velocity v] to [0]\n    end\n    if <(x position) > [239]> then\n        change [level v] by (1)\n        broadcast (Reset v) and wait\n    end\n    if <[-174] > (y position)> then\n        broadcast (Reset v)\n    end\n    if <<touching (spikes v)?> or <key (r v) pressed?>> then\n        broadcast (Reset v)\n    end\n    if <touching (tiny portals v)?> then\n        set [restart v] to [1]\n        set size to (7) %\n    end\n    if <touching (normal portals v)?> then\n        set [restart v] to [0]\n        set size to (10) %\n    end\nend\n\nwhen I receive [play v]\nset [timer v] to [0]\nrepeat until <(Level) = [26]>\n    change [timer v] by (0.1)\n    wait (0.05) seconds\nend\n\nwhen I receive [play v]\nforever\n    repeat until <touching (ground v)?>\n        point in direction ((90) + (X velocity))\n    end\nend\n\nwhen flag clicked\nbroadcast (play v)\n\n@ground\n\nwhen flag clicked\nforever\n    switch costume to (Level)\nend\n\n@spikes\n\nwhen flag clicked\nforever\n    switch costume to (Level)\nend\n\n@tiny portals\n\nwhen flag clicked\nforever\n    switch costume to (Level)\nend\n\n@normal portals\n\nwhen flag clicked\nforever\n    switch costume to (Level)\nend\n\n@text\n\nwhen flag clicked\nforever\n    switch costume to (Level)\nend\n\nwhen I receive [play v]\nforever\n    if <touching (player v)?> then\n        set [ghost v] effect to (40)\n    else\n        set [ghost v] effect to (0)\n    end\nend\n\n@Thumbnail\n\nwhen [timer v] > (0)\nhide variable [level v]\nhide variable [timer v]\ngo to [front v] layer\nshow\n\nwhen flag clicked\nhide variable [level v]\nhide variable [timer v]\nhide\nforever\n    reset timer\nend\n\nwhen I receive [play v]\nshow variable [level v]\nshow variable [timer v]\n\n@your time\n\n@detector\n\nwhen flag clicked\nshow\nset [ghost v] effect to (100)\nset [actions \(love/fave\) v] to [0]\nforever\n    set [touching v] to [none]\n    Detect [love] at [-201] [-220]\n    Detect [fave] at [-201] [-220]\nend\n\ndefine Detect (thing) at (x) (y)\nswitch costume to (empty v)\nset size to (27000) %\ngo to x: (x) y: (y)\nset size to (100) %\nswitch costume to (thing)\nif <touching (mouse-pointer v)?> then\n    set [touching v] to (costume [name v])\nend\n\nwhen flag clicked\nforever\n    wait until <(touching) = [love]>\n    wait (0.2) seconds\n    if <(touching) = [love]> then\n        change [actions \(love/fave\) v] by (1)\n        stop [this script v]\n    end\nend\n\nwhen flag clicked\nforever\n    wait until <(touching) = [fave]>\n    wait (0.2) seconds\n    if <(touching) = [fave]> then\n        change [actions \(love/fave\) v] by (1)\n        stop [this script v]\n    end\nend\n\nwhen flag clicked\nforever\n    if <(Actions \(love/fave\)) = [2]> then\n        broadcast (Golden v)\n        stop [this script v]\n    end\nend\n\nwhen I receive [golden v]\nchange [timer v] by (-10)\n\n@Timer decreased 10 seconds\n\nwhen flag clicked\nhide\n\nwhen I receive [golden v]\nshow\nwait (2.5) seconds\nhide\n\n