Adventure | a mobile platformer || #Mobile #Games #All

Instructions: \nIf the are any bugs mention in the comments\ndouble click green flag to show joystick for mobile users :)\n==CONTROLS =============================\n- jump [up arrow] or [w]\n- left [left arrow] or [a]\n-right [right arrow] or [d]\n-or joy stick for mobile users\n-'r' for restart or press restart\n===INSTRUCTIONS=========================play the game like any other platformer...\nlike and fav for better features

@Stage\n\nwhen flag clicked\nforever\n    play sound [Hello v] until done\nend\n\nwhen flag clicked\nswitch costume to (backdrop1 v)\nforever\n    if <(LEVEL #) > [17]> then\n        switch costume to (backdrop2 v)\n    else\n        switch costume to (backdrop1 v)\n    end\nend\n\n@empty\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    Check Touching Solid\n    if <(touching) > [0]> 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    Check Touching Solid\n    if <(touching) > [0]> 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\nend\n\ndefine Check Touching Solid\nif <<touching (level v)?> or <touching (moving platform v)?>> then\n    set [touching v] to [1]\nelse\n    set [touching v] to [0]\nend\n\nwhen I start as a clone\nswitch costume to (clone v)\nrepeat (5)\n    change [ghost v] effect by (20)\n    change size by (-7)\nend\ndelete this clone\n\nwhen flag clicked\npoint in direction (90)\nforever\n    create clone of (_myself_ v)\nend\n\nwhen flag clicked\nset [level # v] to [1]\nset [resistance v] to [0.8]\nset [acceleration v] to [2]\nset [jump force v] to [15]\nset [gravity v] to [-1.5]\nset [speed y v] to [0]\nset [falling v] to [99]\nbroadcast (Change Scene v)\nbroadcast (Game Loop v)\ngo to x: (-150) y: (50)\nforever\n    if <<key (up arrow v) pressed?> or <<key (w v) pressed?> or <(STICK Y) > [0.5]>>> 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 <(STICK X) < [-0.5]>>> then\n        change [speed x v] by ((0) - (ACCELERATION))\n        switch costume to (left v)\n        if <(LEVEL #) > [17]> then\n            switch costume to (left2 v)\n            change [speed x v] by ((0) - (ACCELERATION))\n        end\n    end\n    if <<key (right arrow v) pressed?> or <<key (d v) pressed?> or <(STICK X) > [0.5]>>> then\n        change [speed x v] by (ACCELERATION)\n        switch costume to (right v)\n        if <(LEVEL #) > [17]> then\n            switch costume to (right2 v)\n            change [speed x v] by (ACCELERATION)\n        end\n    end\n    set [speed x v] to ((speed x) * (RESISTANCE))\n    change [speed y v] by (GRAVITY)\n    Move - in steps (([abs v] of (speed x) ) + ([abs v] of (speed y) ))\nend\n\nwhen I receive [game loop v]\nforever\n    broadcast (Tick - Last v)\nend\n\nwhen I receive [tick - last v]\nif <(x position) > [235]> then\n    Begin Level # ((LEVEL #) + (1)) go to x: [-235]\nend\n\ndefine Begin Level # (level #) go to x: (x)\nset [level # v] to (level #)\nset x to (x)\nbroadcast (Change Scene v)\nwait (0) seconds\nFix Collisions in Directions [0]\n\ndefine Fix Collisions in Directions (dir)\nset [temp v] to (direction)\nset [distance v] to [1]\npoint in direction (dir)\nrepeat (128)\n    Check Touching Solid\n    if <(touching) < [1]> then\n        point in direction (temp)\n        stop [this script v]\n    end\n    move (distance) steps\n    turn right (180) degrees\n    change [distance v] by (1)\nend\n\nwhen I receive [dead v]\nstart sound [die v]\nrepeat (10)\n    change [ghost v] effect by (20)\n    change y by (10)\nend\npoint in direction (90)\ngo to x: (-150) y: (50)\nset [ghost v] effect to (0)\n\nwhen flag clicked\nforever\n    if <<key (w v) pressed?> or <<key (up arrow v) pressed?> or <(STICK Y) > [0.5]>>> then\n        play sound [Low Whoosh v] until done\n        wait (0.2) seconds\n    end\nend\n\nwhen flag clicked\nforever\n    if <(STICK POWER) > [50]> then\n        point in direction (STICK DIRECTION)\n        move ((2) * (STICK POWER)) steps\n    end\nend\n\nwhen flag clicked\nforever\n    if <(y position) < [-140]> then\n        start sound [die v]\n        repeat (10)\n            change [ghost v] effect by (10)\n            change y by (10)\n        end\n        point in direction (90)\n        go to x: (-150) y: (50)\n        set [ghost v] effect to (0)\n    end\nend\n\nwhen flag clicked\nforever\n    if <key (r v) pressed?> then\n        broadcast (re v)\n    end\nend\n\nwhen I receive [re v]\ngo to x: (-150) y: (50)\nset [ghost v] effect to (0)\n\nturn right (15) degrees\n\nwhen flag clicked\n\nwhen flag clicked\nswitch costume to (right v)\n\n@level\n\nwhen flag clicked\ngo to x: (0) y: (0)\ngo to [front v] layer\n\nwhen I receive [change scene v]\nswitch costume to (join [level] (LEVEL #))\n\n@row of spikes\n\nwhen flag clicked\nforever\n    if <touching color (#656565)?> then\n        broadcast (dead v)\n    end\nend\n\nwhen flag clicked\nhide\nforever\n    if <(LEVEL #) = [3]> then\n        set size to (100) %\n        go to x: (25) y: (-142)\n        show\n        switch costume to (costume1 v)\n        point in direction (90)\n    else\n        if <(LEVEL #) = [5]> then\n            set size to (60) %\n            go to x: (4) y: (-33)\n            show\n            switch costume to (costume1 v)\n            point in direction (76)\n        else\n            if <(LEVEL #) = [9]> then\n                set size to (70) %\n                go to x: (-117) y: (-63)\n                show\n                switch costume to (costume1 v)\n                point in direction (90)\n            else\n                set size to (1) %\n                switch costume to (costume1 v)\n                go to x: (-107) y: (-148)\n                hide\n            end\n        end\n    end\nend\n\n@spike\n\nwhen flag clicked\nforever\n    if <touching color (#656565)?> then\n        broadcast (dead v)\n    end\nend\n\nwhen flag clicked\nhide\nforever\n    if <(LEVEL #) = [2]> then\n        point in direction (90)\n        set size to (100) %\n        go to x: (49) y: (-63)\n        show\n        switch costume to (duo v)\n    else\n        if <(LEVEL #) = [7]> then\n            point in direction (90)\n            set size to (100) %\n            go to x: (162) y: (9)\n            show\n            switch costume to (duo v)\n        else\n            if <(LEVEL #) = [8]> then\n                go to x: (-101) y: (101)\n                point in direction (-90)\n                set size to (80) %\n                show\n                switch costume to (single v)\n            else\n                if <(LEVEL #) = [12]> then\n                    go to x: (8) y: (101)\n                    point in direction (-90)\n                    set size to (80) %\n                    show\n                    switch costume to (single v)\n                    repeat until <not <(LEVEL #) = [12]>>\n                        glide (0.3) secs to x: (-8) y: (-101)\n                        wait (1) seconds\n                        start sound [Low Squeak v]\n                        glide (0.3) secs to x: (8) y: (101)\n                        wait (1) seconds\n                    end\n                else\n                    if <(LEVEL #) = [15]> then\n                        go to x: (8) y: (-50)\n                        point in direction (90)\n                        set size to (80) %\n                        show\n                        switch costume to (duo v)\n                    else\n                        set size to (1) %\n                        switch costume to (single v)\n                        go to x: (-107) y: (-148)\n                        hide\n                    end\n                end\n            end\n        end\n    end\nend\n\nwhen flag clicked\nrepeat until <(LEVEL #) = [15]>\n    if <(LEVEL #) = [13]> then\n        hide\n    end\nend\n\n@moon/sun\n\nwhen flag clicked\nforever\n    go to [back v] layer\nend\n\nwhen flag clicked\nforever\n    if <(costume [number v]) = [2]> then\n        go to x: (-8) y: (0)\n    else\n        go to x: (167) y: (150)\n    end\nend\n\nwhen flag clicked\nswitch costume to (costume1 v)\nforever\n    if <(LEVEL #) > [19]> then\n        switch costume to (costume2 v)\n    else\n        switch costume to (costume1 v)\n    end\nend\n\n@poison\n\nwhen flag clicked\nforever\n    if <touching color (#656565)?> then\n        broadcast (dead v)\n    end\nend\n\nwhen flag clicked\nhide\nforever\n    if <(LEVEL #) = [9]> then\n        go to x: (71) y: (-45)\n        set size to (100) %\n        show\n    else\n        go to x: (15) y: (-163)\n        hide\n        set size to (1) %\n    end\nend\n\nif <(LEVEL #) = [18]> then\n    go to x: (108) y: (-70)\n    set size to (100) %\n    show\nend\n\nwhen flag clicked\nforever\n    wait (.2) seconds\n    next costume\nend\n\n@Control Stick\n\nwhen I start as a clone\nswitch costume to (stick v)\nset [brightness v] effect to (50)\nset [ghost v] effect to (25)\nforever\n    go to [front v] layer\n    go [forward v] (450) layers\n    set [stick power v] to []\n    set [stick x v] to [0]\n    set [stick y v] to [0]\n    repeat until <mouse down?>\n        go to (myself)\n    end\n    if <(distance to [mouse-pointer v]) < ((size) * (0.6))> then\n        Stick Drag\n    else\n        wait until <not <mouse down?>>\n    end\nend\n\ndefine Stick Drag\nrepeat until <not <mouse down?>>\n    go to [front v] layer\n    go [forward v] (450) layers\n    go to (mouse-pointer v)\n    point towards (myself)\n    turn right (180) degrees\n    set [stick direction v] to (direction)\n    set [stick power v] to (distance to [(myself) v])\n    if <(STICK POWER) > (max stick)> then\n        move ((max stick) - (STICK POWER)) steps\n        set [stick power v] to (max stick)\n    end\n    set [stick power v] to ((STICK POWER) / (max stick))\n    set [stick x v] to ((STICK POWER) * ([sin v] of (STICK DIRECTION) ))\n    set [stick y v] to ((STICK POWER) * ([cos v] of (STICK DIRECTION) ))\nend\n\nif <(Game) = [yes]> then\n\nhide\n\nhide\n\nwhen flag clicked\nswitch costume to (base v)\nshow\ngo to [front v] layer\ngo [forward v] (200) layers\nset [myself v] to [Control Stick]\nset size to (80) %\nset [max stick v] to ((size) / (4))\ngo to x: (170) y: (-130)\nswitch costume to (base v)\nset [ghost v] effect to (60)\ncreate clone of (_myself_ v)\n\ngo to [front v] layer\n\nshow\n\n@cover1\n\nwhen flag clicked\ngo to x: (0) y: (0)\nset [ghost v] effect to (100)\nforever\n    go to [front v] layer\nend\n\n@Sprite1\n\nwhen flag clicked\nhide\nset size to (30) %\ngo to [back v] layer\nforever\n    create clone of (_myself_ v)\nend\n\nwhen I start as a clone\nshow\ngo to (player v)\nturn right (pick random (0) to (360)) degrees\nrepeat (15)\n    move (5) steps\n    change [ghost v] effect by (5)\nend\ndelete this clone\n\nwhen flag clicked\nforever\n    if <(LEVEL #) > [17]> then\n        switch costume to (costume2 v)\n    else\n        switch costume to (costume1 v)\n    end\nend\n\n@clouds\n\nwhen flag clicked\ngo to [back v] layer\ngo to x: (-236) y: (41)\nhide\nforever\n    create clone of (_myself_ v)\n    wait (pick random (1) to (2.5)) seconds\nend\n\nwhen I start as a clone\nshow\nset y to (pick random (152) to (0))\nset [ghost v] effect to (pick random (25) to (50))\nswitch costume to (pick random (1) to (4))\nrepeat until <(x position) > [251]>\n    change x by (5)\nend\ndelete this clone\n\n@moving platform\n\nwhen flag clicked\nforever\n    if <(LEVEL #) = [13]> then\n        set size to (100) %\n        show\n        go to x: (-123) y: (-131)\n        repeat until <not <(LEVEL #) = [13]>>\n            glide (1) secs to x: (-123) y: (-131)\n            wait (0.5) seconds\n            glide (1) secs to x: (30) y: (-131)\n            wait (0.5) seconds\n        end\n    else\n        hide\n        set size to (1) %\n    end\nend\n\nwhen flag clicked\nforever\n    \nend\n\n@void\n\nwhen flag clicked\nforever\n    if <(y position) < [-140]> then\n        broadcast (dead v)\n    end\nend\n\n@stars\n\nwhen flag clicked\nhide\nset size to (100) %\ngo to [back v] layer\nforever\n    create clone of (_myself_ v)\nend\n\nwhen I start as a clone\nshow\ngo to (random position v)\nturn right (pick random (0) to (360)) degrees\nrepeat (10)\n    point in direction (pick random (0) to ())\n    change [ghost v] effect by (5)\nend\ndelete this clone\n\nwhen flag clicked\nhide\n\n\n\nwhen I start as a clone\nforever\n    if <(LEVEL #) > [19]> then\n        hide\n        broadcast (HIDE STARS CUTIES v)\n    end\nend\n\n@Sprite2\n\nwhen this sprite clicked\nbroadcast (re v)\n\nwhen flag clicked\nrepeat (10)\n    go to [front v] layer\nend\n\n@Love fave\n\nwhen flag clicked\nset [costume v] to [0]\nhide\nforever\n    if <not <<(LOVED__) = [1]> and <(FAVED___) = [1]>>> then\n        wait (pick random (10) to (25)) seconds\n        switch costume to (costume1 v)\n        go to x: (0) y: (50)\n        show\n        go to [front v] layer\n        start sound [pop v]\n        repeat (9)\n            change y by (-6)\n        end\n        repeat (5)\n            change y by (3)\n        end\n        repeat (5)\n            change y by (-1)\n        end\n        wait (2) seconds\n        repeat (15)\n            change y by (7)\n        end\n        hide\n    end\n    if <(Costume) > [0]> then\n        hide\n        stop [this script v]\n    end\nend\n\n@2nd costume\n\nwhen flag clicked\nhide\nforever\n    go to [front v] layer\n    if <(LEVEL #) = [18]> then\n        show\n    else\n        hide\n    end\nend\n\n@Sprite3\n\nwhen flag clicked\n\nwhen flag clicked\nhide\nforever\n    if <(LEVEL #) = [18]> then\n        show\n        broadcast (show v)\n    else\n        hide\n    end\nend\n\nwhen I receive [show v]\nset [ghost v] effect to (20)\nforever\n    go to (2nd costume v)\n    turn right (1) degrees\nend\n\n