platformer creator
@Stage\n\nwhen flag clicked\nforever\n    play sound [Xyan v] until done\nend\n\nwhen flag clicked\nforever\n    set volume to (volume) %\nend\n\n@blank\n\n@ pixel\n\nwhen [1 v] key pressed\nset [tool v] to [1]\n\nwhen [2 v] key pressed\nset [tool v] to [2]\n\nwhen [3 v] key pressed\nset [tool v] to [3]\n\nwhen [5 v] key pressed\nif <(allowed) = [1]> then\n    set [tool v] to [5]\nelse\n    broadcast (not allowed v)\nend\n\nwhen I receive [editor v]\nshow\n\nwhen [6 v] key pressed\nset [tool v] to [9]\n\nwhen [7 v] key pressed\nset [tool v] to [7]\n\nwhen [4 v] key pressed\nset [tool v] to [4]\n\nwhen I receive [level done! v]\nset [tool v] to [10]\n\nwhen flag clicked\ngrid\n\ndefine grid\nswitch costume to (a v)\ngo to x: (-212) y: (120)\nrepeat (12)\n    repeat (18)\n        create clone of (_myself_ v)\n        change x by (25)\n    end\n    set x to (-212)\n    change y by (-25)\nend\n\nwhen flag clicked\nset [touch v] to [0]\nset [number of clones v] to [1]\nforever\n    hide\nend\n\nwhen I start as a clone\nchange [number of clones v] by (1)\nset [clone # v] to (number of clones)\nset size to (160) %\nshow\nforever\n    if <<<not <(touch) = [1]>> and <(playing) = [0]>> and <(s-open) = [0]>> then\n        if <(clone deletion) = [1]> then\n            switch costume to (a v)\n        end\n        if <<mouse down?> and <touching (mouse-pointer v)?>> then\n            if <(touch) = [0]> then\n                go to [front v] layer\n                switch costume to (tool)\n            end\n        end\n        if <(costume [name v]) = [h]> then\n            set [xs v] to (x position)\n            set [ys v] to (y position)\n        end\n    end\nend\n\nwhen I start as a clone\nwait until <(BEGIN LOAD) = [1]>\nwait until <(clone #) = (load #)>\nswitch costume to (letter #)\n\nwhen I receive [load!! v]\nwait (1) seconds\nset [load # v] to [1]\nset [letter # v] to []\nset [begin load v] to [1]\n\nwhen flag clicked\nset [xs v] to [-186]\nset [ys v] to [0]\nset [begin load v] to [0]\n\nwhen flag clicked\nwait until <(BEGIN LOAD) = [1]>\nwait (0.5) seconds\nrepeat (length of (answer))\n    set [letter # v] to (letter (load #) of (answer))\n    change [load # v] by (1)\nend\nwait (0.1) seconds\nset [begin load v] to [0]\n\nwhen I receive [hide v]\nset [touch v] to [1]\n\nwhen I receive [lkd23ef v]\nset [touch v] to [1]\nwait (0.3) seconds\nset [touch v] to [0]\n\nwhen [8 v] key pressed\nset [tool v] to [8]\n\nwhen flag clicked\nset [playing v] to [0]\n\nwhen I receive [editor v]\nset [playing v] to [0]\n\nwhen I receive [start v]\nset [playing v] to [1]\n\nset [allowed v] to [0]\n\nwhen flag clicked\nset [tool v] to [1]\n\n@level done\n\nwhen I receive [level done! v]\nstart sound [Tada v]\nset [1/0 v] to [0]\ngo to x: (0) y: (0)\nswitch costume to (costume2 v)\ncreate clone of (_myself_ v)\nshow\nswitch costume to (costume1 v)\nrepeat (25)\n    change size by (((100) - (size)) * (0.3))\nend\nrepeat until <(1/0) = [1]>\n    set [touch v] to [1]\n    if <touching (mouse-pointer v)?> then\n        go to [front v] layer\n    else\n        go to [front v] layer\n        wait (0.3) seconds\n    end\nend\nhide\nset [tool v] to [1]\nset [touch v] to [1]\nbroadcast (lkd23ef v)\ndelete this clone\n\nwhen I start as a clone\nshow\ngo to [front v] layer\nset y to (-65)\nrepeat until <(size) = [100]>\n    change size by (((100) - (size)) * (0.3))\n    go to [front v] layer\nend\nforever\n    set [touch v] to [1]\n    go to [front v] layer\n    if <touching (mouse-pointer v)?> then\n        change size by (((120) - (size)) * (0.3))\n    else\n        change size by (((100) - (size)) * (0.3))\n    end\n    if <<touching (mouse-pointer v)?> and <mouse down?>> then\n        broadcast (hide v)\n        hide\n        set [1/0 v] to [1]\n        delete this clone\n    end\nend\n\nwhen I receive [hide v]\nset [touch v] to [0]\nset size to (0) %\ngo to x: (0) y: (0)\nset [1/0 v] to [1]\nhide\ndelete this clone\n\nwhen I receive [start v]\nset [touch v] to [0]\nset size to (0) %\ngo to x: (0) y: (0)\nset [1/0 v] to [1]\nhide\ndelete this clone\n\nwhen flag clicked\nhide\n\nwhen I receive [hide v]\nhide\n\nwhen I receive [level done! v]\nrepeat until <(1/0) = [1]>\n    go to [front v] layer\nend\n\n@delete\n\nwhen this sprite clicked\nset [clone deletion v] to [1]\nwait (0.2) seconds\nset [clone deletion v] to [0]\n\nwhen flag clicked\nset [clone deletion v] to [0]\n\n@player\n\ndefine move - in steps (steps)\nchange [falling v] by (1)\nrepeat (steps)\n    set [last value v] to (x position)\n    change x by ((speed x) / (steps))\n    if <<<<touching color (#5ab73a)?> or <touching color (#614931)?>> or <touching color (#98734e)?>> or <touching color (#85b7d6)?>> then\n        set x to (last value)\n        set [speed x v] to [0]\n    end\n    set [last value v] to (y position)\n    change y by ((speed y) / (steps))\n    if <<<<touching color (#5ab73a)?> or <touching color (#614931)?>> or <touching color (#98734e)?>> or <touching color (#85b7d6)?>> then\n        set y to (last value)\n        if <(speed y) < [0]> then\n            set [falling v] to [0]\n        end\n        set [speed y v] to [0]\n    end\n    if <touching color (#ffd200)?> then\n        set [speed y v] to [15]\n    end\n    if <touching color (#ff0000)?> then\n        broadcast (start v)\n    end\n    if <(y position) < [-179]> then\n        broadcast (start v)\n    end\n    if <<touching color (#a6a6a6)?> or <touching color (#d4d4d4)?>> then\n        broadcast (start v)\n    end\n    if <<touching color (#ffffff)?> or <touching color (#000000)?>> then\n        set [playing v] to [0]\n        broadcast (level done! v)\n        broadcast (editor v)\n    end\nend\n\nwhen I receive [start v]\nshow\nset [speed x v] to [0]\nset [resistance v] to ((speed) / (100))\nset [gravity v] to [-1.2]\nset [jump force v] to (jump height)\nset [acceleration v] to [1.6]\nset [speed y v] to [0]\ngo to x: (xs) y: (ys)\nforever\n    if <<<key (up arrow v) pressed?> or <key (w v) pressed?>> or <<mouse down?> and <(mouse y) > (y position)>>> then\n        if <(falling) < [3]> then\n            set [speed y v] to (JUMP FORCE)\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        change [speed x v] by ((0) - (ACCELERATION))\n    end\n    if <<<key (right arrow v) pressed?> or <key (d v) pressed?>> or <<mouse down?> and <(mouse x) > (x position)>>> then\n        change [speed x v] by (ACCELERATION)\n    end\n    set [speed x v] to ((speed x) * (RESISTANCE))\n    change [speed y v] by (GRAVITY)\n    go to [front v] layer\n    move - in steps (([abs v] of (speed x) ) + ([abs v] of (speed y) ))\nend\n\nwhen flag clicked\nset [jump height v] to [9]\nset [speed v] to [75]\nset [volume v] to [60]\nbroadcast (editor v)\n\nwhen I receive [editor v]\nhide\nstop [other scripts in sprite v]\n\nwhen flag clicked\nforever\n    set [resistance v] to ((speed) / (100))\n    set [jump force v] to (jump height)\nend\n\n@settings-button\n\nwhen this sprite clicked\nbroadcast (lkd23ef v)\nif <(s-open) = [0]> then\n    broadcast (settings v)\n    switch costume to (costume2 v)\nend\nif <(s-open) = [1]> then\n    switch costume to (costume1 v)\n    broadcast (cls settings v)\nend\n\nwhen flag clicked\nswitch costume to (costume1 v)\ngo to [front v] layer\n\ngo [backward v] (2) layers\n\nwhen flag clicked\nforever\n    if <(costume [number v]) = [2]> then\n        go to [front v] layer\n    end\nend\n\n@play!\n\nwhen flag clicked\ngo to x: (0) y: (-30)\nswitch costume to (costume2 v)\ncreate clone of (_myself_ v)\nswitch costume to (costume1 v)\nforever\n    if <<mouse down?> and <touching (mouse-pointer v)?>> then\n        start sound [start v]\n        broadcast (start v)\n        wait until <not <<mouse down?> and <touching (mouse-pointer v)?>>>\n    end\nend\n\nwhen I start as a clone\nswitch costume to (costume2 v)\nforever\n    if <<mouse down?> and <touching (mouse-pointer v)?>> then\n        start sound [editor v]\n        broadcast (editor v)\n        wait until <not <<mouse down?> and <touching (mouse-pointer v)?>>>\n    end\nend\n\n@SCANNER\n\nwhen I receive [scan v]\nset [makecode v] to [0]\nbroadcast (editor v)\nshow\nset size to (100) %\ngo to [front v] layer\nswitch costume to (grid2 v)\ngo to x: (-212) y: (120)\nset [ghost v] effect to (100)\nrepeat (12)\n    repeat (18)\n        broadcast (scan- v) and wait\n        change x by (25)\n    end\n    set x to (-212)\n    change y by (-25)\nend\nhide\nset [makecode v] to [1]\nstop [this script v]\n\nwhen flag clicked\nset [makecode v] to [0]\nhide\n\nwhen I receive [scan v]\ndelete all of [save list v]\nrepeat (217)\n\nwhen I receive [scan- v]\nif <touching color (#9edaff)?> then\n    add [a] to [save list v]\nend\nif <touching color (#5ab73a)?> then\n    add [b] to [save list v]\nend\nif <touching color (#98734e)?> then\n    add [c] to [save list v]\nend\nif <touching color (#ff0000)?> then\n    add [d] to [save list v]\nend\nif <touching color (#a6a6a6)?> then\n    add [e] to [save list v]\nend\nif <touching color (#ffd200)?> then\n    add [f] to [save list v]\nend\nif <touching color (#ffffff)?> then\n    add [g] to [save list v]\nend\nif <touching color (#9ecfff)?> then\n    add [h] to [save list v]\nend\n\n@save-button\n\nwhen this sprite clicked\nset [code 2 v] to []\nset [code v] to []\nset [counter v] to [0]\nset [load v] to [0]\nbroadcast (SCAN v)\ndelete all of [save list v]\nwait until <(makecode) = [1]>\ncode\n\nwhen flag clicked\ngo to [front v] layer\n\ndefine code\nrepeat (length of [save list v])\n    change [counter v] by (1)\n    set [code 2 v] to (item (counter) of [save list v])\n    set [code v] to (join (code) (code 2))\nend\ndelete all of [code v]\nadd (code) to [code v]\nadd [triple click to copy \(ctrl+c\)] to [code v]\nadd [click outside to close] to [code v]\nhide list [code v]\nset [touch v] to [1]\nwait until <mouse down?>\nwait (0.1) seconds\nbroadcast (lkd23ef v)\nshow list [code v]\n\nwhen flag clicked\nshow list [code v]\nset [code 2 v] to []\nset [code v] to []\nset [counter v] to [0]\nset [load v] to [0]\n\n@load-button\n\nwhen this sprite clicked\nask [CODE:] and wait\nbroadcast (load!! v)\n\nwhen flag clicked\ngo to [front v] layer\n\n@tools\n\nwhen flag clicked\nshow\n\nwhen I receive [editor v]\nshow\n\nwhen I receive [start v]\nhide\n\nwhen I receive [scan v]\nhide\n\nwhen flag clicked\nforever\n    go to [front v] layer\n    if <touching (mouse-pointer v)?> then\n        change [ghost v] effect by (25)\n    else\n        change [ghost v] effect by (-25)\n    end\nend\n\nwhen I receive [scan- v]\nhide\n\nwhen flag clicked\nforever\n    if <(allowed) = [1]> then\n        switch costume to (costume1 v)\n    else\n        switch costume to (costume2 v)\n    end\nend\n\n@thumbnail\n\nwhen flag clicked\nhide\n\n@messages\n\nwhen flag clicked\nhide\nforever\n    go to [front v] layer\n    change [ghost v] effect by (5)\nend\n\nwhen I receive [load!! v]\nswitch costume to (building... v)\nrepeat (250)\n    clear graphic effects\n    show\nend\n\nwhen I receive [scan v]\nswitch costume to (saving... v)\nrepeat (450)\n    clear graphic effects\n    show\nend\nswitch costume to (generating code... v)\nrepeat (200)\n    clear graphic effects\n    show\nend\n\nwhen I receive [not allowed v]\nswitch costume to (l/v v)\nrepeat (100)\n    clear graphic effects\n    show\nend\n\n@settings\n\nwhen I receive [settings v]\nshow\nshow variable [speed v]\nset [s-open v] to [1]\nshow variable [jump height v]\nshow variable [volume v]\n\nwhen flag clicked\nhide\nset [s-open v] to [0]\nhide variable [speed v]\nhide variable [jump height v]\nhide variable [volume v]\nforever\n    go to [front v] layer\nend\n\nwhen I receive [cls settings v]\nhide\nset [s-open v] to [0]\nhide variable [speed v]\nhide variable [jump height v]\nhide variable [volume v]\n\n@detector\n\nwhen flag clicked\nset drag mode [not draggable v]\nshow\nset [ghost v] effect to (100)\nforever\n    set [touching v] to [none]\n    Detect [love] at [-270] [-220]\n    Detect [fave] at [-220] [-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    if <(touching) = [love]> then\n        set [loved? v] to [1]\n    end\n    if <(touching) = [fave]> then\n        set [faved? v] to [1]\n    end\nend\n\nwhen flag clicked\nwait until <<(loved?) = [1]> and <(faved?) = [1]>>\nbroadcast (l/v v)\n\n@l/v\n\nwhen I receive [l/v v]\nset [allowed v] to [1]\nswitch costume to (costume1 v)\nshow\nwait (3) seconds\nhide\n\nwhen flag clicked\nif <(allowed) = [0]> then\n    switch costume to (costume2 v)\n    show\n    wait until <<(costume [number v]) = [2]> and <mouse down?>>\n    hide\nelse\n    hide\nend\n\nwhen flag clicked\nforever\n    go to [front v] layer\nend\n\nwhen flag clicked\nforever\n    if <touching (mouse-pointer v)?> then\n        broadcast (lkd23ef v)\n    end\nend\n\n
❤️ + ⭐ for a trampoline block!\nwelcome to platformer creator. in this project you can build your own platformers, and share them with other people using a code! \n\nhow to play:\n- press numbers on your keyboard to select tools.\n- press on part of the screen where you want to place \n  the tool.\n- to play, press the play button.\n- to save press the save button and you should wait 20 \n  seconds.\n- to load, press the load button and the level will show \n  up in a few seconds.\n\nthat's all information you need to know! i hope you like it!\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n