Castle Hippo Plays Jumper (Platformer)


@Stage\n\nwhen flag clicked\nforever\n    play sound [Waterflame - Jumper.mp3 v] until done\nend\n\nwhen I receive [back v]\nswitch backdrop to (menu v)\n\nwhen flag clicked\nswitch backdrop to (menu v)\n\nwhen I receive [start v]\nswitch backdrop to (play v)\n\n@Play\n\nwhen I receive [start v]\nset [timer v] to [0]\nshow variable [timer v]\nshow variable [☁ highscore2 v]\nwait (1) seconds\n\n    change [timer v] by (0.1)\n    wait (0.1) seconds\n    if <(level) = [21]> then\n        if <(Timer) < (☁ Highscore2)> then\n            set [☁ highscore2 v] to (Timer)\n        end\n        stop [this script v]\n    end\n    if <(back) = [1]> then\n        hide variable [☁ highscore2 v]\n        hide variable [timer v]\n        stop [this script v]\n    end\nend\n\nwhen I receive [start v]\nset [play1 v] to [10]\n\n    change y by (play1)\n    change [play1 v] by (-2)\n    if <touching (_edge_ v)?> then\n        hide\n        stop [this script v]\n    end\nend\n\nwhen I receive [back v]\nbroadcast (start v)\nstop [this script v]\n\nwhen flag clicked\nforever\n    if <touching (mouse-pointer v)?> then\n        set size to (115) %\n    else\n        set size to (100) %\n    end\nend\n\nshow\ngo to x: (-2400) y: (-27)\nset [ghost v] effect to (80)\nrepeat (25)\n    change x by (((0) - (x position)) * (0.2))\n    change [ghost v] effect by (-10)\nend\n\n@MenuFade\n\nwhen I receive [back v]\nshow\ngo [backward v] (99999) layers\ngo to x: (-2400) y: (0)\nswitch costume to (pick random (1) to (4))\nset [ghost v] effect to (80)\nrepeat (25)\n    change x by (((2) - (x position)) * (0.2))\n    change [ghost v] effect by (-1)\n    go [backward v] (99999) layers\nend\nforever\n    go [backward v] (99999) layers\n    go to x: (0) y: (0)\nend\n\n@Line\n\nwhen flag clicked\nhide\nset [highscore?! v] to [0]\nset [start v] to [0]\n\nwhen I receive [start v]\nset [start v] to [1]\n\nwhen I receive [thing v]\n\nshow\nswitch costume to (costume1 v)\ngo to x: (-180) y: (-40)\nset [xv v] to [0]\nset [yv v] to [0]\nforever\n    go to [front v] layer\n    if <<(Start) = [1]> or <(Highscore?!) = [1]>> then\n        hide\n        stop [this script v]\n    end\n    if <<(y position) < [-175]> or <touching color (#ff0000)?>> then\n        go to x: (-180) y: (-40)\n        set [xv v] to [0]\n        set [yv v] to [0]\n    end\n    if <<key (left arrow v) pressed?> or <key (a v) pressed?>> then\n        point in direction (90)\n        change [xv v] by (-1)\n    end\n    if <<key (right arrow v) pressed?> or <key (d v) pressed?>> then\n        point in direction (-90)\n        change [xv v] by (1)\n    end\n    set [xv v] to ((xv) * (0.85))\n    change x by (xv)\n    if <touching color (#000008)?> then\n        change y by (-2)\n        if <touching color (#000008)?> then\n            change y by (1)\n            if <touching color (#000008)?> then\n                change y by (1)\n                if <touching color (#000008)?> then\n                    change y by (1)\n                    if <touching color (#000008)?> then\n                        change y by (1)\n                        if <touching color (#000008)?> then\n                            change y by (1)\n                            if <touching color (#000008)?> then\n                                change y by (-5)\n                                change x by ((-1) * (xv))\n                                if <<<key (up arrow v) pressed?> or <key (space v) pressed?>> and <not <(xv) = [0]>>> then\n                                    set [mode v] to [walljump]\n                                    set [yv v] to [8]\n                                    set [xv v] to (((xv) / ([abs v] of (xv) )) * (-10))\n                                else\n                                    set [mode v] to [wallslide]\n                                    set [xv v] to [0]\n                                end\n                            end\n                        end\n                    end\n                end\n            end\n        end\n        change y by (2)\n    end\n    change y by (-3)\n    if <touching color (#000008)?> then\n        if <(yv) = [-3]> then\n            if <<key (left arrow v) pressed?> or <key (right arrow v) pressed?>> then\n                set [mode v] to [run]\n            else\n                if <([abs v] of (xv) ) > [.1]> then\n                    set [mode v] to [skid]\n                else\n                    set [mode v] to [stand]\n                end\n            end\n        end\n        if <<key (up arrow v) pressed?> or <key (space v) pressed?>> then\n            set [mode v] to [jump]\n            set [yv v] to [9]\n        end\n    end\n    if <<<<(mode) = [jump]> or <(mode) = [walljump]>> and <(yv) < [0]>> or <<<(mode) = [run]> or <(mode) = [skid]>> and <(yv) < [-3]>>> then\n        set [mode v] to [fall]\n    end\n    change y by (3)\n    if <(yv) > [-15]> then\n        change [yv v] by (-0.5)\n    end\n    change y by (-2)\n    if <not <touching color (#000008)?>> then\n        change y by (-1)\n        if <not <touching color (#000008)?>> then\n            change y by (-1)\n            if <not <touching color (#000008)?>> then\n                change y by (-1)\n                if <not <touching color (#000008)?>> then\n                    change y by (-1)\n                    if <not <touching color (#000008)?>> then\n                        change y by (-1)\n                        if <not <touching color (#000008)?>> then\n                            change y by (5)\n                        end\n                    end\n                end\n            end\n        end\n    end\n    change y by (2)\n    change y by (yv)\n    if <touching color (#000008)?> then\n        change y by (-2)\n        if <touching color (#000008)?> then\n            change y by ((-1) * (yv))\n            set [yv v] to [-3]\n        end\n        change y by (2)\n    end\nend\n\nwhen I start as a clone\nswitch costume to (costume2 v)\nshow\ngo [backward v] (1) layers\ngo to x: (0) y: (-180)\nrepeat (25)\n    change y by (((0) - (y position)) * (0.2))\nend\nforever\n    if <<(Start) = [1]> or <(Highscore?!) = [1]>> then\n        hide\n        delete this clone\n    end\nend\n\n@MenuPlatform\n\nwhen I receive [highscore v]\n\nset [highscore v] to [-10]\n\n    change y by (Highscore)\n    if <(y position) < [170]> then\n        hide\n    end\nend\n\nwhen I receive [start v]\n\nset [play1 v] to [10]\n\n    change y by (play1)\n    if <(y position) < [-170]> then\n        hide\n    end\nend\n\nwhen I receive [back v]\n\ngo to [front v] layer\nswitch costume to (costume2 v)\nshow\ngo [backward v] (1) layers\ngo to x: (0) y: (-180)\nrepeat (25)\n    change y by (((0) - (y position)) * (0.2))\nend\n\n@Platform\n\nwhen flag clicked\nhide\n\nwhen I receive [start v]\nset [level v] to [1]\ngo to [front v] layer\nswitch costume to (1 v)\ngo [backward v] (1) layers\ngo to x: (0) y: (-180)\nwait (0.8) seconds\nshow\nrepeat (25)\n    change y by (((0) - (y position)) * (0.2))\nend\n\nwhen I receive [back v]\nhide\n\nwhen I receive [restart v]\nswitch costume to (1 v)\nset [level v] to [1]\n\nwhen I receive [next v]\nnext costume\nchange [level v] by (1)\n\n@Player\n\nwhen flag clicked\nhide\ngo to x: (-12) y: (-999)\n\nwhen flag clicked\nforever\n    if <(y position) > [-10]> then\n        if <(level) = [1]> then\n            broadcast (yo v)\n            stop [this script v]\n        end\n    end\nend\n\nwhen I receive [start v]\nset [ch-plays v] to [0]\nwait (0.8) seconds\nshow\ngo to x: (-222) y: (-80)\nset [xv v] to [0]\nset [yv v] to [0]\nbroadcast (My Review v)\nforever\n    change [ch-plays v] by (1)\n    if <(item (CH-Plays) of [hippox v]) = [next]> then\n        broadcast (next v)\n        change [ch-plays v] by (1)\n    end\n    go to x: (item (CH-Plays) of [hippox v]) y: (item (CH-Plays) of [hippoy v])\n    point in direction (item (CH-Plays) of [hippo dir v])\n    go to [front v] layer\n    if <(CH-Plays) > [5170]> then\n        set [ch-plays v] to [4924]\n    end\nend\n\nwhen this sprite clicked\nswitch costume to (costume2 v)\n\nwhen I receive [normal v]\nswitch costume to (normal v)\n\nwhen I receive [red v]\nswitch costume to (red v)\n\nwhen I receive [orange v]\nswitch costume to (orange v)\n\nwhen I receive [yellow v]\nswitch costume to (normal v)\n\nwhen I receive [green v]\nswitch costume to (green v)\n\nwhen I receive [lightblue v]\nswitch costume to (lightblue v)\n\nwhen I receive [blue v]\nswitch costume to (blue v)\n\nwhen I receive [purple v]\nswitch costume to (purple v)\n\nwhen I receive [pink v]\nswitch costume to (pink v)\n\nwhen I receive [player color v]\ngo to x: (-117) y: (-145)\npoint in direction (-90)\nshow\n\nwhen flag clicked\nswitch costume to (normal v)\nset [back v] to [0]\n\nwhen I receive [start v]\nhide\n\nswitch costume to (normal v)\nset [back v] to [0]\n\nwhen I receive [ch plays v]\nset [controls v] to (item (CH-Plays) of [keylog v])\nif <(Controls) > [6]> then\n    set [up down v] to [up]\nend\nif <(Controls) < [4]> then\n    set [up down v] to [down]\nend\nif <(Controls) = [6]> then\n    set [lef-rite v] to [right]\n    set [up down v] to [0]\nend\nif <(Controls) = [4]> then\n    set [lef-rite v] to [left]\n    set [up down v] to [0]\nend\nif <<(Controls) = [1]> or <(Controls) = [7]>> then\n    set [lef-rite v] to [left]\nend\nif <<(Controls) = [3]> or <(Controls) = [9]>> then\n    set [lef-rite v] to [right]\nend\nif <<(Controls) = [2]> or <(Controls) = [8]>> then\n    set [lef-rite v] to [0]\nend\nif <(Controls) = [0]> then\n    set [lef-rite v] to [0]\n    set [up down v] to [0]\nend\nif <(Controls) = [5]> then\n    set [lef-rite v] to [reset]\n    set [up down v] to [0]\nend\nchange [ch-plays v] by (1)\nif <(CH-Plays) > [5050]> then\n    set [ch-plays v] to [4800]\nend\n\nwhen I receive [my review v]\nstart sound [My Review_01 v]\nwait until <(CH-Plays) > [325]>\nstart sound [My Review_02 v]\nwait until <(CH-Plays) > [650]>\nstart sound [My Review_03 v]\nwait until <(CH-Plays) > [935]>\nstart sound [My Review_04 v]\nwait until <(CH-Plays) > [1360]>\nstart sound [My Review_05 v]\nwait until <(CH-Plays) > [1820]>\nstart sound [My Review_06 v]\nwait until <(CH-Plays) > [2350]>\nstart sound [My Review_07 v]\nwait until <(CH-Plays) > [2675]>\nstart sound [My Review_08 v]\nwait until <(CH-Plays) > [2980]>\nstart sound [My Review_09 v]\nwait until <(CH-Plays) > [3250]>\nstart sound [My Review_10 v]\nwait until <(CH-Plays) > [3550]>\nstart sound [My Review_11 v]\nwait until <(CH-Plays) > [4170]>\nstart sound [My Review_12 v]\n\nforever\n    add (x position) to [hippox v]\n    add (y position) to [hippoy v]\n    add (direction) to [hippo dir v]\n    broadcast (CH Plays v)\n    if <touching color (#cc0099)?> then\n        set [mode v] to [jump]\n        set [yv v] to [13]\n    end\n    if <touching color (#5b9aea)?> then\n        if <(up down) = [down]> then\n            change [yv v] by (-1)\n        else\n            change [yv v] by (1)\n        end\n    end\n    if <(Lef-Rite) = [reset]> then\n        go to x: (-231) y: (-135)\n        set [xv v] to [0]\n        set [yv v] to [0]\n    end\n    go to [front v] layer\n    if <(back) = [1]> then\n        hide\n        stop [this script v]\n    end\n    if <(x position) > [235]> then\n        add [next] to [hippox v]\n        add [next] to [hippoy v]\n        add [next] to [hippo dir v]\n        broadcast (next v)\n        set x to (-222)\n        set [xv v] to [0]\n        set [yv v] to [0]\n    end\n    if <<(y position) < [-175]> or <touching color (#ff0000)?>> then\n        go to x: (-180) y: (-40)\n        set [xv v] to [0]\n        set [yv v] to [0]\n    end\n    if <(Lef-Rite) = [left]> then\n        point in direction (90)\n        change [xv v] by (-1)\n    end\n    if <(Lef-Rite) = [right]> then\n        point in direction (-90)\n        change [xv v] by (1)\n    end\n    set [xv v] to ((xv) * (0.85))\n    change x by (xv)\n    if <touching color (#000008)?> then\n        change y by (-2)\n        if <touching color (#000008)?> then\n            change y by (1)\n            if <touching color (#000008)?> then\n                change y by (1)\n                if <touching color (#000008)?> then\n                    change y by (1)\n                    if <touching color (#000008)?> then\n                        change y by (1)\n                        if <touching color (#000008)?> then\n                            change y by (1)\n                            if <touching color (#000008)?> then\n                                change y by (-5)\n                                change x by ((-1) * (xv))\n                                if <<(up down) = [up]> and <not <(xv) = [0]>>> then\n                                    set [mode v] to [walljump]\n                                    set [yv v] to [8]\n                                    set [xv v] to (((xv) / ([abs v] of (xv) )) * (-10))\n                                else\n                                    set [mode v] to [wallslide]\n                                    set [xv v] to [0]\n                                end\n                            end\n                        end\n                    end\n                end\n            end\n        end\n        change y by (2)\n    end\n    change y by (-3)\n    if <touching color (#000008)?> then\n        if <(yv) = [-3]> then\n            if <<(Lef-Rite) = [left]> or <(Lef-Rite) = [right]>> then\n                set [mode v] to [run]\n            else\n                if <([abs v] of (xv) ) > [.1]> then\n                    set [mode v] to [skid]\n                else\n                    set [mode v] to [stand]\n                end\n            end\n        end\n        if <(up down) = [up]> then\n            set [mode v] to [jump]\n            set [yv v] to [9]\n        end\n    end\n    if <<<<(mode) = [jump]> or <(mode) = [walljump]>> and <(yv) < [0]>> or <<<(mode) = [run]> or <(mode) = [skid]>> and <(yv) < [-3]>>> then\n        set [mode v] to [fall]\n    end\n    change y by (3)\n    if <(yv) > [-15]> then\n        change [yv v] by (-0.5)\n    end\n    change y by (-2)\n    if <not <touching color (#000008)?>> then\n        change y by (-1)\n        if <not <touching color (#000008)?>> then\n            change y by (-1)\n            if <not <touching color (#000008)?>> then\n                change y by (-1)\n                if <not <touching color (#000008)?>> then\n                    change y by (-1)\n                    if <not <touching color (#000008)?>> then\n                        change y by (-1)\n                        if <not <touching color (#000008)?>> then\n                            change y by (5)\n                        end\n                    end\n                end\n            end\n        end\n    end\n    change y by (2)\n    change y by (yv)\n    if <touching color (#000008)?> then\n        change y by (-2)\n        if <touching color (#000008)?> then\n            change y by ((-1) * (yv))\n            set [yv v] to [-3]\n        end\n        change y by (2)\n    end\nend\n\nwait until <key (space v) pressed?>\n\n@MenuBlock\n\nwhen flag clicked\nhide\n\nwhen I receive [yo v]\nswitch costume to (costume1 v)\nshow\ngo [backward v] (1) layers\ngo to x: (200) y: (-180)\nrepeat (25)\n    change y by (((60) - (y position)) * (0.2))\nend\n\nwhen flag clicked\nwait until <(level) = [2]>\nhide\n\n@MenuBlock2\n\nwhen flag clicked\nswitch costume to (costume2 v)\nhide\n\nwhen I receive [start v]\nhide\n\nwhen I receive [thing v]\nswitch costume to (costume1 v)\nshow\ngo [backward v] (1) layers\ngo to x: (0) y: (-180)\nrepeat (25)\n    change y by (((-96) - (y position)) * (0.2))\nend\n\n@Menublock3\n\nwhen I receive [start v]\nhide\n\nwhen I receive [back v]\n\nhide\nwait (0.6) seconds\ngo to x: (-198) y: (-154)\nshow\nforever\n    if <touching (mouse-pointer v)?> then\n        set size to (170) %\n        if <mouse down?> then\n            broadcast (Thing v)\n            hide\n            stop [this script v]\n        end\n    else\n        set size to (100) %\n    end\nend\n\n@Play2\n\nwhen I receive [start v]\nset [play1 v] to [10]\nrepeat until \n    change y by (play1)\n    change [play1 v] by (-2)\n    if <touching (_edge_ v)?> then\n        hide\n        stop [this script v]\n    end\nend\n\nwhen flag clicked\nforever\n    if <touching (mouse-pointer v)?> then\n        set size to (115) %\n    else\n        set size to (100) %\n    end\nend\n\nwhen I receive [back v]\nshow\ngo to x: (-2400) y: (-75)\nset [ghost v] effect to (80)\nrepeat (25)\n    change x by (((-10) - (x position)) * (0.2))\n    change [ghost v] effect by (-10)\nend\nwait until <<touching (mouse-pointer v)?> and <mouse down?>>\nwait until <not <mouse down?>>\nif <touching (mouse-pointer v)?> then\n    broadcast (player color v)\n    delete this clone\nend\n\n@Sprite1\n\nwhen I start as a clone\nset size to (160) %\nshow\nif <(number) = [1]> then\n    switch costume to (normal v)\n    go to x: (-80) y: (-180)\n    forever\n        change y by (((-130) - (y position)) * (0.2))\n        if <<touching (mouse-pointer v)?> and <mouse down?>> then\n            broadcast (normal v)\n        end\n    end\nend\nif <(number) = [2]> then\n    switch costume to (red v)\n    go to x: (-60) y: (-180)\n    forever\n        change y by (((-130) - (y position)) * (0.2))\n        if <<touching (mouse-pointer v)?> and <mouse down?>> then\n            broadcast (red v)\n        end\n    end\nend\nif <(number) = [3]> then\n    switch costume to (orange v)\n    go to x: (-40) y: (-180)\n    forever\n        change y by (((-130) - (y position)) * (0.2))\n        if <<touching (mouse-pointer v)?> and <mouse down?>> then\n            broadcast (orange v)\n        end\n    end\nend\nif <(number) = [4]> then\n    switch costume to (yellow v)\n    go to x: (-20) y: (-180)\n    forever\n        change y by (((-130) - (y position)) * (0.2))\n        if <<touching (mouse-pointer v)?> and <mouse down?>> then\n            broadcast (yellow v)\n        end\n    end\nend\nif <(number) = [5]> then\n    switch costume to (green v)\n    go to x: (0) y: (-180)\n    forever\n        change y by (((-130) - (y position)) * (0.2))\n        if <<touching (mouse-pointer v)?> and <mouse down?>> then\n            broadcast (green v)\n        end\n    end\nend\nif <(number) = [6]> then\n    switch costume to (lightblue v)\n    go to x: (20) y: (-180)\n    forever\n        change y by (((-130) - (y position)) * (0.2))\n        if <<touching (mouse-pointer v)?> and <mouse down?>> then\n            broadcast (lightblue v)\n        end\n    end\nend\nif <(number) = [7]> then\n    switch costume to (blue v)\n    go to x: (40) y: (-180)\n    forever\n        change y by (((-130) - (y position)) * (0.2))\n        if <<touching (mouse-pointer v)?> and <mouse down?>> then\n            broadcast (blue v)\n        end\n    end\nend\nif <(number) = [8]> then\n    switch costume to (purple v)\n    go to x: (60) y: (-180)\n    forever\n        change y by (((-130) - (y position)) * (0.2))\n        if <<touching (mouse-pointer v)?> and <mouse down?>> then\n            broadcast (purple v)\n        end\n    end\nend\nif <(number) = [9]> then\n    switch costume to (pink v)\n    go to x: (80) y: (-180)\n    forever\n        change y by (((-130) - (y position)) * (0.2))\n        if <<touching (mouse-pointer v)?> and <mouse down?>> then\n            broadcast (pink v)\n        end\n    end\nend\n\nwhen I receive [player color v]\nset [number v] to [0]\nwait (0) seconds\nrepeat (9)\n    change [number v] by (1)\n    create clone of (_myself_ v)\n    wait (0.1) seconds\nend\n\nwhen flag clicked\nset [number v] to [0]\n\nwhen flag clicked\nforever\n    hide\nend\n\nwhen I start as a clone\nforever\n    if <(Start) = [1]> then\n        hide\n        delete this clone\n    end\nend\n\ncreate clone of (_myself_ v)\n\n@Play3\n\nwhen flag clicked\nhide\n\nwhen I receive [start v]\nwait (1) seconds\ngo to x: (-208) y: (-163)\nshow\n\nforever\n    if <<touching (mouse-pointer v)?> and <mouse down?>> then\n        wait until <not <mouse down?>>\n        if <touching (mouse-pointer v)?> then\n            set [start v] to [0]\n            set [back v] to [1]\n            hide\n            broadcast (Back v)\n            wait (0.3) seconds\n            set [back v] to [0]\n            stop [this script v]\n        end\n    end\nend\n\n@Sprite2\n\nwhen flag clicked\ngo to [front v] layer\ngo to x: (0) y: (0)\nshow\nswitch costume to (costume1 v)\nbroadcast (hippo title v)\n\nwhen I receive [back v]\nhide\n\n@Pickle\n\nwhen flag clicked\nhide\n\nwhen I receive [tn v]\nset size to (25) %\ngo to x: (206) y: (-147)\ngo to [front v] layer\nshow\n\n@CH\n\nwhen I receive [start v]\npoint in direction (105)\nset rotation style [all around v]\ngo to x: (-183) y: (92)\nset size to (50) %\ngo to [back v] layer\nswitch costume to (hippo_mouthclosed v)\nwait until <(level) = [3]>\nnext costume\nwait until <(level) = [4]>\nnext costume\ngo to [front v] layer\npoint in direction (-90)\nset rotation style [left-right v]\ngo to x: (170) y: (90)\nwait until <(level) = [6]>\nnext costume\nwait until <(level) = [9]>\nhide\nwait until <(level) = [10]>\nnext costume\nshow\ngo to x: (174) y: (-96)\nwait until <(level) = [11]>\nhide\nwait until <(level) = [13]>\nshow\nnext costume\ngo to x: (-183) y: (94)\nset rotation style [all around v]\npoint in direction (105)\nwait until <(level) = [14]>\nhide\nwait until <(level) = [19]>\nshow\nwait until <(level) = [21]>\nhide\n\nwhen I receive [hippo title v]\nshow\nset size to (100) %\nswitch costume to (hippo_mouthclosed v)\ngo to [front v] layer\nset rotation style [left-right v]\npoint in direction (90)\ngo to x: (-340) y: (-170)\nglide (0.3) secs to x: (-153) y: (-60)\nswitch costume to (hippo_mouthopen v)\nplay sound [CH Speech v] until done\nbroadcast (back v)\n\n