Basketball ~ Platformer


@Stage\n\nwhen flag clicked\nforever\n    play sound [Drake - Toosie Slide \(INSTRUMENTAL\) v] until done\nend\n\nwhen flag clicked\nforever\n    switch backdrop to (Level)\nend\n\n@Player\n\ndefine Position: (x) (y) Set Size To: (size)\ngo to x: (x) y: (y)\nset size to (size) %\n\nwhen flag clicked\nset [level v] to [1]\nshow\nPosition: [-173] [-113] Set Size To: [40]\nhide variable [y v]\nhide variable [x v]\nset [y v] to [0]\nset [x v] to [0]\nforever\n    Game-Play\nend\n\ndefine Game-Play\nforever\n    change [y v] by (-1)\n    if <<<key (a v) pressed?> or <key (left arrow v) pressed?>> or <<mouse down?> and <(mouse x) < (x position)>>> then\n        turn left (4) degrees\n        change [x v] by (-1)\n    end\n    if <<<key (d v) pressed?> or <key (right arrow v) pressed?>> or <<mouse down?> and <(mouse x) > (x position)>>> then\n        change [x v] by (1)\n        turn right (4) degrees\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    end\n    if <touching (level v)?> then\n        change y by (1)\n    end\n    if <touching (level v)?> then\n        change y by (1)\n    end\n    if <touching (level v)?> then\n        change y by (1)\n    end\n    if <touching (level v)?> then\n        change y by (-4)\n        change x by ((x) * (-1))\n        if <<<key (up arrow v) pressed?> or <key (w v) pressed?>> or <<mouse down?> and <(mouse y) > [0]>>> then\n            set [y v] to [17]\n            if <(x) > [0]> then\n                set [x v] to [-10]\n            else\n                set [x v] to [10]\n            end\n        else\n            set [x v] to [0]\n        end\n    end\n    change y by (y)\n    if <touching (level v)?> then\n        change y by ((y) - ((y) * (2)))\n        set [y v] to [0]\n    end\n    change y by (-1)\n    if <<<<key (up arrow v) pressed?> or <key (w v) pressed?>> or <<mouse down?> and <((mouse y) - (y position)) > [50]>>> and <touching (level v)?>> then\n        set [y v] to [15]\n    end\n    change y by (1)\n    if <<<touching (obstacles v)?> or <(y position) < [-175]>> or <key (r v) pressed?>> then\n        Position: [-173] [-113] Set Size To: [40]\n    end\n    if <touching (hoop v)?> then\n        change [level v] by (1)\n        Position: [-173] [-113] Set Size To: [40]\n        broadcast (Spray-Paint Next Level v)\n    end\nend\n\n@Level\n\nwhen flag clicked\nforever\n    switch costume to (Level)\nend\n\n@Obstacles\n\nwhen flag clicked\nforever\n    switch costume to (Level)\nend\n\n@Hoop\n\nwhen flag clicked\nforever\n    switch costume to (Level)\nend\n\nshow\n\n@Sprite1\n\ndefine Vibrate, x: (xpos)  y: (ypos)\nshow\nrepeat (20)\n    go to x: (xpos) y: (ypos)\n    go to x: ((xpos) + (pick random (-5) to (5))) y: ((ypos) + (pick random (-7) to (7)))\nend\nhide\n\nwhen I receive [spray-paint next level v]\nVibrate, x: (1)  y: (1)\n\n@detector\n\nwhen flag clicked\nforever\n    hide\n    set [clone id v] to [0]\n    create clone of (_myself_ v)\n    wait (0.2) seconds\n    set [clone id v] to [1]\n    create clone of (_myself_ v)\n    wait until <<(LOVED__) = [1]> and <(FAVED___) = [1]>>\n    wait (0.5) seconds\n    show\n    go to x: (0) y: (-100)\n    reset timer\n    switch costume to (pick random (1) to (4))\n    set [ghost v] effect to (100)\n    repeat until <(timer) > [3.5]>\n        change y by ((y position) / (-15))\n        change [ghost v] effect by (-3)\n    end\n    reset timer\n    repeat until <(timer) > [3.5]>\n        change y by (((y position) - (-100)) / (-15))\n        change [ghost v] effect by (10)\n    end\nend\n\nwhen I start as a clone\nforever\n    if <(clone id) = [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                wait (0.2) seconds\n                if <touching (mouse-pointer v)?> then\n                    set [loved__ v] to [1]\n                end\n            end\n        end\n    end\n    if <(clone id) = [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                wait (0.2) seconds\n                if <touching (mouse-pointer v)?> then\n                    set [faved___ v] to [1]\n                end\n            end\n        end\n    end\nend\n\n@TN\n\nwhen flag clicked\ngo to x: (0) y: (0)\ngo to [front v] layer\nset [ghost v] effect to (99999999999999999999999)\n\nshow\ngo to [front v] layer\ngo [forward v] (1) layers\nset [ghost v] effect to (0)\n\n