Billiards (a platformer) (a contest entry)
@Stage\n\nwhen flag clicked\nset [.i v] to [0]\nforever\n    change [.i v] by (0.04)\nend\n\nwhen flag clicked\nswitch backdrop to (backdrop2 v)\n\nwhen I receive [start v]\nswitch backdrop to (backdrop1 v)\nplay sound [Casino Intro v] until done\nforever\n    play sound [Casino Loop v] until done\nend\n\n@Player\n\nwhen flag clicked\nhide\n\ndefine Platform (jump height) (gravity) (friction) (speed) (wjx) (wjy)\nswitch costume to (idle v)\nif <<key (right arrow v) pressed?> or <key (d v) pressed?>> then\n    change [xv v] by (speed)\nend\nif <<key (left arrow v) pressed?> or <key (a v) pressed?>> then\n    change [xv v] by ((speed) * (-1))\nend\nset [xv v] to ((XV) * (friction))\nchange x by (XV)\nif <touching (level v)?> then\n    set [slope v] to [0]\n    repeat until <<(Slope) < [-8]> or <not <touching (level v)?>>>\n        change y by (1)\n        change [slope v] by (-1)\n    end\n    if <touching (level v)?> then\n        change y by (Slope)\n        repeat ([ceiling v] of ([abs v] of (XV) ) )\n            if <touching (level v)?> then\n                change x by ((([abs v] of (XV) ) / (XV)) * (-1))\n            end\n        end\n        if <<key (up arrow v) pressed?> or <key (w v) pressed?>> then\n            if <(([abs v] of (XV) ) / (XV)) = [1]> then\n                set [xv v] to [0]\n                if <<key (right arrow v) pressed?> or <key (d v) pressed?>> then\n                    set [yv v] to (wjy)\n                    set [xv v] to ((wjx) * (-1))\n                end\n            else\n                if <(([abs v] of (XV) ) / (XV)) = [-1]> then\n                    set [xv v] to [0]\n                    if <<key (left arrow v) pressed?> or <key (a v) pressed?>> then\n                        set [yv v] to (wjy)\n                        set [xv v] to (wjx)\n                    end\n                end\n            end\n        end\n    end\nend\nchange [yv v] by (gravity)\nchange y by (YV)\nif <<touching (level v)?> or <touching (pool balls v)?>> then\n    repeat ([ceiling v] of ([abs v] of (YV) ) )\n        if <<touching (level v)?> or <touching (pool balls v)?>> then\n            change y by ((([abs v] of (YV) ) / (YV)) * (-1))\n        end\n    end\n    if <<(([abs v] of (YV) ) / (YV)) = [-1]> and <<key (up arrow v) pressed?> or <key (w v) pressed?>>> then\n        set [yv v] to (jump height)\n    else\n        set [yv v] to [0]\n    end\nend\n\ndefine Death\nset [xv v] to [-10]\nset [yv v] to [18]\nstart sound [Whiz v]\nrepeat until <touching (_edge_ v)?>\n    change x by (XV)\n    change [yv v] by (-1)\n    change y by (YV)\nend\nset [xv v] to [0]\nset [yv v] to [0]\ngo to x: (-199) y: (-62)\n\nwhen I receive [goal! v]\nGLIDE ([x position v] of [portal v]) ([y position v] of [portal v])\nhide\n\ndefine GLIDE (x) (y)\nrepeat until <<(round (x position)) = (round (x))> and <(round (y position)) = (round (y))>>\n    change x by (((x) - (x position)) / (2))\n    change y by (((y) - (y position)) / (2))\nend\n\nwhen I receive [bounce v]\nset [yv v] to [20]\n\nwhen I receive [clak v]\nwait (0.02) seconds\nset [xv v] to ((XV) * (-0.8))\n\nwhen I receive [spawn sticks v]\nshow\nset [xv v] to [0]\nset [yv v] to [0]\ngo to x: (-199) y: (-62)\n\nwhen I receive [win! v]\nstop [other scripts in sprite v]\n\nwhen I receive [start v]\nshow\nbroadcast (spawn sticks v)\nset [xv v] to [0]\nset [yv v] to [0]\ngo to x: (-199) y: (-62)\nset [level v] to [1]\nforever\n    Platform [14] [-1] [0.8] [2] [20] [15]\n    if <key (r v) pressed?> then\n        broadcast (spawn sticks v)\n    end\n    if <<touching (_edge_ v)?> and <(y position) < [-175]>> then\n        broadcast (spawn sticks v)\n    end\n    if <touching (spikes v)?> then\n        switch costume to (death v)\n        Death\n        broadcast (spawn sticks v)\n    end\n    if <<touching (portal v)?> and <(pockets left) = [0]>> then\n        broadcast (goal! v) and wait\n        set [xv v] to [0]\n        set [yv v] to [0]\n        go to x: (-199) y: (-62)\n        change [level v] by (1)\n        broadcast (spawn sticks v)\n    end\n    if <touching (pool balls v)?> then\n        broadcast (CLAK v) and wait\n    end\n    if <touching (pockets v)?> then\n        set [touching pool ball? v] to [0]\n        broadcast (Touching pool ball? v) and wait\n        if <(touching pool ball?) = [0]> then\n            start sound [404743__owlstorm__retro-video-game-sfx-fail v]\n            repeat (20)\n                change [ghost v] effect by (5)\n            end\n            broadcast (spawn sticks v)\n            set [xv v] to [0]\n            set [yv v] to [0]\n            go to x: (-199) y: (-62)\n            clear graphic effects\n        end\n    end\nend\n\ngo to x: (x position) y: (180)\n\nset [xv v] to [0]\nset [yv v] to [0]\n\nwhen I receive [skip v]\nstart sound [440269__mendihola__poof-3-varying-degrees-of-intensity v]\nwait (0.05) seconds\nhide\nchange [level v] by (1)\nbroadcast (spawn sticks v)\n\n@level\n\nwhen flag clicked\nhide\ngo to x: (0) y: (0)\nforever\n    switch costume to ((Level) + (1))\nend\n\nwhen I receive [start v]\nshow\n\n@spikes\n\nwhen flag clicked\nhide\ngo to x: (0) y: (0)\nforever\n    switch costume to ((Level) + (1))\nend\n\nwhen I receive [start v]\nshow\n\n@Portal\n\nwhen flag clicked\nhide\nswitch costume to (portal v)\nset size to (100) %\ndelete all of [portal x v]\ndelete all of [portal y v]\ndelete all of [show? v]\nadd [187] to [portal x v]\nadd [-105] to [portal y v]\nadd [216] to [portal x v]\nadd [-103] to [portal y v]\nadd [193] to [portal x v]\nadd [-111] to [portal y v]\nadd [-48] to [portal x v]\nadd [-111] to [portal y v]\nadd [201] to [portal x v]\nadd [-110] to [portal y v]\nadd [181] to [portal x v]\nadd [-106] to [portal y v]\nadd [205] to [portal x v]\nadd [-107] to [portal y v]\nadd [201] to [portal x v]\nadd [-109] to [portal y v]\nadd [203] to [portal x v]\nadd [-109] to [portal y v]\nadd [195] to [portal x v]\nadd [-105] to [portal y v]\nadd [195] to [portal x v]\nadd [-104] to [portal y v]\nadd [201] to [portal x v]\nadd [-106] to [portal y v]\nadd [204] to [portal x v]\nadd [-106] to [portal y v]\nadd [211] to [portal x v]\nadd [-110] to [portal y v]\nforever\n    go to x: (item (Level) of [portal x v]) y: ((item (Level) of [portal y v]) + (([cos v] of ((.i) * (150)) ) * (4)))\nend\n\nif <(item (Level) of [show? v]) = [1]> then\n\nwhen I receive [goal! v]\nstart sound [440269__mendihola__poof-3-varying-degrees-of-intensity v]\nparticle\nwait (1) seconds\n\ndefine particle\nrepeat (24)\n    create clone of (_myself_ v)\nend\n\nwhen I start as a clone\nswitch costume to (particle v)\npoint in direction (pick random (0) to (360))\nset size to (pick random (75) to (150)) %\nset [speed v] to (pick random (4) to (8))\nforever\n    move (Speed) steps\n    change size by (-4)\n    if <(size) < [55]> then\n        delete this clone\n    end\nend\n\nwhen flag clicked\nforever\n    if <(pockets left) = [0]> then\n        set [brightness v] effect to (0)\n    else\n        set [brightness v] effect to (-50)\n    end\nend\n\nwhen I receive [goal! v]\nif <(Level) = [14]> then\n    broadcast (Win! v)\nend\n\nwhen I receive [start v]\nshow\n\n@cue stick\n\ndefine spawn stick (x) (y)\ngo to x: (x) y: (y)\ncreate clone of (_myself_ v)\n\nwhen I start as a clone\nshow\nforever\n    if <touching (player v)?> then\n        start sound [432592__coral-island-studios__billiards3 v]\n        broadcast (bounce v)\n        set [speed v] to [30]\n        repeat (2)\n            change y by (Speed)\n        end\n        set [speed v] to [-4]\n        repeat (15)\n            change y by (Speed)\n        end\n        set [speed v] to [0]\n    end\n    if <touching (pool balls v)?> then\n        start sound [432592__coral-island-studios__billiards3 v]\n        broadcast (pool ball bounce v)\n        set [speed v] to [30]\n        repeat (2)\n            change y by (Speed)\n        end\n        set [speed v] to [-4]\n        repeat (15)\n            change y by (Speed)\n        end\n        set [speed v] to [0]\n    end\nend\n\nwhen flag clicked\ngo to [back v] layer\nhide\n\nwhen I receive [spawn sticks v]\nrepeat (1)\n    delete this clone\nend\nif <(Level) = [2]> then\n    spawn stick [-79] [-188]\nend\nif <(Level) = [4]> then\n    spawn stick [75] [-160]\nend\nif <(Level) = [5]> then\n    spawn stick [0] [-150]\nend\nif <(Level) = [6]> then\n    spawn stick [-136] [-140]\nend\nif <(Level) = [7]> then\n    spawn stick [-62] [-109]\n    spawn stick [88] [-112]\nend\nif <(Level) = [10]> then\n    spawn stick [29] [-115]\n    spawn stick [-115] [19]\nend\nif <(Level) = [11]> then\n    spawn stick [77] [-114]\nend\nif <(Level) = [12]> then\n    spawn stick [9] [-103]\n    spawn stick [-158] [-112]\nend\nif <(Level) = [14]> then\n    spawn stick [-80] [-109]\n    spawn stick [90] [-112]\nend\n\n@Pool balls\n\ndefine Physics\nchange [yv v] by (-1)\nchange y by (YV)\nif <touching (level v)?> then\n    repeat ([ceiling v] of ([abs v] of (YV) ) )\n        if <touching (level v)?> then\n            change y by ((([abs v] of (YV) ) / (YV)) * (-1))\n        end\n    end\n    set [yv v] to ((YV) * (-0.6))\nend\nset [xv v] to ((XV) * (0.9))\nchange x by (XV)\nif <touching (level v)?> then\n    repeat ([ceiling v] of ([abs v] of (XV) ) )\n        if <touching (level v)?> then\n            change x by ((([abs v] of (XV) ) / (XV)) * (-1))\n        end\n    end\n    set [xv v] to ((XV) * (-1))\nend\n\nwhen I receive [clak v]\nif <<touching (player v)?> and <(death animation?) = [0]>> then\n    start sound [443052__amberdemeillon__pool-table-break v]\n    set [xv v] to (([xv v] of [player v]) * (1.5))\nend\n\nwhen flag clicked\nhide\n\ndefine spawn ball (x) (y)\ngo to x: (x) y: (y)\ncreate clone of (_myself_ v)\n\nwhen I start as a clone\nswitch costume to (pick random (1) to (5))\nforever\n    set [death animation? v] to [0]\n    show\n    Physics\n    if <touching (spikes v)?> then\n        start sound [Whiz v]\n        set [death animation? v] to [1]\n        Death\n        broadcast (spawn sticks v)\n    end\nend\n\nwhen I receive [spawn sticks v]\nrepeat (1)\n    delete this clone\nend\nif <(Level) = [3]> then\n    spawn ball [56] [23]\nend\nif <(Level) = [4]> then\n    spawn ball [-34] [141]\nend\nif <(Level) = [5]> then\n    spawn ball [-23] [-89]\nend\nif <(Level) = [6]> then\n    spawn ball [-78] [18]\n    spawn ball [31] [19]\nend\nif <(Level) = [7]> then\n    spawn ball [195] [-107]\nend\nif <(Level) = [8]> then\n    spawn ball [75] [-119]\nend\nif <(Level) = [9]> then\n    spawn ball [-84] [-119]\n    spawn ball [87] [22]\nend\nif <(Level) = [10]> then\n    spawn ball [-84] [-119]\n    spawn ball [-7] [59]\nend\nif <(Level) = [11]> then\n    spawn ball [-65] [-51]\n    spawn ball [-140] [-117]\n    spawn ball [-95] [36]\n    spawn ball [155] [-118]\nend\nif <(Level) = [12]> then\n    spawn ball [-57] [20]\nend\nif <(Level) = [13]> then\n    spawn ball [52] [-121]\n    spawn ball [-96] [-121]\n    spawn ball [-54] [42]\nend\nif <(Level) = [14]> then\n    spawn ball [82] [113]\nend\n\ndefine Death\nset [xv v] to [-10]\nset [yv v] to [18]\nstart sound [Whiz v]\nrepeat until <touching (_edge_ v)?>\n    change x by (XV)\n    change [yv v] by (-1)\n    change y by (YV)\nend\nset [xv v] to [0]\nset [yv v] to [0]\ngo to x: (-199) y: (-62)\n\nwhen I receive [pool ball bounce v]\nif <touching (cue stick v)?> then\n    set [yv v] to [20]\n    set [xv v] to ((XV) * (1.5))\nend\n\ngo to x: (-7) y: (59)\n\nwhen I receive [win! v]\nstop [other scripts in sprite v]\n\n@pockets\n\ndefine spawn pockets (x) (y)\nchange [current pockets v] by (1)\ngo to x: (x) y: (y)\ncreate clone of (_myself_ v)\n\nwhen I receive [spawn sticks v]\nrepeat (1)\n    delete this clone\nend\ngo to [back v] layer\nset [pockets left v] to [0]\nset [current pockets v] to [0]\nif <(Level) = [3]> then\n    spawn pockets [55] [-110]\nend\nif <(Level) = [4]> then\n    spawn pockets [126] [-116]\nend\nif <(Level) = [5]> then\n    spawn pockets [204] [-44]\nend\nif <(Level) = [6]> then\n    spawn pockets [-30] [-112]\n    spawn pockets [82] [-112]\nend\nif <(Level) = [7]> then\n    spawn pockets [81] [62]\nend\nif <(Level) = [8]> then\n    spawn pockets [-57] [-116]\nend\nif <(Level) = [9]> then\n    spawn pockets [92] [-115]\n    spawn pockets [206] [25]\nend\nif <(Level) = [10]> then\n    spawn pockets [-156] [5]\n    spawn pockets [131] [-3]\nend\nif <(Level) = [11]> then\n    spawn pockets [143] [-114]\n    spawn pockets [75] [28]\n    spawn pockets [9] [-115]\n    spawn pockets [-100] [-116]\nend\nif <(Level) = [12]> then\n    spawn pockets [85] [21]\nend\nif <(Level) = [13]> then\n    spawn pockets [117] [-114]\n    spawn pockets [-147] [-114]\n    spawn pockets [-42] [-114]\nend\nif <(Level) = [14]> then\n    spawn pockets [9] [-114]\nend\n\nwhen flag clicked\nhide\n\nwhen I start as a clone\nset [y v] to (y position)\nforever\n    show\n    go to x: (x position) y: ((Y) + (([cos v] of ((.i) * (150)) ) * (4)))\nend\n\nwhen I start as a clone\nforever\n    if <touching (pool balls v)?> then\n        set [brightness v] effect to ((25) + (([cos v] of ((timer) * (150)) ) * (4)))\n    else\n        set [brightness v] effect to (0)\n    end\nend\n\nwhen flag clicked\n\nwhen I receive [touching ball? v]\nif <touching (pool balls v)?> then\n    change [pockets left v] by (-1)\nend\n\nrepeat (1)\n    delete this clone\nend\n\nwhen I receive [start v]\nforever\n    set [pockets left v] to (current pockets)\n    broadcast (touching ball? v) and wait\nend\n\nwhen I receive [touching pool ball? v]\nif <touching (player v)?> then\n    if <touching (pool balls v)?> then\n        set [touching pool ball? v] to [1]\n    end\nend\n\nchange [pockets left v] by (-1)\n\n@You win!\n\nwhen flag clicked\nhide\ngo to x: (0) y: (0)\ngo to [front v] layer\n\nwhen I receive [win! v]\nset [ghost v] effect to (100)\nshow\nrepeat (50)\n    change [ghost v] effect by (-2)\nend\n\n@Thumbnail\n\nwhen flag clicked\nforever\n    go to [front v] layer\n    go to x: (0) y: (0)\n    set [ghost v] effect to (100)\nend\n\n@intro\n\nwhen I start as a clone\nshow\nif <(Clone ability) = [0]> then\n    switch costume to (costume2 v)\n    go to [front v] layer\n    point in direction (-90)\n    go to x: (-1000) y: (0)\n    set size to (0) %\n    repeat (30)\n        change size by (((100) - (size)) / (3))\n        set [spring v] to ((Spring) * (0.7))\n        change x by (Spring)\n        change [spring v] by (((0) - (x position)) / (7))\n        turn right (((90) - (direction)) / (4)) degrees\n    end\n    repeat (6)\n        change size by (((500) - (size)) / (5))\n        change x by (((0) - (x position)) / (5))\n    end\n    repeat (2)\n        change size by (((0) - (size)) / (1.1))\n    end\n    delete this clone\nend\nif <(Clone ability) = [1]> then\n    switch costume to (pick random (3) to (6))\n    go to [front v] layer\n    point in direction (pick random (180) to (-180))\n    go to x: (0) y: (0)\n    set size to (100) %\n    repeat until <touching (_edge_ v)?>\n        move (25) steps\n    end\n    delete this clone\nend\n\ndefine None\nrepeat ([ceiling v] of ((#) / (2)) )\n    create clone of (_myself_ v)\n    create clone of (_myself_ v)\nend\n\nwhen flag clicked\nshow\nset [clone ability v] to [0]\nstart sound [399904__mrthenoronha__shining-8-bit \(1\) v]\ncreate clone of (_myself_ v)\nswitch costume to (costume3 v)\npoint in direction (-90)\ngo to x: (1000) y: (0)\nset size to (0) %\nrepeat (30)\n    set [spring v] to ((Spring) * (0.7))\n    change x by (Spring)\n    change [spring v] by (((0) - (x position)) / (7))\n    turn right (((90) - (direction)) / (4)) degrees\n    change size by (((100) - (size)) / (3))\nend\nset [clone ability v] to [1]\nshow\nrepeat (6)\n    change size by (((500) - (size)) / (5))\n    change x by (((0) - (x position)) / (5))\nend\nstart sound [273587__n-audioman__mag-explosion v]\nstart sound [162792__timgormly__8-bit-explosion1 v]\nrepeat (2)\n    change size by (((0) - (size)) / (1.1))\nend\nhide\nclones (65)\nwait (0.5) seconds\nstart sound [level complete v]\nbroadcast (start v)\n\n@Particle\n\nwhen I start as a clone\nshow\ngo to (player v)\nswitch costume to (particle v)\npoint in direction (pick random (0) to (360))\nset size to (pick random (75) to (150)) %\nset [speed v] to (pick random (4) to (8))\nforever\n    move (Speed) steps\n    change size by (-4)\n    if <(size) < [55]> then\n        delete this clone\n    end\nend\n\nwhen flag clicked\nhide\n\n@warning\n\ndefine Smooth glide to X: (x) Y: (y) Smoothness: (smoothness)\nrepeat until <<(round (x position)) = (round (x))> and <(round (y position)) = (round (y))>>\n    change x by (((x) - (x position)) / (smoothness))\n    change y by (((y) - (y position)) / (smoothness))\nend\n\nwhen flag clicked\nset [shown? v] to [0]\ngo to x: (0) y: (-100)\nhide\n\nwhen I receive [spawn sticks v]\nif <<(Shown?) = [0]> and <(Level) = [12]>> then\n    switch costume to (costume1 v)\n    set [shown? v] to [1]\n    show\n    go to [front v] layer\n    Smooth glide to X: (0) Y: (0) Smoothness: (2)\n    wait (2) seconds\n    Smooth glide to X: (0) Y: (-75) Smoothness: (3)\n    hide\nend\n\nwhen I receive [can't skip v]\nswitch costume to (costume2 v)\nshow\ngo to [front v] layer\nSmooth glide to X: (0) Y: (0) Smoothness: (2)\nwait (2) seconds\nSmooth glide to X: (0) Y: (-75) Smoothness: (3)\nhide\n\n@Restart animation\n\nwhen flag clicked\nhide\ngo to [back v] layer\n\ndefine particle\nrepeat (24)\n    create clone of (particle v)\nend\n\nwhen I receive [skip v]\nparticle\n\nwhen I receive [start v]\ngo to [back v] layer\nshow\nforever\n    if <key (e v) pressed?> then\n        if <key (q v) pressed?> then\n            reset timer\n            repeat until <<(timer) > [2]> or <not <<key (e v) pressed?> and <key (q v) pressed?>>>>\n                go to [back v] layer\n                change [ghost v] effect by (-3)\n                start sound [186669__fordps3__computer-boop \(1\) v]\n                change [pitch v] effect by (2)\n            end\n            if <(timer) > [2]> then\n                if <(Level) = [14]> then\n                    start sound [101355__timbre__remix-of-54047-guitarguy1985-buzzer-variants-3 v]\n                    set [pitch v] effect to (0)\n                    set [ghost v] effect to (100)\n                    broadcast (can't skip v) and wait\n                else\n                    broadcast (skip v) and wait\n                end\n            end\n            set [pitch v] effect to (0)\n            set [ghost v] effect to (100)\n            wait until <not <<key (e v) pressed?> and <key (q v) pressed?>>>\n        end\n    end\n    set [pitch v] effect to (0)\n    set [ghost v] effect to (100)\nend\n\n
ANSWER THIS QUESTION! https://strawpoll.com/shbcxbs2\n\nI guessing @262015 likes platformers... \nand it's been awhile since I've made one...\nSO I MADE A PLATFORMER!!!!\n\nthis is for @262015 's game contest!\n \nuse the WASD key to move,\navoid the red pointy things,\ncomplete the game,\nyou should know by now...\n\ntouch the cue stick to bounce up!\nget those pool balls to all the pockets...\n\nIDK, try figuring it out...\n\n#Games #platformer #pool #billiards #cue #arrow #keys #mandrewschoon #TAGZ #FOR #LIFE