Titanic | A Mobile Platformer
@Stage\n\nwhen flag clicked\nforever\n    switch backdrop to (Level)\nend\n\n@Hitbox\n\nwhen flag clicked\nset [level v] to [1]\nset [ghost v] effect to (100)\npoint in direction (90)\nhide\n\nwhen I receive [death v]\nstop [other scripts in sprite v]\nset [gravity v] to [-0.25]\nstart sound [Lost A Life v]\nrepeat (4)\n    change y by (2)\nend\nrepeat until <(y position) < [-183]>\n    change [gravity v] by (-1)\n    change y by (Gravity)\nend\nwait (0.1) seconds\ngo to x: (-200) y: (0)\npoint in direction (90)\nbroadcast (Respawn v)\nstop [this script v]\n\nwhen I receive [restart v]\nset [y v] to [0]\nset [x v] to [0]\nshow\ngo to x: (-200) y: (0)\nforever\n    if <<<key (right arrow v) pressed?> or <key (d v) pressed?>> or <<mouse down?> and <(mouse x) > (x position)>>> then\n        point in direction (90)\n        change [x v] by (1)\n    end\n    if <<<key (left arrow v) pressed?> or <key (a v) pressed?>> or <<mouse down?> and <(mouse x) < (x position)>>> then\n        point in direction (-90)\n        change [x v] by (-1)\n    end\n    set [x v] to ((X) * (0.9))\n    change x by (X)\n    if <touching (level v)?> then\n        change y by (1)\n        if <touching (level v)?> then\n            change y by (1)\n            if <touching (level v)?> then\n                change y by (1)\n                if <touching (level v)?> then\n                    change y by (1)\n                    if <touching (level v)?> then\n                        change x by ((X) * (-1))\n                        change y by (-4)\n                        if <<<key (up arrow v) pressed?> or <key (w v) pressed?>> or <mouse down?>> then\n                            if <(X) > [0]> then\n                                set [x v] to [-5]\n                            else\n                                set [x v] to [5]\n                            end\n                            set [y v] to [10]\n                        else\n                            set [y v] to [0]\n                        end\n                    end\n                end\n            end\n        end\n    end\n    change [y v] by (-1)\n    change y by (Y)\n    if <touching (level v)?> then\n        change y by ((Y) * (-1))\n        set [y v] to [0]\n    end\n    change y by (-1)\n    if <touching (level v)?> then\n        if <<<key (up arrow v) pressed?> or <key (w v) pressed?>> or <<mouse down?> and <((mouse y) - (y position)) > [50]>>> then\n            set [y v] to [15]\n        end\n    end\n    change y by (1)\n    if <(x position) > [238]> then\n        go to x: (-200) y: (0)\n        change [level v] by (1)\n        point in direction (90)\n    end\n    if <<touching (water v)?> or <touching (danger v)?>> then\n        broadcast (Death v)\n    end\n    if <touching (trampoline v)?> then\n        set [y v] to [21]\n    end\nend\n\nwhen I receive [end v]\nstop [other scripts in sprite v]\ngo to x: (-10) y: (-81)\ngo [backward v] (1) layers\nrepeat until <(x position) > [229]>\n    change x by (4)\nend\nbroadcast (GameOver v)\nhide\n\n@Level\n\nwhen flag clicked\nhide\n\nwhen I start as a clone\nforever\n    if <(Clone) = [1]> then\n        show\n        switch costume to (chair v)\n        go to x: (-205) y: (-100)\n        go to [back v] layer\n        repeat until <(Level) > [1]>\n            point in direction ((([cos v] of ((timer) * (100)) ) * (2)) + (90))\n        end\n        delete this clone\n    else\n        delete this clone\n    end\nend\n\nwhen I receive [shake v]\nrepeat (2)\n    change x by (-8)\n    wait (0) seconds\n    change x by (12)\n    wait (0.06) seconds\n    change x by (-6)\n    wait (0.06) seconds\n    change x by (3)\n    wait (0.06) seconds\n    change x by (-1)\n    wait (0.06) seconds\nend\n\nwhen I receive [restart v]\ngo to [front v] layer\nset [clone v] to [1]\ncreate clone of (_myself_ v)\nshow\nforever\n    go to x: (0) y: (0)\n    switch costume to (Level)\nend\n\nwhen I receive [end v]\nstop [other scripts in sprite v]\n\n@Player\n\nwhen flag clicked\nhide\n\nwhen I receive [restart v]\nshow\nset rotation style [left-right v]\nforever\n    go to (hitbox v)\n    go to [front v] layer\n    point in direction ([direction v] of [hitbox v])\n    if <(Level) > [4]> then\n        switch costume to (player-2 v)\n        if <(direction) = [90]> then\n            switch costume to (player-2 v)\n        else\n            if <(direction) = [-90]> then\n                switch costume to (player-3 v)\n            end\n        end\n    else\n        switch costume to (player-1 v)\n    end\nend\n\nwhen I receive [gameover v]\nstop [other scripts in sprite v]\nhide\n\n@Water\n\nwhen flag clicked\nset volume to (100) %\nhide\n\nwhen I receive [restart v]\ngo to [front v] layer\nswitch costume to (water v)\ngo to x: (0) y: (0)\nshow\nset [ghost v] effect to (10)\n\n    point in direction ((([cos v] of ((timer) * (100)) ) * (2)) + (90))\n    go to [front v] layer\nend\n\nwhen I receive [restart v]\nforever\n    play sound [River Noise v] until done\nend\n\nwhen I receive [end v]\nrepeat (10)\n    change volume by (-10)\nend\n\nwhen I receive [gameover v]\nrepeat (40)\n    go [backward v] (1) layers\nend\nhide\n\n@Darkness\n\nwhen flag clicked\nset [ghost v] effect to (0)\ngo to x: (0) y: (0)\nswitch costume to (darkness v)\nshow\nrepeat (10)\n    go to [front v] layer\n    change [ghost v] effect by (10)\nend\n\nwhen I receive [respawn v]\nset [ghost v] effect to (0)\ngo to x: (0) y: (0)\nswitch costume to (darkness v)\nshow\nrepeat (40)\n    go to [front v] layer\n    change [ghost v] effect by (2.5)\nend\nbroadcast (Restart v)\n\nwhen I receive [gameover v]\nset [ghost v] effect to (100)\ngo to x: (0) y: (0)\nswitch costume to (darkness v)\nshow\nrepeat (40)\n    go to [front v] layer\n    go to [front v] layer\n    change [ghost v] effect by (-2.5)\nend\nwait (0.5) seconds\ncreate clone of (_myself_ v)\n\nwhen I start as a clone\nswitch costume to (end title v)\nshow\ngo to x: (0) y: (0)\nset [ghost v] effect to (100)\nrepeat (20)\n    go to [front v] layer\n    change [ghost v] effect by (-2.5)\nend\nwait (2.7) seconds\nrepeat (20)\n    go to [front v] layer\n    change [ghost v] effect by (2.5)\nend\ndelete this clone\n\nwhen I receive [gameover v]\nforever\n    play sound [Love v] until done\nend\n\n@Danger\n\nwhen flag clicked\nshow\ngo to x: (0) y: (0)\nforever\n    switch costume to (Level)\nend\n\nwhen I receive [shake v]\nrepeat (2)\n    change x by (-8)\n    wait (0) seconds\n    change x by (12)\n    wait (0.06) seconds\n    change x by (-6)\n    wait (0.06) seconds\n    change x by (3)\n    wait (0.06) seconds\n    change x by (-1)\n    wait (0.06) seconds\nend\n\nwhen I receive [end v]\nstop [other scripts in sprite v]\n\n@Level Counter\n\nwhen flag clicked\nset [ghost v] effect to (0)\ngo to x: (-210) y: (148)\nforever\n    switch costume to (Level)\nend\n\nwhen flag clicked\nhide\n\nwhen I receive [restart v]\nshow\nforever\n    set size to ((([sin v] of ((timer) * ([atan v] of (timer) )) ) * (5)) + (70)) %\n    point in direction ((([cos v] of ((timer) * ([atan v] of (timer) )) ) * (10)) + (90))\nend\n\nwhen I receive [end v]\nrepeat (10)\n    change [ghost v] effect by (10)\nend\nhide\n\n@Lights\n\nwhen flag clicked\nhide\n\nwhen I receive [restart v]\ngo to x: (0) y: (0)\nforever\n    wait (pick random (12) to (22)) seconds\n    broadcast (Shake v)\n    start sound [Shake v]\n    repeat (2)\n        change x by (-8)\n        wait (0) seconds\n        change x by (12)\n        wait (0.06) seconds\n        change x by (-6)\n        wait (0.06) seconds\n        change x by (3)\n        wait (0.06) seconds\n        change x by (-1)\n        wait (0.06) seconds\n    end\nend\n\nwhen I receive [restart v]\nforever\n    if <(Level) > [4]> then\n        go to [front v] layer\n        set [ghost v] effect to (85)\n        switch costume to (steam v)\n        go to x: (0) y: (0)\n        show\n    else\n        switch costume to (lights v)\n        show\n    end\nend\n\nwhen I receive [end v]\nstop [other scripts in sprite v]\n\n@Shadow\n\nwhen flag clicked\nset [ghost v] effect to (86)\nshow\nforever\n    go to [back v] layer\n    go to (player v)\nend\n\nwhen I receive [end v]\nstop [other scripts in sprite v]\nrepeat (10)\n    change [ghost v] effect by (10)\nend\nhide\n\n@Main Screen\n\nwhen flag clicked\nshow\nswitch costume to (title v)\ngo to x: (0) y: (70)\nset [clone v] to [1]\ncreate clone of (_myself_ v)\nset [clone v] to [2]\ncreate clone of (_myself_ v)\nset [clone v] to [3]\ncreate clone of (_myself_ v)\nforever\n    wait (pick random (0.5) to (1)) seconds\n    create clone of (_myself_ v)\nend\n\nwhen I start as a clone\nif <(Clone) = [1]> then\n    switch costume to (main screen v)\n    go to [back v] layer\n    go to x: (0) y: (0)\n    show\n    forever\n        point in direction ((([cos v] of ((timer) * (100)) ) * (2)) + (90))\n    end\nelse\n    if <(Clone) = [2]> then\n        go to [front v] layer\n        show\n        switch costume to (play button v)\n        go to x: (0) y: (-80)\n        forever\n            point in direction ((([sin v] of ((timer) * (300)) ) * (3)) + (90))\n            if <not <touching (mouse-pointer v)?>> then\n                change size by (((90) - (size)) / (3))\n                set [ghost v] effect to (20)\n            else\n                change size by (((110) - (size)) / (3))\n                set [ghost v] effect to (10)\n                if <mouse down?> then\n                    broadcast (Game v)\n                    delete this clone\n                end\n            end\n        end\n    else\n        if <(Clone) = [3]> then\n            clear graphic effects\n            point in direction (pick random (1) to (360))\n            set size to (pick random (50) to (80)) %\n            switch costume to (bubbles v)\n            go to x: (pick random (-200) to (200)) y: (-160)\n            show\n            repeat until <(y position) = [160]>\n                change [ghost v] effect by (pick random (2) to (3))\n                turn right (12) degrees\n                change y by (8)\n            end\n            delete this clone\n        end\n    end\nend\n\nwhen I receive [game v]\nhide\nstop [other scripts in sprite v]\nrepeat (2)\n    delete this clone\nend\nbroadcast (Restart v)\n\nwhen I receive [end v]\nstop [other scripts in sprite v]\n\nwhen flag clicked\nforever\n    play sound [Jazzy Frenchy v] until done\nend\n\n@Rain\n\nwhen flag clicked\nset volume to (100) %\nhide\n\nwhen I receive [restart v]\nforever\n    if <(Level) > [4]> then\n        go to x: (0) y: (0)\n        set [ghost v] effect to (60)\n        show\n        forever\n            go to [back v] layer\n            next costume\n            wait (0.001) seconds\n        end\n    else\n        hide\n    end\nend\n\nwhen I receive [restart v]\nforever\n    if <(Level) > [4]> then\n        forever\n            play sound [Rain v] until done\n        end\n    end\nend\n\nwhen I receive [end v]\nrepeat (10)\n    change volume by (-10)\nend\n\n@Trampoline\n\nwhen flag clicked\npoint in direction (90)\nswitch costume to (trampoline-1 v)\nforever\n    if <(Level) = [6]> then\n        point in direction (90)\n        go to x: (-180) y: (-82)\n        show\n        if <touching (player v)?> then\n            switch costume to (trampoline-1 v)\n            repeat (2)\n                next costume\n                wait (0.001) seconds\n            end\n            wait (0.001) seconds\n            repeat (2)\n                switch costume to ((costume [number v]) - (1))\n                wait (0.001) seconds\n            end\n            wait until <not <touching (player v)?>>\n        else\n            switch costume to (trampoline-1 v)\n        end\n    else\n        if <(Level) = [7]> then\n            point in direction (80)\n            go to x: (0) y: (-90)\n            show\n            if <touching (player v)?> then\n                switch costume to (trampoline-1 v)\n                repeat (2)\n                    next costume\n                    wait (0.001) seconds\n                end\n                wait (0.001) seconds\n                repeat (2)\n                    switch costume to ((costume [number v]) - (1))\n                    wait (0.001) seconds\n                end\n                wait until <not <touching (player v)?>>\n            else\n                switch costume to (trampoline-1 v)\n            end\n        else\n            hide\n        end\n    end\nend\n\n@Rescue Boat\n\nwhen flag clicked\nhide\n\nwhen I receive [restart v]\nforever\n    if <(Level) = [8]> then\n        show\n        forever\n            switch costume to (rescue boat v)\n            set size to (65) %\n            go to x: (0) y: (-100)\n            point in direction ((([cos v] of ((timer) * (100)) ) * (2)) + (90))\n            wait until <touching (player v)?>\n            stop [other scripts in sprite v]\n            broadcast (End v)\n            go to [front v] layer\n            repeat until <(x position) > [284]>\n                change x by (4)\n            end\n            hide\n        end\n    else\n        hide\n    end\nend\n\nrepeat until <(x position) > [284]>\n    change x by (4)\nend\nhide\n\n@Thumbnail\n\nwhen flag clicked\ngo to x: (0) y: (0)\nshow\nforever\n    go to [front v] layer\n    set [ghost v] effect to (100)\nend\n\n
                                        ⬆  \n                      ENTER THIS CONTEST!\n================Instructions=================\n- Arrow keys\n- WASD\n- Mobile\n========================================= \n       Try to get to the rescue boat and finish the game\n                                  Avoid Spikes\n                                    Wall Jump\n