The Mountains I Scrolling Platformer

Instructions: Arrow keys or wad to move, \navoid touching red blocks/enemies.\n\nyou have 3 lives.\n\nCollect all 10 coins. Avoid the spikes.  \n\nDon't fall down the holes! You'll annoy the red sea block!\n

@Stage\n\nwhen flag clicked\nbroadcast (Green Flag v) and wait\nbroadcast (Setup v) and wait\nbroadcast (Play Game v)\n\nforever\n    wait (0.0) seconds\n    play sound [games v] until done\n    wait (0.0) seconds\n    play sound [games2 v] until done\nend\n\nwhen I receive [setup v]\nswitch backdrop to (metro v)\n\nwhen I receive [play game v]\nswitch backdrop to (metro v)\nswitch backdrop to (metro v)\n\nwhen flag clicked\nswitch backdrop to (backdrop2 v)\n\n@Game\n\nthink [dying] for (.5) seconds\n\nthink [dead] for (.5) seconds\n\nwhen flag clicked\nhide\n\nwhen I receive [play game v]\nset [framecounter v] to [0]\nset [timestart v] to (timer)\nrepeat until <not <(exit) = [false]>>\n    broadcast (Update Movement v)\n    broadcast (Update VGround v)\n    broadcast (Update Ground v)\n    broadcast (update enemylight v)\n    broadcast (Update Platform v)\n    broadcast (Update DeepWater v)\n    broadcast (updateenemycannon v)\n    broadcast (Update Water v)\n    broadcast (Update Ladders v)\n    broadcast (Update Enemies v)\n    broadcast (Update Scroll v)\n    broadcast (Animate Enemies v)\n    broadcast (Animate Player v)\n    broadcast (Update Score v)\n    broadcast (UPDATE M PLATFORM v)\n    if <((timer) - (timeStart)) > [1]> then\n        set [@framerate v] to ((frameCounter) / ((timer) - (timeStart)))\n        set [framecounter v] to [0]\n        set [timestart v] to (timer)\n    else\n        change [framecounter v] by (1)\n    end\n    if <(@playerLivesLeft) < [1]> then\n        set [exit v] to [died]\n    end\nend\nif <(exit) = (win)> then\n    Win\nelse\n    Die\nend\n\nwhen I receive [setup v]\nbroadcast (create M platform v)\nbroadcast (Create DeepWater v)\nbroadcast (Create BackdropB v)\nbroadcast (Create BackdropA v)\nbroadcast (Create Platform v)\nbroadcast (Create VGround v)\nbroadcast (create enemy cannon v)\nbroadcast (Create Ground v)\nbroadcast (Create Ladders v)\nbroadcast (Create Enemies v)\nbroadcast (Create enemy light v)\nbroadcast (Create Animate Player v)\nbroadcast (Create Water v)\nbroadcast (Create Frame v)\nbroadcast (Create Game HUD v)\nset [exit v] to [false]\nset [@level v] to [1]\nset [@worldheight v] to [360]\nset [@worldwidth v] to [3000]\nset [@animationtype v] to [standing]\nset [gradientmax2 v] to [3]\nset [playerinair v] to [5]\nset [ax v] to [1]\nset [ay v] to [2]\nset [velocitymovex v] to [5]\nset [velocityjumpy v] to [20]\nset [@boundaryleftx v] to [-180]\nset [@boundaryrightx v] to [100]\nset [velocityymax v] to [20]\nset [heightmax v] to [100]\nset [@playerdied v] to [false]\nset [@diefinished v] to [false]\nset [jumppressed v] to [0]\nset [@playerlivesleft v] to [3]\nPlayerStart\ngo to x: (@playerX) y: (@playerY)\nswitch costume to (playerhitbox v)\ngo to [front v] layer\ngo [backward v] (2) layers\nset size to (100) %\nset [ghost v] effect to (100)\nshow\n\ndefine CheckPlayerControl\nif <<key (right arrow v) pressed?> or <key (d v) pressed?>> then\n    set [@direction v] to [right]\nelse\n    if <<key (left arrow v) pressed?> or <key (a v) pressed?>> then\n        set [@direction v] to [left]\n    else\n        set [@direction v] to []\n    end\nend\nif <<key (up arrow v) pressed?> or <key (w v) pressed?>> then\n    if <(jumpPressed) = [0]> then\n        set [jumppressed v] to [1]\n        set [@jump v] to [true]\n    end\nelse\n    set [@jump v] to [false]\n    set [jumppressed v] to [0]\nend\n\ndefine UpdatePlayerPosition\nif <(@playerDied) = [false]> then\n    if <(@direction) = [left]> then\n        set [changeinx v] to ((-1) * (velocityMoveX))\n    else\n        if <(@direction) = [right]> then\n            set [changeinx v] to ((1) * (velocityMoveX))\n        else\n            if <(changeInX) < [0]> then\n                change [changeinx v] by (aX)\n                if <<(changeInX) > [0]> or <(changeInX) = [0]>> then\n                    set [changeinx v] to [0]\n                end\n            else\n                if <(changeInX) > [0]> then\n                    change [changeinx v] by ((-1) * (aX))\n                    if <<(changeInX) < [0]> or <(changeInX) = [0]>> then\n                        set [changeinx v] to [0]\n                    end\n                end\n            end\n        end\n    end\n    if <(@jump) = [true]> then\n        if <(playerInAir) < [3]> then\n            set [changeiny v] to (velocityJumpY)\n        else\n            set [@jump v] to [false]\n            change [changeiny v] by ((-1) * (aY))\n        end\n    else\n        change [changeiny v] by ((-1) * (aY))\n    end\nelse\n    change [changeiny v] by ((-1) * (aY))\nend\n\ndefine CheckForObstacles\nset [x0 v] to (x position)\nset [y0 v] to (y position)\nset [changeinysaved v] to (changeInY)\nchange x by (changeInX)\nset [hitground v] to [false]\nif <not <(changeInX) = [0]>> then\n    if <touching (vground v)?> then\n        if <(@jump) = [false]> then\n            set [changeiny v] to [0]\n            set [hitground v] to [true]\n        end\n        repeat until <<not <touching (vground v)?>> or <(changeInX) = [0]>>\n            set [gradient v] to ([abs v] of ((changeInY) / (changeInX)) )\n            if <(gradient) < (gradientMax2)> then\n                change [changeiny v] by (1)\n                change y by (1)\n            else\n                if <(changeInX) < [0]> then\n                    change [changeinx v] by (1)\n                    change x by (1)\n                else\n                    change [changeinx v] by (-1)\n                    change x by (-1)\n                end\n                set y to (y0)\n                set [changeiny v] to [0]\n            end\n        end\n        if <(changeInX) = [0]> then\n            set y to (y0)\n            set x to (x0)\n            set [changeiny v] to [-10]\n        end\n    end\n    if <touching (platform v)?> then\n        if <(@jump) = [false]> then\n            set [changeiny v] to [0]\n            set [hitground v] to [true]\n        end\n        repeat until <<not <touching (platform v)?>> or <(changeInX) = [0]>>\n            set [gradient v] to ([abs v] of ((changeInY) / (changeInX)) )\n            if <(gradient) < (gradientMax2)> then\n                change [changeiny v] by (1)\n                change y by (1)\n            else\n                if <(changeInX) < [0]> then\n                    change [changeinx v] by (1)\n                    change x by (1)\n                else\n                    if <(changeInX) > [0]> then\n                        change [changeinx v] by (-1)\n                        change x by (-1)\n                    else\n                        set [changeiny v] to [0]\n                        set x to (x0)\n                    end\n                end\n                set [changeiny v] to [0]\n                set y to (y0)\n            end\n        end\n        if <(changeInX) = [0]> then\n            set y to (y0)\n            set x to (x0)\n            set [changeiny v] to [-10]\n        end\n    end\nend\nchange y by (changeInY)\nif <(changeInY) > [0]> then\n    if <touching (ladders v)?> then\n        set [hitladder v] to [true]\n    else\n        set [hitladder v] to [false]\n    end\n    if <(hitGround) = [true]> then\n        set [playerinair v] to [0]\n    else\n        change [playerinair v] by (1)\n    end\n    if <<touching (platform v)?> or <touching (vground v)?>> then\n        repeat until <<not <<touching (platform v)?> or <touching (vground v)?>>> or <(changeInY) = [0]>>\n            change [changeiny v] by (-1)\n            change y by (-1)\n        end\n    end\nelse\n    if <<touching (vground v)?> or <touching (platform v)?>> then\n        repeat until <<not <<touching (vground v)?> or <touching (platform v)?>>> or <(changeInY) = [0]>>\n            change [changeiny v] by (1)\n            change y by (1)\n        end\n        set [playerinair v] to [0]\n    else\n        if <touching (ladders v)?> then\n            if <(changeInY) < [0]> then\n                if <(hitLadder) = [false]> then\n                    repeat until <not <touching (ladders v)?>>\n                        change [changeiny v] by (1)\n                        change y by (1)\n                    end\n                    set [playerinair v] to [0]\n                else\n                    set [hitladder v] to [true]\n                    change [playerinair v] by (1)\n                end\n            end\n        else\n            if <not <touching (ladders v)?>> then\n                set [hitladder v] to [false]\n                change [playerinair v] by (1)\n            end\n        end\n    end\nend\nif <(@playerDied) = [false]> then\n    if <<(changeInX) = [0]> and <(changeInY) = [0]>> then\n        set [@animationtype v] to [standing]\n    else\n        if <<(changeInY) > [0]> and <(playerInAir) > [2]>> then\n            set [@animationtype v] to [rising]\n        else\n            if <<(changeInY) < [0]> and <(playerInAir) > [2]>> then\n                set [@animationtype v] to [falling]\n            else\n                if <([abs v] of (changeInX) ) > [0]> then\n                    set [@animationtype v] to [walking]\n                end\n            end\n        end\n    end\nend\nif <<touching (deepwater v)?> or <<touching (enemiesmoving v)?> or <touching (spikes v)?>>> then\n    set [changeinx v] to [0]\n    set [changeiny v] to [0]\n    set [@playerdied v] to [true]\n    set [@animationtype v] to [dying]\nend\nset y to (y0)\nset x to (x0)\n\ndefine UpdateSceneMovement\nif <not <(changeInX) = [0]>> then\n    if <((@scrollX) + (changeInX)) < [0]> then\n        set [@playerx v] to ((@scrollX) + ((changeInX) + (@playerX)))\n        set [@scrollx v] to [0]\n    else\n        if <<(@playerX) < [0]> and <((@playerX) + (changeInX)) > [0]>> then\n            set [@scrollx v] to ((changeInX) + (@playerX))\n            set [@playerx v] to [0]\n        else\n            if <<(@playerX) < [0]> and <((@playerX) + (changeInX)) < [1]>> then\n                change [@playerx v] by (changeInX)\n                set [@scrollx v] to [0]\n            else\n                if <((@scrollX) + (changeInX)) > (@worldWidth)> then\n                    set [@playerx v] to ((@scrollX) + ((changeInX) + ((@playerX) - (@worldWidth))))\n                    set [@scrollx v] to (@worldWidth)\n                else\n                    if <<(@playerX) > [0]> and <((@playerX) + (changeInX)) < [0]>> then\n                        set [@scrollx v] to ((@worldWidth) + ((@playerX) + (changeInX)))\n                        set [@playerx v] to [0]\n                    else\n                        if <<(@playerX) > [0]> and <((@playerX) + (changeInX)) > [-1]>> then\n                            change [@playerx v] by (changeInX)\n                            set [@scrollx v] to (@worldWidth)\n                        else\n                            change [@scrollx v] by (changeInX)\n                            set [@playerx v] to [0]\n                        end\n                    end\n                end\n            end\n        end\n    end\nend\nif <(@playerX) > (@boundaryRightX)> then\n    set [@playerx v] to (@boundaryRightX)\nend\nif <(@playerX) < (@boundaryLeftX)> then\n    set [@playerx v] to (@boundaryLeftX)\nend\nif <(@scrollY) = [0]> then\n    if <((@playerY) + (changeInY)) > (heightMax)> then\n        set [@scrolly v] to (((@playerY) + (changeInY)) - (heightMax))\n        set [@playery v] to (heightMax)\n    else\n        change [@playery v] by (changeInY)\n    end\nelse\n    if <((@scrollY) + (changeInY)) < [0]> then\n        set [@playery v] to (((@scrollY) + (changeInY)) + (heightMax))\n        set [@scrolly v] to [0]\n    else\n        change [@scrolly v] by (changeInY)\n        set [@playery v] to (heightMax)\n    end\nend\nset x to (@playerX)\nset y to (@playerY)\n\nwhen I receive [update movement v]\nUpdatePlayerPosition\nif <(@playerDied) = [false]> then\n    CheckPlayerControl\n    CheckForObstacles\nelse\n    CheckForObstacles\n    PlayerDied\nend\nUpdateSceneMovement\n\ndefine PlayerDied\nif <(@animationType) = [dead]> then\n    change [@playerlivesleft v] by (-1)\n    PlayerStart\nend\n\ndefine PlayerStart\nset [@playerx v] to [0]\nset [@playery v] to [60]\nset [@direction v] to []\nset [@scrollx v] to [0]\nset [@scrolly v] to [0]\nset [changeinx v] to [0]\nset [changeiny v] to [0]\nset [@animationtype v] to [standing]\nset [@playerdied v] to [false]\n\nwhen flag clicked\n\nwhen flag clicked\n\nwhen [r v] key pressed\n\nbroadcast (Setup v)\nbroadcast (Play Game v)\nbroadcast (Green Flag v)\n\nwhen flag clicked\n\n\n@EnemiesMoving\n\ndefine CreateEnemyClone (x) (y) Type (type) Distance (distance) Id (id) Fx (fx) count (count)\nset size to (70) %\nif <(type) = [1]> then\n    if <(fx) < [0]> then\n        point in direction (-90)\n    else\n        point in direction (90)\n    end\n    switch costume to (champi v)\nend\nif <(type) = [2]> then\n    if <(fx) < [0]> then\n        point in direction (-90)\n    else\n        point in direction (90)\n    end\n    set size to (80) %\n    switch costume to (hawk v)\n    change [ghost v] effect by (0)\nend\nif <(type) = [3]> then\n    if <(fx) < [0]> then\n        point in direction (-90)\n    else\n        point in direction (90)\n    end\n    set size to (100) %\n    switch costume to (oiseau v)\n    change [ghost v] effect by (0)\nend\nif <(type) = [4]> then\n    set size to (150) %\n    switch costume to (pierre1 v)\n    change [ghost v] effect by (0)\nend\ngo to x: (x) y: (y)\nset [enemyx v] to (x)\nset [enemyy v] to (y)\nset [enemyxorigin v] to (x)\nset [enemyyorigin v] to (y)\nset [enemytype v] to (type)\nset [enemydistance v] to (distance)\nset [enemyfx v] to (fx)\nset [enemycount v] to (count)\nset [speed v] to [0]\nset [enemydied v] to [0]\nset [flyingdirection v] to [1]\nset [flyingdistancey v] to [30]\n\ndefine AnimateHawk\nset [enemyx v] to ((enemyX) + (enemyFx))\nchange [enemyanimation v] by ((1) / (4))\nswitch costume to ([floor v] of (((enemyAnimation) mod (4)) + (1)) )\nif <(enemyAnimation) > [49]> then\n    set [enemyanimation v] to [0]\nend\nif <((enemyYOrigin) - (enemyY)) > (flyingDistanceY)> then\n    set [flyingdirection v] to [1]\nend\nif <((enemyYOrigin) - (enemyY)) < ((-1) * (flyingDistanceY))> then\n    set [flyingdirection v] to [-1]\nend\nchange [enemyy v] by (flyingDirection)\n\ndefine AnimateFox\nchange [enemyanimation v] by ((1) / (4))\nset [lastenemyy v] to (enemyY)\nset [lastenemyx v] to (enemyX)\nset y to (enemyY)\nchange [enemyy v] by (-2)\nchange y by (-2)\nswitch costume to ([floor v] of (((enemyAnimation) mod (10)) + (11)) )\nif <<(costume [number v]) > [13]> and <(costume [number v]) < [18]>> then\n    set [enemyx v] to ((enemyX) + (enemyFx))\nend\nif <touching (vground v)?> then\n    repeat until <not <touching (vground v)?>>\n        change [enemyy v] by (1)\n        change y by (1)\n    end\nelse\n    if <<not <touching (vground v)?>> and <not <(lastEnemyY) = (enemyY)>>> then\n        change [enemyy v] by (-5)\n        change y by (-5)\n    end\nend\nset [lastenemyx v] to (enemyX)\nset [lastenemyy v] to (enemyY)\nset y to (enemyY)\n\nwhen I receive [create_all_sprites v]\nhide\ndelete this clone\n\nwhen I receive [create enemies v]\ngo to [front v] layer\nset [enemyanimation v] to [0]\nshow\npoint in direction (-90)\nchange [ghost v] effect by (0)\nif <(@level) = [1]> then\n    CreateEnemyClone (300) (-100) Type (1) Distance (200) Id (1) Fx (-5) count (0)\n    create clone of (_myself_ v)\n    CreateEnemyClone (1000) (70) Type (1) Distance (100) Id (1) Fx (5) count (0)\n    create clone of (_myself_ v)\n    CreateEnemyClone (1000) (100) Type (2) Distance (300) Id (1) Fx (5) count (0)\n    create clone of (_myself_ v)\n    CreateEnemyClone (500) (600) Type (2) Distance (300) Id (1) Fx (5) count (0)\n    create clone of (_myself_ v)\n    CreateEnemyClone (1522) (1150) Type (2) Distance (300) Id (1) Fx (5) count (0)\n    create clone of (_myself_ v)\n    CreateEnemyClone (829) (1700) Type (2) Distance (300) Id (1) Fx (5) count (0)\n    create clone of (_myself_ v)\n    CreateEnemyClone (890) (0) Type (1) Distance (300) Id (1) Fx (5) count (0)\n    create clone of (_myself_ v)\n    CreateEnemyClone (1800) (0) Type (1) Distance (600) Id (1) Fx (5) count (0)\n    create clone of (_myself_ v)\n    CreateEnemyClone (490) (-500) Type (1) Distance (0) Id (1) Fx (5) count (0)\n    create clone of (_myself_ v)\nend\ngo to x: (0) y: (0)\nhide\n\ndefine PositionEnemy x,y (x) (y)\ngo to x: (x) y: (y)\n\ndefine animate_Rocher\nif <(enemyCount) > [0]> then\n    change [enemycount v] by (1)\n    if <(enemyCount) > [60]> then\n        set [enemycount v] to [0]\n        show\n    end\nelse\n    if <<<((enemyX) - (@scrollX)) > [-200]> and <((enemyX) - (@scrollX)) < [201]>> and <<((enemyY) - (@scrollY)) > [-160]> and <((enemyY) - (@scrollY)) < [140]>>> then\n        change [enemyanimation v] by ((1) / (2))\n        switch costume to ([floor v] of (((enemyAnimation) mod (8)) + (21)) )\n        set [enemyx v] to ((enemyX) + (enemyFx))\n        if <touching (virtualground1 v)?> then\n            repeat until <not <touching (virtualground1 v)?>>\n                change y by (1)\n                change [enemyy v] by (1)\n                set [speed v] to [0]\n            end\n        else\n            set [enemyy v] to ((enemyY) + (speed))\n            change [speed v] by (-1)\n        end\n        if <<((enemyY) - (@scrollY)) < [-150]> or <((enemyX) - (@scrollX)) > [200 ]>> then\n            set [enemycount v] to [1]\n            set [enemyx v] to [-145]\n            set [enemyy v] to [200]\n            set [speed v] to [0]\n            hide\n        end\n    end\nend\n\ndefine animate_Oiseau\nset [enemyy v] to ((enemyY) + (speed))\nif <(enemyY) < [-180]> then\n    change [enemycount v] by (1)\n    set [speed v] to [0]\n    if <(enemyCount) > [150]> then\n        set [speed v] to (enemyDistance)\n        set [enemycount v] to [0]\n    end\nelse\n    change [speed v] by (-1)\nend\n\nwhen I receive [animate enemies v]\nif <(enemyDied) = [0]> then\n    if <(enemyType) < [4]> then\n        change [enemycount v] by (1)\n    end\n    if <(enemyType) = [1]> then\n        AnimateFox\n    end\n    if <(enemyType) = [2]> then\n        AnimateHawk\n    end\n    if <(enemyType) = [3]> then\n        animate_Oiseau\n    end\n    if <(enemyType) = [4]> then\n        animate_Rocher\n    end\n    if <(enemyType) < [3]> then\n        if <(enemyFx) < [0]> then\n            if <((enemyXOrigin) - (enemyX)) > (enemyDistance)> then\n                set [enemyfx v] to ((0) - (enemyFx))\n                point in direction (90)\n            end\n        else\n            if <((enemyX) - (enemyXOrigin)) > (enemyDistance)> then\n                set [enemyfx v] to ((0) - (enemyFx))\n                point in direction (-90)\n            end\n        end\n    end\n    if <<<touching (player v)?> and <(@Animation_type) = [103]>> and <(enemyDied) = [0]>> then\n        change [enemydied v] by ((1) / (3))\n        if <(item (12) of [@list_playsound v]) = [0]> then\n            replace item (12) of [@list_playsound v] with [1]\n        end\n    end\n    if <touching (game v)?> then\n        if <(@Animation_type) = [0]> then\n            if <(item (4) of [@list_playsound v]) = [0]> then\n                replace item (4) of [@list_playsound v] with [1]\n            end\n            set [@animation_type v] to [100]\n        end\n    end\nelse\n    change [enemydied v] by ((1) / (3))\n    set size to (150) %\n    change [ghost v] effect by (0)\n    switch costume to (([floor v] of ((enemyDied) mod (6)) ) + (36))\n    if <(costume [number v]) = [41]> then\n        delete this clone\n    end\nend\n\nwhen I receive [update enemies v]\nPositionEnemy x,y ((enemyX) - (@scrollX)) ((enemyY) - (@scrollY))\n\nif <(gradient) < (gradientMax2)> then\n\nwhen backdrop switches to [plover platformer v]\nhide\n\n@SetupGame\n\nwhen flag clicked\nbroadcast (Lalalal v)\n\nbroadcast (Green Flag v) and wait\nbroadcast (Setup v) and wait\nbroadcast (Play Game v)\n\n@Player\n\nwhen I receive [animate player v]\nif <(@direction) = [left]> then\n    point in direction (-90)\n    set [animationoffsetx v] to [-2]\nelse\n    if <(@direction) = [right]> then\n        point in direction (90)\n        set [animationoffsetx v] to [0]\n    end\nend\nif <(@animationType) = [rising]> then\n    switch costume to (jump_1 v)\n    set [lastanimationtype v] to [rising]\nelse\n    if <(@animationType) = [falling]> then\n        switch costume to (fall_1 v)\n        set [lastanimationtype v] to [falling]\n    else\n        if <(@animationType) = [standing]> then\n            switch costume to (stand_1 v)\n            set [lastanimationtype v] to [standing]\n        else\n            if <(@animationType) = [walking]> then\n                if <not <(lastAnimationType) = [walking]>> then\n                    set [animationframe v] to [0]\n                end\n                if <(animationFrame) = [0]> then\n                    switch costume to (walk1 v)\n                    set [framecounter v] to [0]\n                    change [animationframe v] by (1)\n                else\n                    if <(animationFrame) > [7]> then\n                        switch costume to (walk1 v)\n                        set [animationframe v] to [0]\n                        set [framecounter v] to [1]\n                    else\n                        if <(frameCounter) > (((@frameRate) / (30)) * (walkFrameRate))> then\n                            next costume\n                            change [animationframe v] by (1)\n                            set [framecounter v] to [1]\n                        else\n                            change [framecounter v] by (1)\n                        end\n                    end\n                end\n                set [lastanimationtype v] to [walking]\n            else\n                if <(@animationType) = [dying]> then\n                    if <not <(lastAnimationType) = [dying]>> then\n                        set [animationframe v] to [0]\n                        set [lastanimationtype v] to [dying]\n                        set [counter v] to [0]\n                    end\n                    if <(animationFrame) = [0]> then\n                        switch costume to (die v)\n                        change [animationframe v] by (1)\n                    else\n                        if <(animationFrame) > [2]> then\n                            if <(counter) > ((animationDelay) * (2))> then\n                                set [@animationtype v] to [dead]\n                            else\n                                change [counter v] by (1)\n                            end\n                        else\n                            if <(counter) > (animationDelay)> then\n                                next costume\n                                change [animationframe v] by (1)\n                                set [counter v] to [0]\n                            else\n                                change [counter v] by (1)\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\nend\nset y to (([y position v] of [game v]) + (animationOffsetY))\nset x to (([x position v] of [game v]) + (animationOffsetX))\n\nwhen I receive [create animate player v]\nhide\npoint in direction (90)\nset size to (22) %\nclear graphic effects\nset rotation style [left-right v]\nswitch costume to (plover_stand v)\nset [animationframe v] to [0]\ngo to [front v] layer\nset [lastanimationtype v] to []\nset [animationoffsety v] to [-3]\nset [animationoffsetx v] to [0]\nset [animationdelay v] to [5]\nset [walkframerate v] to [1]\n\nwhen I receive [play game v]\nshow\n\nwhen flag clicked\nhide\n\n@Danger\n\n@Frame\n\nwhen I receive [create frame v]\nset [coins collected v] to [0]\ngo to [front v] layer\ngo to x: (0) y: (0)\n\nwhen flag clicked\nhide\n\nwhen I receive [setup v]\nshow\n\nwhen flag clicked\nforever\n    if <(Coins Collected) = [0]> then\n        switch costume to (costume1 v)\n    end\n    if <(Coins Collected) = [1]> then\n        switch costume to (costume2 v)\n    end\n    if <(Coins Collected) = [2]> then\n        switch costume to (costume3 v)\n    end\n    if <(Coins Collected) = [3]> then\n        switch costume to (costume4 v)\n    end\n    if <(Coins Collected) = [4]> then\n        switch costume to (costume5 v)\n    end\n    if <(Coins Collected) = [5]> then\n        switch costume to (costume6 v)\n    end\n    if <(Coins Collected) = [6]> then\n        switch costume to (costume7 v)\n    end\n    if <(Coins Collected) = [7]> then\n        switch costume to (costume8 v)\n    end\n    if <(Coins Collected) = [8]> then\n        switch costume to (costume9 v)\n    end\n    if <(Coins Collected) = [9]> then\n        switch costume to (costume10 v)\n    end\n    if <(Coins Collected) = [10]> then\n        switch costume to (costume11 v)\n    end\n    if <(@playerLivesLeft) = [0]> then\n        switch costume to (costume12 v)\n    end\nend\n\nwhen flag clicked\nforever\n    play sound [mixkit-raising-me-higher-34 v] until done\n    wait (0) seconds\nend\n\nwhen flag clicked\nforever\n    if <[] = [231455356635]> then\nend\n\n@BackdropA\n\ndefine Position (x) (y)\nif <(x) < [-480]> then\n    change [positionx v] by (960)\n    switch costume to ((costume [number v]) + (2))\nend\nif <(x) > [480]> then\n    change [positionx v] by (-960)\n    switch costume to ((costume [number v]) - (2))\nend\ngo to x: (x) y: (y)\n\nwhen I receive [create backdropa v]\nshow\nset [numberofgroundcostumes v] to [3]\nswitch costume to (ba1-1 v)\nCreateGroundClone [0] [0]\nCreateGroundClone [1] [0]\nhide\n\ndefine CreateGroundClone (x) (y)\ngo to x: ((x) * (480)) y: ((y) * (360))\nset [positionx v] to ((x) * (480))\nset [positiony v] to ((y) * (360))\ncreate clone of (_myself_ v)\n\nwhen I receive [update scroll v]\nPosition ((positionX) - (round ((@scrollX) / (10)))) ((positionY) - (round ((@scrollY) / (10))))\n\n@BackdropB\n\ndefine Position (x) (y)\nif <(x) < [-480]> then\n    change [positionx v] by (960)\nend\nif <(x) > [480]> then\n    change [positionx v] by (-960)\nend\ngo to x: (x) y: (y)\n\nwhen I receive [create backdropb v]\nshow\ngo [forward v] (1) layers\nset [numberofgroundcostumes v] to [3]\nswitch costume to (ba1-1 v)\nCreateGroundClone [0] [0]\nCreateGroundClone [1] [0]\nhide\n\ndefine CreateGroundClone (x) (y)\ngo to x: ((x) * (480)) y: ((y) * (360))\nset [positionx v] to ((x) * (480))\nset [positiony v] to ((y) * (360))\ncreate clone of (_myself_ v)\n\nwhen I receive [update scroll v]\nPosition ((positionX) - (round ((@scrollX) / (5)))) ((positionY) - (round ((@scrollY) / (5))))\n\nswitch costume to ((costume [number v]) + (2))\n\nswitch costume to ((costume [number v]) - (2))\n\n@Ground\n\ndefine Position (x) (y)\nif <(x) < [-480]> then\n    change [positionx v] by (960)\n    switch costume to ((costume [number v]) + (2))\nend\nif <(x) > [480]> then\n    change [positionx v] by (-960)\n    switch costume to ((costume [number v]) - (2))\nend\ngo to x: (x) y: (y)\n\nwhen I receive [create ground v]\nshow\ngo to [front v] layer\ngo [backward v] (40) layers\nswitch costume to (g1-1 v)\nCreateGroundClone [0] [0]\nswitch costume to (g1-2 v)\nCreateGroundClone [1] [0]\nhide\n\ndefine CreateGroundClone (x) (y)\ngo to x: ((x) * (480)) y: ((y) * (360))\nset [positionx v] to ((x) * (480))\nset [positiony v] to ((y) * (360))\ncreate clone of (_myself_ v)\n\nwhen I receive [update ground v]\nPosition ((positionX) - (@scrollX)) ((positionY) - (@scrollY))\n\n@Platform\n\ndefine Position (x) (y)\ngo to x: (x) y: (y)\n\nwhen I receive [create platform v]\nshow\ngo to [front v] layer\nswitch costume to (p1-1 v)\nCreatePlatformClone [100] [70] Type [static] Speed [0] Distance [0]\ncreate clone of (_myself_ v)\nCreatePlatformClone [230] [120] Type [static] Speed [0] Distance [0]\ncreate clone of (_myself_ v)\nCreatePlatformClone [200] [190] Type [static] Speed [0] Distance [0]\ncreate clone of (_myself_ v)\nswitch costume to (p1-2 v)\nCreatePlatformClone [280] [300] Type [static] Speed [0] Distance [0]\ncreate clone of (_myself_ v)\nswitch costume to (p1-3 v)\nCreatePlatformClone [160] [420] Type [static] Speed [0] Distance [0]\ncreate clone of (_myself_ v)\nswitch costume to (p1-3 v)\nCreatePlatformClone [1420] [-80] Type [static] Speed [0] Distance [0]\ncreate clone of (_myself_ v)\nswitch costume to (p1-4 v)\nCreatePlatformClone [1650] [60] Type [static] Speed [0] Distance [0]\ncreate clone of (_myself_ v)\nswitch costume to (p1-4 v)\nCreatePlatformClone [2400] [90] Type [static] Speed [0] Distance [0]\ncreate clone of (_myself_ v)\nswitch costume to (p1-2 v)\nCreatePlatformClone [2500] [180] Type [static] Speed [0] Distance [0]\ncreate clone of (_myself_ v)\nswitch costume to (p1-3 v)\nCreatePlatformClone [2600] [260] Type [static] Speed [0] Distance [0]\ncreate clone of (_myself_ v)\nswitch costume to (p1-6 v)\nCreatePlatformClone [2700] [350] Type [static] Speed [0] Distance [0]\ncreate clone of (_myself_ v)\nswitch costume to (p1-5 v)\nCreatePlatformClone [2800] [450] Type [static] Speed [0] Distance [0]\ncreate clone of (_myself_ v)\nswitch costume to (p1-6 v)\nCreatePlatformClone [2900] [550] Type [static] Speed [0] Distance [0]\ncreate clone of (_myself_ v)\nswitch costume to (p1-6 v)\nCreatePlatformClone [2800] [650] Type [static] Speed [0] Distance [0]\ncreate clone of (_myself_ v)\nswitch costume to (p1-6 v)\nCreatePlatformClone [2700] [780] Type [static] Speed [0] Distance [0]\ncreate clone of (_myself_ v)\nswitch costume to (p1-6 v)\nCreatePlatformClone [2500] [700] Type [static] Speed [0] Distance [0]\n\ndefine CreatePlatformClone (x) (y) Type (type) Speed (speed) Distance (distance)\nset [platformx v] to (x)\nset [platformy v] to (y)\nset [platformxorigin v] to (x)\nset [platformyorigin v] to (y)\nset [platformtype v] to (type)\nset [platformdistance v] to (distance)\nset [platformspeed v] to (speed)\ngo to x: (x) y: (y)\n\nwhen I receive [update platform v]\nif <(platformType) = [moving]> then\n    if <(platformSpeed) > [0]> then\n        change [platformx v] by (platformSpeed)\n        if <((platformX) - (platformXOrigin)) > (platformDistance)> then\n            set [platformx v] to ((platformXOrigin) + (platformDistance))\n            set [platformspeed v] to ((-1) * (platformSpeed))\n        end\n    else\n        change [platformx v] by (platformSpeed)\n        if <((platformXOrigin) - (platformX)) > (platformDistance)> then\n            set [platformx v] to ((platformXOrigin) - (platformDistance))\n            set [platformspeed v] to ((-1) * (platformSpeed))\n        end\n    end\nend\nPosition ((platformX) - (@scrollX)) ((platformY) - (@scrollY))\n\nwhen I receive [create_all_sprites v]\nhide\ndelete this clone\n\nset [platformy v] to (y)\nset [platformtype v] to (type)\nset [platformdistance v] to (distance)\n\nwhen flag clicked\nhide\n\n@GameHUD\n\nwhen I receive [update score v]\nif <(lifeNumber) = [1]> then\n    if <(@playerLivesLeft) > [0]> then\n    else\n        hide\n    end\nend\nif <(lifeNumber) = [2]> then\n    if <(@playerLivesLeft) > [1]> then\n    else\n        hide\n    end\nend\nif <(lifeNumber) = [3]> then\n    if <(@playerLivesLeft) > [2]> then\n    else\n        hide\n    end\nend\n\nshow\n\nshow\n\nif <(lifeNumber) = [4]> then\n    if <(@playerLivesLeft) > [5]> then\n        show\n    else\n        hide\n    end\nend\nif <(lifeNumber) = [5]> then\n    if <(@playerLivesLeft) > [4]> then\n        show\n    else\n        hide\n    end\nend\nif <(lifeNumber) = [6]> then\n    if <(@playerLivesLeft) > [3]> then\n        show\n    else\n        hide\n    end\nend\nif <(lifeNumber) = [7]> then\n    if <(@playerLivesLeft) > [2]> then\n        show\n    else\n        hide\n    end\nend\nif <(lifeNumber) = [8]> then\n    if <(@playerLivesLeft) > [1]> then\n        show\n    else\n        hide\n    end\nend\nif <(lifeNumber) = [9]> then\n    if <(@playerLivesLeft) > [0]> then\n        show\n    else\n        hide\n    end\nend\n\nwhen I receive [create game hud v]\ngo to [front v] layer\nswitch costume to (heart red v)\nset [lifenumber v] to [1]\ngo to x: (200) y: (171)\ncreate clone of (_myself_ v)\ngo to [front v] layer\nset [lifenumber v] to [2]\ngo to x: (185) y: (171)\ncreate clone of (_myself_ v)\ngo to [front v] layer\nset [lifenumber v] to [3]\ngo to x: (170) y: (171)\ncreate clone of (_myself_ v)\ngo to [front v] layer\n\nshow\n\nset [lifenumber v] to [4]\ngo to x: (140) y: (171)\ncreate clone of (_myself_ v)\ngo to [front v] layer\nset [lifenumber v] to [5]\ngo to x: (155) y: (171)\ngo to [front v] layer\ncreate clone of (_myself_ v)\ngo to [front v] layer\nset [lifenumber v] to [6]\ngo to x: (170) y: (171)\ngo to [front v] layer\ncreate clone of (_myself_ v)\ngo to [front v] layer\nset [lifenumber v] to [7]\ngo to x: (185) y: (171)\ngo to [front v] layer\ncreate clone of (_myself_ v)\nset [lifenumber v] to [8]\ngo to x: (200) y: (171)\ngo to [front v] layer\ncreate clone of (_myself_ v)\nset [lifenumber v] to [9]\ngo to x: (215) y: (171)\ngo to [front v] layer\ncreate clone of (_myself_ v)\n\nwhen flag clicked\nhide\n\nwhen I receive [setup v]\n\nshow\n\nwhen flag clicked\nforever\n    go to [front v] layer\n    go [forward v] (6) layers\nend\n\nshow\n\n@DeepWater\n\nwhen I receive [update deepwater v]\ngo to x: (0) y: ((positionY) - (@scrollY))\n\nwhen I receive [create deepwater v]\nset [positiony v] to [0]\ngo to [back v] layer\nshow\n\nhide\n\nwhen flag clicked\nhide\n\nwhen I receive [setup v]\nshow\n\nwhen flag clicked\nforever\n    if <touching (game v)?> then\n        CheckForObstacles\n    end\nend\n\ndefine CheckForObstacles\nset [x0 v] to (x position)\nset [y0 v] to (y position)\nset [changeinysaved v] to (changeInY)\nchange x by (changeInX)\nset [hitground v] to [false]\nif <not <(changeInX) = [0]>> then\n    if <touching (vground v)?> then\n        if <(@jump) = [false]> then\n            set [changeiny v] to [0]\n            set [hitground v] to [true]\n        end\n        repeat until <<not <touching (vground v)?>> or <(changeInX) = [0]>>\n            set [gradient v] to ([abs v] of ((changeInY) / (changeInX)) )\n            if <(gradient) < (gradientMax2)> then\n                change [changeiny v] by (1)\n                change y by (1)\n            else\n                if <(changeInX) < [0]> then\n                    change [changeinx v] by (1)\n                    change x by (1)\n                else\n                    change [changeinx v] by (-1)\n                    change x by (-1)\n                end\n                set y to (y0)\n                set [changeiny v] to [0]\n            end\n        end\n        if <(changeInX) = [0]> then\n            set y to (y0)\n            set x to (x0)\n            set [changeiny v] to [-10]\n        end\n    end\n    if <touching (platform v)?> then\n        if <(@jump) = [false]> then\n            set [changeiny v] to [0]\n            set [hitground v] to [true]\n        end\n        repeat until <<not <touching (platform v)?>> or <(changeInX) = [0]>>\n            set [gradient v] to ([abs v] of ((changeInY) / (changeInX)) )\n            if <(gradient) < (gradientMax2)> then\n                change [changeiny v] by (1)\n                change y by (1)\n            else\n                if <(changeInX) < [0]> then\n                    change [changeinx v] by (1)\n                    change x by (1)\n                else\n                    if <(changeInX) > [0]> then\n                        change [changeinx v] by (-1)\n                        change x by (-1)\n                    else\n                        set [changeiny v] to [0]\n                        set x to (x0)\n                    end\n                end\n                set [changeiny v] to [0]\n                set y to (y0)\n            end\n        end\n        if <(changeInX) = [0]> then\n            set y to (y0)\n            set x to (x0)\n            set [changeiny v] to [-10]\n        end\n    end\nend\nchange y by (changeInY)\nif <(changeInY) > [0]> then\n    if <touching (ladders v)?> then\n        set [hitladder v] to [true]\n    else\n        set [hitladder v] to [false]\n    end\n    if <(hitGround) = [true]> then\n        set [playerinair v] to [0]\n    else\n        change [playerinair v] by (1)\n    end\n    if <<touching (platform v)?> or <touching (vground v)?>> then\n        repeat until <<not <<touching (platform v)?> or <touching (vground v)?>>> or <(changeInY) = [0]>>\n            change [changeiny v] by (-1)\n            change y by (-1)\n        end\n    end\nelse\n    if <<touching (vground v)?> or <touching (platform v)?>> then\n        repeat until <<not <<touching (vground v)?> or <touching (platform v)?>>> or <(changeInY) = [0]>>\n            change [changeiny v] by (1)\n            change y by (1)\n        end\n        set [playerinair v] to [0]\n    else\n        if <touching (ladders v)?> then\n            if <(changeInY) < [0]> then\n                if <(hitLadder) = [false]> then\n                    repeat until <not <touching (ladders v)?>>\n                        change [changeiny v] by (1)\n                        change y by (1)\n                    end\n                    set [playerinair v] to [0]\n                else\n                    set [hitladder v] to [true]\n                    change [playerinair v] by (1)\n                end\n            end\n        else\n            if <not <touching (ladders v)?>> then\n                set [hitladder v] to [false]\n                change [playerinair v] by (1)\n            end\n        end\n    end\nend\nif <(@playerDied) = [false]> then\n    if <<(changeInX) = [0]> and <(changeInY) = [0]>> then\n        set [@animationtype v] to [standing]\n    else\n        if <<(changeInY) > [0]> and <(playerInAir) > [2]>> then\n            set [@animationtype v] to [rising]\n        else\n            if <<(changeInY) < [0]> and <(playerInAir) > [2]>> then\n                set [@animationtype v] to [falling]\n            else\n                if <([abs v] of (changeInX) ) > [0]> then\n                    set [@animationtype v] to [walking]\n                end\n            end\n        end\n    end\nend\nif <<touching (deepwater v)?> or <<touching (enemiesmoving v)?> or <touching (deepwater v)?>>> then\n    set [changeinx v] to [0]\n    set [changeiny v] to [0]\n    set [@playerdied v] to [true]\n    set [@animationtype v] to [dying]\nend\nset y to (y0)\nset x to (x0)\n\n@Water\n\ndefine Position (x) (y)\nif <(x) < [-480]> then\n    change [positionx v] by (960)\n    switch costume to ((costume [number v]) + (2))\nend\nif <(x) > [480]> then\n    change [positionx v] by (-960)\n    switch costume to ((costume [number v]) - (2))\nend\ngo to x: (x) y: (y)\n\nwhen I receive [create water v]\nshow\ngo to [front v] layer\ngo [backward v] (55) layers\nset [ghost v] effect to (50)\nswitch costume to (g1-1 v)\nCreateWaterClone [0] [0]\nswitch costume to (g1-2 v)\nCreateWaterClone [1] [0]\nhide\n\ndefine CreateWaterClone (x) (y)\ngo to x: ((x) * (480)) y: ((y) * (360))\nset [positionx v] to ((x) * (480))\nset [positiony v] to ((y) * (360))\ncreate clone of (_myself_ v)\n\nwhen I receive [update water v]\nPosition ((positionX) - (@scrollX)) ((positionY) - (@scrollY))\n\n@VGround\n\ndefine Position (x) (y)\nif <(x) < [-480]> then\n    change [positionx v] by (960)\n    switch costume to ((costume [number v]) + (2))\nend\nif <(x) > [480]> then\n    change [positionx v] by (-960)\n    switch costume to ((costume [number v]) - (2))\nend\ngo to x: (x) y: (y)\n\nwhen I receive [create vground v]\nshow\nset [ghost v] effect to (100)\ngo to [front v] layer\nswitch costume to (g1-1 v)\nCreateGroundClone [0] [0]\nswitch costume to (g1-2 v)\nCreateGroundClone [1] [0]\nhide\n\ndefine CreateGroundClone (x) (y)\ngo to x: ((x) * (480)) y: ((y) * (360))\nset [positionx v] to ((x) * (480))\nset [positiony v] to ((y) * (360))\ncreate clone of (_myself_ v)\n\nwhen I receive [update vground v]\nPosition ((positionX) - (@scrollX)) ((positionY) - (@scrollY))\n\n@Coins\n\ndefine Position (x) (y)\ngo to x: (x) y: (y)\n\nwhen I receive [create platform v]\nshow\ngo to [front v] layer\nswitch costume to (p1-1 v)\nCreatePlatformClone [2709] [913] Type [static] Speed [0] Distance [0]\ncreate clone of (_myself_ v)\nswitch costume to (p1-4 v)\nCreatePlatformClone [2844] [656] Type [static] Speed [0] Distance [0]\ncreate clone of (_myself_ v)\nswitch costume to (p1-3 v)\nCreatePlatformClone [2036] [13] Type [static] Speed [0] Distance [0]\ncreate clone of (_myself_ v)\nswitch costume to (p1-2 v)\nCreatePlatformClone [234] [140] Type [static] Speed [0] Distance [0]\ncreate clone of (_myself_ v)\nswitch costume to (p1-3 v)\nCreatePlatformClone [100] [13] Type [static] Speed [0] Distance [0]\ncreate clone of (_myself_ v)\nswitch costume to (p1-3 v)\nCreatePlatformClone [2600] [320] Type [static] Speed [0] Distance [0]\ncreate clone of (_myself_ v)\nswitch costume to (p1-4 v)\nCreatePlatformClone [2500] [800] Type [static] Speed [0] Distance [0]\ncreate clone of (_myself_ v)\nswitch costume to (p1-4 v)\nCreatePlatformClone [1663] [100] Type [static] Speed [0] Distance [0]\ncreate clone of (_myself_ v)\nswitch costume to (p1-2 v)\nCreatePlatformClone [906] [100] Type [static] Speed [0] Distance [0]\ncreate clone of (_myself_ v)\nswitch costume to (p1-3 v)\nCreatePlatformClone [310] [310] Type [static] Speed [0] Distance [0]\ncreate clone of (_myself_ v)\nswitch costume to (p1-3 v)\nCreatePlatformClone [-280] [-49] Type [static] Speed [0] Distance [0]\ncreate clone of (_myself_ v)\nswitch costume to (p1-6 v)\n\ndefine CreatePlatformClone (x) (y) Type (type) Speed (speed) Distance (distance)\nset [platformx v] to (x)\nset [platformy v] to (y)\nset [platformxorigin v] to (x)\nset [platformyorigin v] to (y)\nset [platformtype v] to (type)\nset [platformdistance v] to (distance)\nset [platformspeed v] to (speed)\ngo to x: (x) y: (y)\n\nwhen I receive [update platform v]\nif <(platformType) = [moving]> then\n    if <(platformSpeed) > [0]> then\n        change [platformx v] by (platformSpeed)\n        if <((platformX) - (platformXOrigin)) > (platformDistance)> then\n            set [platformx v] to ((platformXOrigin) + (platformDistance))\n            set [platformspeed v] to ((-1) * (platformSpeed))\n        end\n    else\n        change [platformx v] by (platformSpeed)\n        if <((platformXOrigin) - (platformX)) > (platformDistance)> then\n            set [platformx v] to ((platformXOrigin) - (platformDistance))\n            set [platformspeed v] to ((-1) * (platformSpeed))\n        end\n    end\nend\nPosition ((platformX) - (@scrollX)) ((platformY) - (@scrollY))\n\nwhen I receive [create_all_sprites v]\nhide\ndelete this clone\n\nset [platformy v] to (y)\nset [platformtype v] to (type)\nset [platformdistance v] to (distance)\n\nwhen flag clicked\n\nwhen flag clicked\nhide\n\nswitch costume to (costume1 v)\n\nwhen I start as a clone\nforever\n    if <touching (game v)?> then\n        change [coins collected v] by (1)\n        hide\n        delete this clone\n    end\nend\n\n@Spikes\n\ndefine Position (x) (y)\ngo to x: (x) y: (y)\n\nwhen I receive [create platform v]\nshow\ngo to [front v] layer\nswitch costume to (p1-1 v)\nCreatePlatformClone [100] [-30] Type [moving] Speed [3] Distance [50]\ncreate clone of (_myself_ v)\nswitch costume to (p1-1 v)\nCreatePlatformClone [1398] [-30] Type [moving] Speed [5] Distance [150]\ncreate clone of (_myself_ v)\nswitch costume to (p1-1 v)\nCreatePlatformClone [1860] [-30] Type [moving] Speed [2] Distance [10]\ncreate clone of (_myself_ v)\nswitch costume to (p1-1 v)\nCreatePlatformClone [2135] [-30] Type [moving] Speed [3] Distance [10]\ncreate clone of (_myself_ v)\nswitch costume to (p1-1 v)\nCreatePlatformClone [2330] [-30] Type [moving] Speed [5] Distance [10]\ncreate clone of (_myself_ v)\nswitch costume to (p1-1 v)\nCreatePlatformClone [3000] [-30] Type [moving] Speed [2] Distance [10]\ncreate clone of (_myself_ v)\nswitch costume to (p1-1 v)\nCreatePlatformClone [2900] [576] Type [moving] Speed [1] Distance [3]\ncreate clone of (_myself_ v)\n\ndefine CreatePlatformClone (x) (y) Type (type) Speed (speed) Distance (distance)\nset [platformx v] to (x)\nset [platformy v] to (y)\nset [platformxorigin v] to (x)\nset [platformyorigin v] to (y)\nset [platformtype v] to (type)\nset [platformdistance v] to (distance)\nset [platformspeed v] to (speed)\ngo to x: (x) y: (y)\n\nwhen I receive [update platform v]\nif <(platformType) = [moving]> then\n    if <(platformSpeed) > [0]> then\n        change [platformx v] by (platformSpeed)\n        if <((platformX) - (platformXOrigin)) > (platformDistance)> then\n            set [platformx v] to ((platformXOrigin) + (platformDistance))\n            set [platformspeed v] to ((-1) * (platformSpeed))\n        end\n    else\n        change [platformx v] by (platformSpeed)\n        if <((platformXOrigin) - (platformX)) > (platformDistance)> then\n            set [platformx v] to ((platformXOrigin) - (platformDistance))\n            set [platformspeed v] to ((-1) * (platformSpeed))\n        end\n    end\nend\nPosition ((platformX) - (@scrollX)) ((platformY) - (@scrollY))\n\nwhen I receive [create_all_sprites v]\nhide\ndelete this clone\n\nset [platformy v] to (y)\nset [platformtype v] to (type)\nset [platformdistance v] to (distance)\n\nwhen flag clicked\nhide\n\nwhen flag clicked\ngo to [front v] layer\ngo to [front v] layer\n\n@Sprite1\n\nrepeat (10)\n\nwhen flag clicked\n\nwhen I receive [setup v]\nif <(@-USERNAME-) = [Yellow-Brain]> then\n    show\n    set [ghost v] effect to (0)\n    wait (1) seconds\n    repeat (30)\n        change [ghost v] effect by (5)\n        wait (0) seconds\n    end\nelse\n    hide\nend\n\n@Health\n\nwhen flag clicked\ngo to x: (147) y: (170)\nhide\n\nwhen I receive [play game v]\nshow\nforever\n    go to [front v] layer\n    if <(@playerLivesLeft) = [0]> then\n        switch costume to (costume4 v)\n    end\n    if <(@playerLivesLeft) = [1]> then\n        switch costume to (costume3 v)\n    end\n    if <(@playerLivesLeft) = [2]> then\n        switch costume to (costume2 v)\n    end\n    if <(@playerLivesLeft) = [3]> then\n        switch costume to (costume1 v)\n    end\nend\n\n@Sprite2\n\nwhen flag clicked\n\nswitch costume to (costume1 v)\nrepeat (39)\n    wait (0.02) seconds\n    next costume\nend\nhide\nbroadcast (Green Flag v) and wait\nbroadcast (Setup v) and wait\nbroadcast (Play Game v)\n\nwhen flag clicked\nshow\n\nforever\n\n@Sprite3\n\nwhen flag clicked\ngo to [front v] layer\ngo to [front v] layer\ngo to [front v] layer\ngo to [front v] layer\nwait (3) seconds\ngo to [front v] layer\ngo to [front v] layer\ngo to [front v] layer\ngo to [front v] layer\n\nforever\n\nwhen flag clicked\nforever\n    if <(@--ABC__----) = [1]> then\n        show\n    else\n        hide\n    end\nend\n\nwhen flag clicked\nforever\n    if <(Coins Collected) = [0]> then\n        switch costume to (costume1 v)\n    end\n    if <(Coins Collected) = [1]> then\n        switch costume to (costume2 v)\n    end\n    if <(Coins Collected) = [2]> then\n        switch costume to (costume3 v)\n    end\n    if <(Coins Collected) = [3]> then\n        switch costume to (costume4 v)\n    end\n    if <(Coins Collected) = [4]> then\n        switch costume to (costume5 v)\n    end\n    if <(Coins Collected) = [5]> then\n        switch costume to (costume6 v)\n    end\n    if <(Coins Collected) = [6]> then\n        switch costume to (costume7 v)\n    end\n    if <(Coins Collected) = [7]> then\n        switch costume to (costume8 v)\n    end\n    if <(Coins Collected) = [8]> then\n        switch costume to (costume9 v)\n    end\n    if <(Coins Collected) = [9]> then\n        switch costume to (costume10 v)\n    end\n    if <(Coins Collected) = [10]> then\n        hide\n    end\nend\n\n@Sprite4\n\nwhen flag clicked\nforever\n    go to (mouse-pointer v)\nend\n\nwhen flag clicked\nforever\n    if <<<(x position) = [-189]> and <(y position) = [180]>> or <<<(x position) = [-190]> and <(y position) = [180]>> or <<<(x position) = [-191]> and <(y position) = [180]>> or <<<(x position) = [-192]> and <(y position) = [180]>> or <<<(x position) = [-193]> and <(y position) = [180]>> or <<<(x position) = [-194]> and <(y position) = [180]>> or <<<(x position) = [-195]> and <(y position) = [180]>> or <<<(x position) = [-196]> and <(y position) = [180]>> or <<<(x position) = [-197]> and <(y position) = [180]>> or <<<(x position) = [-198]> and <(y position) = [180]>> or <<<(x position) = [-199]> and <(y position) = [180]>> or <<<(x position) = [-200]> and <(y position) = [180]>> or <<<(x position) = [-201]> and <(y position) = [180]>> or <<<(x position) = [-202]> and <(y position) = [180]>> or <<<(x position) = [-203]> and <(y position) = [180]>> or <<<(x position) = [-204]> and <(y position) = [180]>> or <<<(x position) = [-205]> and <(y position) = [180]>> or <<(x position) = [-206]> and <(y position) = [180]>>>>>>>>>>>>>>>>>>> then\n        set [@--abc__---- v] to [1]\n    else\n        set [@--abc__---- v] to [0]\n    end\nend\n\n@Sprite5\n\nwhen flag clicked\nhide\nforever\n    go to [front v] layer\nend\n\nwhen I receive [play game v]\nshow\n\n@detector\n\nwhen flag clicked\nhide\nset [faved___ v] to [0]\nset [loved__ v] to [0]\nset [clone id2 v] to [0]\ncreate clone of (_myself_ v)\nwait (0.2) seconds\nset [clone id2 v] to [1]\ncreate clone of (_myself_ v)\nwait until <<(LOVED__) = [1]> and <(FAVED___) = [1]>>\nwait (1) seconds\nshow\ngo to x: (0) y: (50)\nreset timer\nswitch costume to (pick random (1) to (4))\nset [ghost v] effect to (100)\nrepeat until <(timer) > [3.5]>\n    change y by ((y position) / (-15))\n    change [ghost v] effect by (-3)\n    go to [front v] layer\nend\nreset timer\nrepeat until <(timer) > [3.5]>\n    change y by (((y position) - (-100)) / (-15))\n    change [ghost v] effect by (10)\nend\n\nwhen I start as a clone\nif <(clone id2) = [0]> then\n    go to x: (-15) y: (0)\n    set [loved__ v] to [0]\n    switch costume to (love v)\n    forever\n        set [love? v] to <touching (mouse-pointer v)?>\n        if <touching (mouse-pointer v)?> then\n            set [loved__ v] to [1]\n        end\n    end\nend\nif <(clone id2) = [1]> then\n    go to x: (0) y: (0)\n    switch costume to (fave v)\n    set [faved___ v] to [0]\n    forever\n        set [fav v] to <touching (mouse-pointer v)?>\n        if <touching (mouse-pointer v)?> then\n            set [faved___ v] to [1]\n        end\n    end\nend\n\n@LOGO\n\nwhen flag clicked\nhide\nset [timer v] to [.1]\nforever\n    set [timer v] to ((timer) + (.1))\nend\n\nwhen [timer v] > (Timer)\nshow\n\nwhen flag clicked\nforever\n    go to [front v] layer\nend\n\n