Button -a platformer- 1


@Stage\n\n@player\n\ndefine colors\nif <touching color (#ff9400)?> then\n    if <(colors touch?) = [1]> then\n        set [colors touch? v] to [0]\n        set [open door: orange v] to ((open door: ORANGE) * (-1))\n    end\nend\nif <touching color (#003fff)?> then\n    if <(colors touch?) = [1]> then\n        set [colors touch? v] to [0]\n        set [open door: blue v] to ((open door: BLUE) * (-1))\n    end\nend\nif <touching color (#7f00ff)?> then\n    if <(colors touch?) = [1]> then\n        set [colors touch? v] to [0]\n        set [open door: purple v] to ((open door: PURPLE) * (-1))\n    end\nend\nif <touching color (#00ff55)?> then\n    if <(colors touch?) = [1]> then\n        set [colors touch? v] to [0]\n        set [open door: green v] to ((open door: GREEN) * (-1))\n    end\nend\nif <<touching color (#003fff)?> or <<touching color (#ff9400)?> or <<touching color (#7f00ff)?> or <<touching color (#00ff55)?> or >>>> then\n    set [colors touch? v] to [0]\nelse\n    set [colors touch? v] to [1]\nend\n\nwhen I receive [start:game v]\ngo to x: (-200) y: (-133)\nerase all\nset [xv v] to [0]\nset [yv v] to [0]\nset [level v] to [1]\nforever\n    show\n    if <key (right arrow v) pressed?> then\n        change [xv v] by (1)\n    end\n    if <key (left arrow v) pressed?> then\n        change [xv v] by (-1)\n    end\n    set [xv v] to ((Xv) * (0.9))\n    go to [front v] layer\n    change x by (Xv)\n    if <touching color (#000000)?> then\n        change y by (1)\n        if <touching color (#000000)?> then\n            change y by (1)\n            if <touching color (#000000)?> then\n                change y by (1)\n                if <touching color (#000000)?> then\n                    change y by (1)\n                    if <touching color (#000000)?> then\n                        change y by (1)\n                        if <touching color (#000000)?> then\n                            change x by ((Xv) * (-1))\n                            change y by (-5)\n                            if <key (up arrow v) pressed?> then\n                                if <(Xv) > [0]> then\n                                    set [xv v] to [-5]\n                                else\n                                    set [xv v] to [5]\n                                end\n                                set [yv v] to [10]\n                            else\n                                set [xv v] to [0]\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\n    change [yv v] by (-1)\n    change y by (Yv)\n    if <touching color (#000000)?> then\n        change y by ((Yv) * (-1))\n        set [yv v] to [0]\n    end\n    change y by (-1)\n    if <touching color (#000000)?> then\n        point in direction (90)\n        if <key (up arrow v) pressed?> then\n            set [yv v] to [15]\n        end\n    else\n    end\n    change y by (1)\n    if <(x position) > [238]> then\n        go to x: (-200) y: (-133)\n        change [level v] by (1)\n        set [open door: orange v] to [1]\n        set [open door: blue v] to [1]\n        set [open door: purple v] to [1]\n        set [open door: green v] to [1]\n    end\n    if <(y position) < [-170]> then\n        go to x: (-200) y: (-133)\n    end\n    if <<key (r v) pressed?> or <touching color (#ff00bf)?>> then\n        go to x: (-200) y: (-133)\n        set [open door: orange v] to [1]\n        set [open door: blue v] to [1]\n        set [open door: purple v] to [1]\n        set [open door: green v] to [1]\n    end\n    if <touching color (#ff0000)?> then\n        set [yv v] to [15]\n    end\n    colors\nend\n\nwhen I receive [start:game v]\nforever\n    play sound [funk_warte_terrasound.mp3 v] until done\nend\n\nwhen I receive [start:all v]\nhide\n\nset [yv v] to [0]\nset [level v] to [1]\nforever\n    show\n    if <key (right arrow v) pressed?> then\n        change [xv v] by (1)\n    end\n    if <key (left arrow v) pressed?> then\n        change [xv v] by (-1)\n    end\n    set [xv v] to ((Xv) * (0.9))\n    go to [front v] layer\n    change x by (Xv)\n    if <touching color (#000000)?> then\n        change y by (1)\n        if <touching color (#000000)?> then\n            change y by (1)\n            if <touching color (#000000)?> then\n                change y by (1)\n                if <touching color (#000000)?> then\n                    change y by (1)\n                    if <touching color (#000000)?> then\n                        change y by (1)\n                        if <touching color (#000000)?> then\n                            change x by ((Xv) * (-1))\n                            change y by (-5)\n                            if <key (up arrow v) pressed?> then\n                                if <(Xv) > [0]> then\n                                    set [xv v] to [-5]\n                                else\n                                    set [xv v] to [5]\n                                end\n                                set [yv v] to [10]\n                            else\n                                set [xv v] to [0]\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\n    change [yv v] by (-1)\n    change y by (Yv)\n    if <touching color (#000000)?> then\n        change y by ((Yv) * (-1))\n        set [yv v] to [0]\n    end\n    change y by (-1)\n    if <touching color (#000000)?> then\n        point in direction (90)\n        if <key (up arrow v) pressed?> then\n            set [yv v] to [15]\n        end\n    end\n    change y by (1)\n    if <(x position) > [238]> then\n        go to x: (-200) y: (-133)\n        change [level v] by (1)\n        set [open door: orange v] to [1]\n        set [open door: blue v] to [1]\n        set [open door: purple v] to [1]\n        set [open door: green v] to [1]\n    end\n    if <(y position) < [-170]> then\n        go to x: (-200) y: (-133)\n    end\n    if <<key (r v) pressed?> or <touching color (#ff00bf)?>> then\n        go to x: (-200) y: (-133)\n        set [open door: orange v] to [1]\n        set [open door: blue v] to [1]\n        set [open door: purple v] to [1]\n        set [open door: green v] to [1]\n    end\n    if <touching color (#ff0000)?> then\n        set [yv v] to [15]\n    end\n    colors\nend\n\n@ground\n\nwhen I receive [start:game v]\nforever\n    go to x: (0) y: (0)\n    switch costume to (Level)\n    clear graphic effects\n    show\nend\n\nwhen I receive [start:all v]\nhide\n\n@doors\n\ndefine None\nif <(Level) = (?)> then\n    point in direction (??)\n    go to x: (x) y: (y)\n    switch costume to (???)\n    if <(???) = [1]> then\n        if <(open door: ORANGE) = (????)> then\n            show\n            go [backward v] (3) layers\n        else\n            switch costume to (0 v)\n        end\n    else\n        if <(???) = [2]> then\n            if <(open door: BLUE) = (????)> then\n                show\n                go [backward v] (3) layers\n            else\n                switch costume to (0 v)\n            end\n        else\n            if <(???) = [3]> then\n                if <(open door: PURPLE) = (????)> then\n                    show\n                    go [backward v] (3) layers\n                else\n                    switch costume to (0 v)\n                end\n            else\n                if <(???) = [4]> then\n                    if <(open door: GREEN) = (????)> then\n                        show\n                        go [backward v] (3) layers\n                    else\n                        switch costume to (0 v)\n                    end\n                else\n                end\n            end\n        end\n    end\n    stamp\nelse\n    hide\nend\n\nwhen I receive [start:game v]\nforever\n    erase all\n    falls level = (4) dann gehe zu (235) (-115) und wechsle zu Kostüm (1) richtung (90) anfang [1]\n    falls level = (5) dann gehe zu (235) (-140) und wechsle zu Kostüm (1) richtung (90) anfang [1]\n    falls level = (5) dann gehe zu (-15) (20) und wechsle zu Kostüm (2) richtung (90) anfang [1]\n    falls level = (6) dann gehe zu (-45) (-73) und wechsle zu Kostüm (2) richtung (0) anfang [1]\n    falls level = (6) dann gehe zu (97) (160) und wechsle zu Kostüm (1) richtung (90) anfang [1]\n    falls level = (7) dann gehe zu (236) (-110) und wechsle zu Kostüm (1) richtung (90) anfang [1]\n    falls level = (7) dann gehe zu (130) (130) und wechsle zu Kostüm (2) richtung (45) anfang [1]\n    falls level = (8) dann gehe zu (-45) (-73) und wechsle zu Kostüm (2) richtung (0) anfang [1]\n    falls level = (8) dann gehe zu (97) (160) und wechsle zu Kostüm (1) richtung (90) anfang [1]\n    falls level = (9) dann gehe zu (-270) (25) und wechsle zu Kostüm (1) richtung (0) anfang [1]\n    falls level = (9) dann gehe zu (100) (-130) und wechsle zu Kostüm (3) richtung (90) anfang [1]\n    falls level = (9) dann gehe zu (160) (-130) und wechsle zu Kostüm (2) richtung (90) anfang [1]\n    falls level = (9) dann gehe zu (60) (60) und wechsle zu Kostüm (4) richtung (-30) anfang [1]\n    falls level = (10) dann gehe zu (20) (-40) und wechsle zu Kostüm (1) richtung (90) anfang [-1]\n    falls level = (10) dann gehe zu (100) (-40) und wechsle zu Kostüm (2) richtung (90) anfang [-1]\n    falls level = (11) dann gehe zu (-100) (-80) und wechsle zu Kostüm (1) richtung (0) anfang [-1]\n    falls level = (11) dann gehe zu (-100) (0) und wechsle zu Kostüm (2) richtung (0) anfang [-1]\n    falls level = (12) dann gehe zu (233) (-100) und wechsle zu Kostüm (1) richtung (90) anfang [1]\n    falls level = (13) dann gehe zu (0) (-20) und wechsle zu Kostüm (1) richtung (0) anfang [-1]\nend\n\nwhen I receive [start:all v]\nhide\n\n@Level\n\nwhen I start as a clone\nforever\n    switch costume to (letter (1) of (Level))\n    go to x: (Level: x-pos) y: (Level: y-pos)\nend\n\ndefine None\nset [level v] to (score)\nset [level: x-pos v] to (x)\nset [level: y-pos v] to (y)\ngo to x: ((x) + (((length of (score)) - (1)) * (20))) y: (y)\nswitch costume to (letter (length of (score)) of (score))\nshow\nset size to (300) %\nif <(length Level) < (length of (score))> then\n    set [length level v] to (length of (score))\n    create clone of (_myself_ v)\nend\n\nwhen I receive [start:game v]\nset [length level v] to [1]\nforever\n    write (Level) at (-200) (150)\nend\n\nwhen I receive [start:all v]\nhide\n\n@play\n\nwhen I receive [start:menu v]\nwait (0) seconds\nset volume to (100) %\nforever\n    play sound [liquid-energy_terrasound_de.mp3 v] until done\nend\n\nwhen I receive [start:all v]\nbroadcast (start:menu v)\n\nwhen flag clicked\nbroadcast (start:all v)\n\nwhen I receive [start:menu v]\nclear graphic effects\nshow\nswitch costume to (kostüm2 v)\nset size to (100) %\nerase all\ngo to x: (0) y: (0)\nstamp\nswitch costume to (kostüm1 v)\ngo to x: (-240) y: (40)\nset size to (90) %\nset [play: speed v] to [13]\nrepeat (50)\n    change x by (Play: speed)\n    set [play: speed v] to ((Play: speed) * (0.95))\nend\nchange x by (0)\nrepeat until <<touching (mouse-pointer v)?> and <mouse down?>>\n    if <touching (mouse-pointer v)?> then\n        set size to (110) %\n    else\n        set size to (90) %\n    end\nend\nset [play: speed v] to [1]\nrepeat (50)\n    change volume by (-2)\n    change x by (Play: speed)\n    set [play: speed v] to ((Play: speed) * (1.05))\n    set size to (90) %\nend\nbroadcast (start:game v)\nhide\nstop [other scripts in sprite v]\n\n