Coded A Platformer


@Stage\n\nwhen I receive [intro v]\nswitch backdrop to (play v)\n\nwhen I receive [intro done v]\nswitch backdrop to (play v)\nforever\n    play sound [ParagonX9 - Chaoz Fantasy v] until done\nend\n\n@Player\n\nwhen flag clicked\nforever\n    create clone of (_myself_ v)\nend\n\nwhen I start as a clone\nswitch costume to (trail v)\nrepeat (10)\n    change size by (-3)\n    change [ghost v] effect by (15)\nend\ndelete this clone\n\ndefine Run game\nchange [y v] by (-1)\nif <<key (a v) pressed?> or <key (left arrow v) pressed?>> then\n    change [x v] by (-2)\nend\nif <<key (d v) pressed?> or <key (right arrow v) pressed?>> then\n    change [x v] by (2)\nend\nset [x v] to ((X) * (0.7))\nchange x by (X)\nif <touching (platform v)?> then\n    change y by (1)\n    if <touching (platform v)?> then\n        change y by (1)\n    end\n    if <touching (platform v)?> then\n        change y by (1)\n        if <touching (platform v)?> then\n            change y by (1)\n            if <touching (platform v)?> then\n                change y by (1)\n                if <touching (platform v)?> then\n                    change y by (1)\n                end\n                if <touching (platform v)?> then\n                    change y by (1)\n                    if <touching (platform v)?> then\n                        change y by (1)\n                    end\n                end\n            end\n        end\n    end\nend\nif <touching (platform v)?> then\n    change y by (-8)\n    repeat until <not <touching (platform v)?>>\n        change x by ((X) * (-1))\n    end\n    if <<key (up arrow v) pressed?> or <key (w v) pressed?>> then\n        set [y v] to [15]\n        if <(X) < [0]> then\n            set [x v] to [16]\n        else\n            set [x v] to [-16]\n        end\n    else\n        set [x v] to [0]\n    end\nend\nchange y by (Y)\nif <touching (platform v)?> then\n    repeat until <not <touching (platform v)?>>\n        change y by ((Y) * (-1))\n    end\n    set [y v] to [0]\nend\nchange y by (-1)\nif <<touching (platform v)?> and <key (up arrow v) pressed?>> then\n    set [y v] to [14]\nend\nchange y by (1)\nif <(x position) > [210]> then\n    go to x: (-208) y: (165)\n    change [level v] by (1)\n    set [x v] to [0]\n    set [y v] to [0]\nend\nif <touching (danger v)?> then\n    go to x: (-208) y: (165)\n    set [level v] to (level)\n    set [x v] to [0]\n    set [y v] to [0]\nend\n\nwhen flag clicked\nshow\nswitch costume to (idle v)\nset [y v] to [0]\nset [x v] to [0]\ngo to x: (-213) y: (167)\nset rotation style [left-right v]\nbroadcast (intro v)\n\nwhen I receive [intro v]\nhide\n\nwhen I receive [intro over v]\nshow\nforever\n    Run game\nend\n\n@platform\n\nwhen flag clicked\nset [level v] to [1]\nforever\n    go to x: (36) y: (28)\n    switch costume to (level)\nend\n\nwhen I receive [intro v]\nhide\n\nwhen I receive [intro over v]\nshow\n\n@danger\n\nwhen flag clicked\nshow\ngo to [back v] layer\nset [level v] to [1]\nforever\n    go to x: (-37) y: (-68)\n    switch costume to (level)\nend\n\nwhen I receive [intro v]\nhide\n\nwhen I receive [intro over v]\nshow\n\n@text\n\nwhen flag clicked\nforever\n    go to [back v] layer\n    switch costume to (level)\nend\n\nwhen I receive [intro v]\nhide\n\nwhen I receive [intro over v]\nshow\n\n@thumbnail\n\nwhen flag clicked\nhide\n\n@love and fave detector\n\nwhen flag clicked\nhide\nset [faved___ v] to [0]\nset [loved__ v] to [0]\nset [clone id v] to [0]\ncreate clone of (_myself_ v)\nwait (0.2) seconds\nset [clone id 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)\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 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            set [loved__ v] to [1]\n        end\n    end\nend\nif <(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            set [faved___ v] to [1]\n        end\n    end\nend\n\n@My brain hurtss\n\ndefine Shake Amount (shake amount) Finishing Size: (size) Speed: (speed)\nset [shake v] to (shake amount)\nset size to ((size) + ((shake amount) / (1.5))) %\nrepeat until <(round (size)) = (round (size))>\n    point in direction ((90) + ((Shake) * ([cos v] of (((1000) + ((speed) * (100))) * (timer)) )))\n    set size to ((size) + ((Shake) / (0.5))) %\n    set [shake v] to ((Shake) * (0.8))\nend\n\nwhen I start as a clone\nif <(Intro Clone ID) = [Bouncy Bars]> then\n    go to [front v] layer\n    show\n    switch costume to (screen hack alt v)\n    set size to (0) %\n    Set Effects: Color (Color) Brightness (Brightness) Transparency [0]\n    go to x: (-1000) y: (Bar Y Pos)\n    switch costume to (bar2 v)\n    point in direction (0)\n    repeat (10)\n        set [bar y pos v] to (((Bar Y Pos) * (0.5)) + (((0) - (x position)) / (3)))\n        change x by (Bar Y Pos)\n        change size by (((130) - (size)) / (5))\n        go to [front v] layer\n    end\n    repeat (20)\n        set [bar y pos v] to (((Bar Y Pos) * (.5)) + (((0) - (x position)) / (3)))\n        change x by (Bar Y Pos)\n        change size by (((130) - (size)) / (5))\n        go to [front v] layer\n    end\nend\n\ndefine Bouncy Bars\nset [intro clone id v] to [Bouncy Bars]\nset [bar y pos v] to [240]\nrepeat (10)\n    create clone of (_myself_ v)\n    change [bar y pos v] by (-60)\nend\nset [bar y pos v] to [0]\n\nwhen I start as a clone\nif <(Intro Clone ID) = [End White]> then\n    clear graphic effects\n    switch costume to (screen hack v)\n    Set Effects: Color [0] Brightness [100] Transparency [0]\n    Frame Animation x [1000] y [-500] size [375] direction [90] at speed [1]\n    Frame Size [375.05] at speed [1]\n    switch costume to (front v)\n    go to [front v] layer\n    show\n    wait (.05) seconds\n    repeat (35)\n        Frame Position x [-55] y [55] at speed [11]\n        change [ghost v] effect by (-10)\n    end\n    delete this clone\nend\n\nwhen I start as a clone\nif <(Intro Clone ID) = [End]> then\n    clear graphic effects\n    switch costume to (screen hack v)\n    Set Effects: Color (Color) Brightness [-20] Transparency [0]\n    Frame Animation x [1000] y [-500] size [375] direction [90] at speed [1]\n    Frame Size [375.05] at speed [1]\n    switch costume to (front v)\n    go to [front v] layer\n    show\n    wait (0.05) seconds\n    repeat (35)\n        Frame Position x [-55] y [55] at speed [10.75]\n        change [ghost v] effect by (-10)\n    end\n    broadcast (Delete v)\n    wait (1) seconds\n    repeat (20)\n        change [ghost v] effect by (5)\n    end\n    delete this clone\nend\n\ndefine Frame Animation x (x) y (y) size (size) direction (direction) at speed (speed)\nchange x by (((x) - (x position)) / (speed))\nchange y by (((y) - (y position)) / (speed))\nchange size by (((size) - (size)) / (speed))\nturn right (((direction) - (direction)) / (speed)) degrees\n\ndefine Set Effects: Color (color) Brightness (brightness) Transparency (transparency)\nset [color v] to (color)\nset [brightness v] to (brightness)\nset [ghost v] to (transparency)\nset [color v] effect to (Color)\nset [brightness v] effect to (Brightness)\nset [ghost v] effect to (Ghost)\n\ndefine Clone Sprite ID (id) # (#)\nset [intro clone id v] to (id)\nrepeat (#)\n    create clone of (_myself_ v)\nend\n\ndefine Frame Position x (x) y (y) at speed (speed)\nchange x by (((x) - (x position)) / (speed))\nchange y by (((y) - (y position)) / (speed))\n\ndefine Frame Size (size) at speed (speed)\nchange size by (((size) - (size)) / (speed))\n\ndefine Frame Rotation (rotation) at speed (speed)\nturn right (((direction) - (direction)) / (speed)) degrees\n\ndefine Set origin (origin) target (target)\nset [costume origin v] to (origin)\nset [costume target v] to (target)\n\nwhen I start as a clone\nif <(Intro Clone ID) = [Line Burst]> then\n    set [val v] to [20]\n    switch costume to (line burst 1 v)\n    go to [front v] layer\n    go [backward v] (1) layers\n    show\n    Frame Animation x (My brain hurtss: X) y (My brain hurtss: Y) size [0] direction (Rotation) at speed [1]\n    Set Effects: Color (Color) Brightness (Brightness) Transparency (Ghost)\n    repeat until <(Val) < [2]>\n        set [val v] to ((Val) * (0.9))\n        switch costume to (((Val) * (-0.5)) + (Costume Target))\n        Frame Size [100] at speed [5]\n        move (Val) steps\n    end\n    repeat (10)\n        set [val v] to ((Val) * (0.9))\n        switch costume to (((Val) * (-0.5)) + (Costume Target))\n        Frame Size [100] at speed [5]\n        move (Val) steps\n        change [ghost v] effect by (10)\n    end\n    delete this clone\nend\n\ndefine Line burst (degree) degrees with start (start) at x: (x) y: (y)\nset [rotation v] to (start)\nset [costume target v] to [55]\nset [my brain hurtss: x v] to (x)\nset [my brain hurtss: y v] to (y)\nset [background formula v] to [0]\nrepeat ((360) / (degree))\n    Position x [0] y [0]\n    Clone Sprite ID [Line Burst] # [1]\n    change [rotation v] by (degree)\nend\n\nwhen I start as a clone\nif <(Intro Clone ID) = [Shockwave]> then\n    Frame Animation x (My brain hurtss: X) y (My brain hurtss: Y) size [80] direction (Rotation) at speed [1]\n    Set Effects: Color (Color) Brightness (Brightness) Transparency (Ghost)\n    show\n    set [val v] to (Costume Origin)\n    repeat until <(Costume Target) = (round (Val))>\n        switch costume to (screen hack v)\n        if <(Rotation) = [N/A]> then\n            Frame Size [350] at speed [6.5]\n            switch costume to (Val)\n            change [val v] by (((Costume Target) - (round (Val))) / (6.5))\n            go to [front v] layer\n            go [backward v] (3) layers\n        else\n            Frame Size [500] at speed [6.5]\n            switch costume to (Val)\n            change [val v] by (((Costume Target) - (round (Val))) / (6.5))\n            go to [front v] layer\n            go [backward v] (1) layers\n        end\n    end\n    repeat (10)\n        switch costume to (screen hack v)\n        if <(Rotation) = [N/A]> then\n            Frame Size [350] at speed [6.5]\n            switch costume to (Val)\n            change [val v] by (((Costume Target) - (round (Val))) / (6.5))\n            go to [front v] layer\n            change [ghost v] effect by (10)\n            go [backward v] (3) layers\n        else\n            Frame Size [500] at speed [6.5]\n            switch costume to (Val)\n            change [val v] by (((Costume Target) - (round (Val))) / (6.5))\n            go to [front v] layer\n            change [ghost v] effect by (10)\n            go [backward v] (1) layers\n        end\n    end\n    delete this clone\nend\n\ndefine Position x (x) y (y)\nset [my brain hurtss: x v] to (x)\nset [my brain hurtss: y v] to (y)\n\ndefine 1/4 Shockwave X (x) Y (y)\nset [my brain hurtss: x v] to (x)\nset [my brain hurtss: y v] to (y)\nSet origin [1] target [22]\nset [rotation v] to [0]\nClone Sprite ID [Shockwave] # [1]\nset [rotation v] to [180]\nSet origin [1] target [22]\nClone Sprite ID [Shockwave] # [1]\nwait (0.12) seconds\nSet origin [1] target [22]\nset [rotation v] to [90]\nClone Sprite ID [Shockwave] # [1]\nset [rotation v] to [-90]\nSet origin [1] target [22]\nClone Sprite ID [Shockwave] # [1]\n\ndefine 1/8 Shockwave X (x) Y (y)\nset [my brain hurtss: x v] to (x)\nset [my brain hurtss: y v] to (y)\nSet origin [23] target [44]\nset [rotation v] to [0]\nClone Sprite ID [Shockwave] # [1]\nset [rotation v] to [180]\nSet origin [23] target [44]\nClone Sprite ID [Shockwave] # [1]\nwait (0.12) seconds\nSet origin [23] target [44]\nset [rotation v] to [45]\nClone Sprite ID [Shockwave] # [1]\nset [rotation v] to [-135]\nSet origin [23] target [44]\nClone Sprite ID [Shockwave] # [1]\nwait (0.12) seconds\nSet origin [23] target [44]\nset [rotation v] to [90]\nClone Sprite ID [Shockwave] # [1]\nset [rotation v] to [-90]\nSet origin [23] target [44]\nClone Sprite ID [Shockwave] # [1]\nwait (0.12) seconds\nSet origin [23] target [44]\nset [rotation v] to [135]\nClone Sprite ID [Shockwave] # [1]\nset [rotation v] to [-45]\nSet origin [23] target [44]\nClone Sprite ID [Shockwave] # [1]\n\nwhen flag clicked\nset [pen colour v] to [0]\nreset timer\nstart sound [Music v]\nhide\nswitch costume to (screen hack alt v)\nSet Effects: Color [0] Brightness [100] Transparency [0]\nClone Sprite ID [Name] # [1]\nWait Until [3.5]\ngo to x: (0) y: (0)\nParticles [50]\nWait Until [3.7]\nset [pen colour v] to [1]\n\ndefine Shockwave X (x) Y (y)\nset [my brain hurtss: x v] to (x)\nset [my brain hurtss: y v] to (y)\nSet origin [133] target [156]\nset [rotation v] to [N/A]\nClone Sprite ID [Shockwave] # [1]\n\ndefine Set Position Target x (x) y (y)\nset [x pos v] to (x)\nset [y pos v] to (y)\n\nwhen I start as a clone\nif <(Intro Clone ID) = [Bar]> then\n    clear graphic effects\n    hide\n    Frame Animation x (My brain hurtss: X) y (My brain hurtss: Y) size [0] direction (Rotation) at speed [1]\n    Set Effects: Color (Color) Brightness (Brightness) Transparency (Ghost)\n    show\n    set [val v] to (Costume Origin)\n    repeat until <(My brain hurtss: Size) = (round (size))>\n        switch costume to (screen hack v)\n        Frame Animation x (X Pos) y (Y Pos) size (My brain hurtss: Size) direction (Rotation Target) at speed [5]\n        switch costume to (Val)\n    end\n    go to x: (X Pos) y: (Y Pos)\n    point in direction (Rotation Target)\nend\n\nwhen I start as a clone\nif <(Intro Clone ID) = [Grid]> then\n    clear graphic effects\n    Frame Animation x [0] y [0] size [100] direction [90] at speed [1]\n    Set Effects: Color (Color) Brightness [0] Transparency [0]\n    switch costume to (grid2 v)\n    go to [front v] layer\n    show\nend\n\nwhen I start as a clone\nif <(Intro Clone ID) = [Diamond]> then\n    clear graphic effects\n    hide\n    Frame Animation x [0] y [0] size [0] direction [90] at speed [1]\n    Set Effects: Color (Color) Brightness (Brightness) Transparency (Ghost)\n    go to [back v] layer\n    go [forward v] (12) layers\n    show\n    repeat (25)\n        switch costume to (screen hack v)\n        Frame Size [400] at speed [10]\n        switch costume to (diamond v)\n    end\n    delete this clone\nend\n\ndefine Diamond\nClone Sprite ID [Diamond] # [1]\n\nwhen I start as a clone\nif <(Intro Clone ID) = [Hole]> then\n    clear graphic effects\n    Set Effects: Color (Color) Brightness (Brightness) Transparency (Ghost)\n    Frame Animation x [0] y [0] size [100] direction [90] at speed [1]\n    switch costume to (backdrop v)\n    go to [front v] layer\n    show\n    Wait Until [0.99]\n    switch costume to (hole v)\n    repeat (15)\n        switch costume to (screen hack v)\n        Frame Size [2500] at speed [7]\n        switch costume to (hole v)\n    end\nend\n\ndefine Wait Until (timer)\nwait until <(timer) < (timer)>\n\nwhen I start as a clone\nif <(Intro Clone ID) = [Back]> then\n    clear graphic effects\n    Set Effects: Color (Color) Brightness (Brightness) Transparency (Ghost)\n    Frame Animation x [0] y [0] size [100] direction [90] at speed [1]\n    switch costume to (back v)\n    go to [back v] layer\n    show\nend\n\nwhen I start as a clone\nif <(Intro Clone ID) = [Hexagon]> then\n    clear graphic effects\n    hide\n    Frame Animation x [0] y [0] size [-100] direction [90] at speed [1]\n    Set Effects: Color (Color) Brightness (Brightness) Transparency (Ghost)\n    go to [front v] layer\n    go [backward v] (1) layers\n    show\n    repeat (10)\n        switch costume to (screen hack v)\n        Frame Size [125] at speed [4]\n        switch costume to (hexagon v)\n    end\n    wait (0.25) seconds\n    repeat (15)\n        switch costume to (screen hack v)\n        Frame Size [325] at speed [4]\n        switch costume to (hexagon v)\n    end\n    delete this clone\nend\n\nwhen I start as a clone\nif <(Intro Clone ID) = [White Back]> then\n    clear graphic effects\n    switch costume to (size hack alt v)\n    Set Effects: Color (Color) Brightness [100] Transparency [0]\n    Frame Animation x [1000] y [0] size [100] direction [90] at speed [1]\n    switch costume to (back v)\n    Frame Size [100] at speed [1]\n    go to [back v] layer\n    hide\n    wait (0.05) seconds\n    show\n    repeat (38)\n        Frame Position x [0] y [0] at speed [11]\n    end\n    Frame Position x [0] y [0] at speed [1]\n    delete this clone\nend\n\nwhen I start as a clone\nif <(Intro Clone ID) = [Back]> then\n    clear graphic effects\n    switch costume to (size hack alt v)\n    Set Effects: Color (Color) Brightness [10] Transparency [0]\n    Frame Animation x [1000] y [0] size [100] direction [90] at speed [1]\n    switch costume to (back v)\n    Frame Size [100] at speed [1]\n    go to [front v] layer\n    show\n    repeat (38)\n        Frame Position x [0] y [0] at speed [10.75]\n    end\n    Frame Position x [0] y [0] at speed [1]\nend\n\ndefine Bounce Size Bounciness (bounciness ) Div (div) Target (target) Repeat (repeat)\nrepeat (repeat)\n    set [bounce v] to (((Bounce) * (bounciness )) + (((target) - (size)) / (div)))\n    Frame Size ((size) + (Bounce)) at speed [1]\nend\n\ndefine End\nClone Sprite ID [End1] # [1]\nClone Sprite ID [End2] # [1]\n\ndefine Particles (amount)\nClone Sprite ID [Particles] # (amount)\n\nwhen I start as a clone\nif <(Intro Clone ID) = [Particles]> then\n    Set Effects: Color [0] Brightness [-100] Transparency [0]\n    switch costume to (pick random (125) to (127))\n    show\n    set [step vel v] to (pick random (15) to (20))\n    point in direction (pick random (-180) to (180))\n    repeat until <(round (step vel)) = [0]>\n        move (step vel) steps\n        turn right ((step vel) / (2)) degrees\n        set [step vel v] to ((step vel) * (.9))\n    end\n    repeat (5)\n        change [ghost v] effect by (20)\n    end\n    delete this clone\nend\n\nwhen I start as a clone\nif <(Intro Clone ID) = [End1]> then\n    Set Effects: Color [0] Brightness [-100] Transparency [0]\n    go to x: (0) y: (500)\n    switch costume to (ending sequence v)\n    show\n    repeat until <(round (y position)) = [0]>\n        Frame Position x [0] y [0] at speed [10]\n        go to [front v] layer\n    end\n    repeat (5)\n        change [ghost v] effect by (20)\n    end\n    delete this clone\nend\n\nwhen I start as a clone\nif <(Intro Clone ID) = [End2]> then\n    Set Effects: Color [0] Brightness [-100] Transparency [0]\n    go to x: (0) y: (-500)\n    switch costume to (ending sequence2 v)\n    show\n    repeat until <(round (y position)) = [0]>\n        Frame Position x [0] y [0] at speed [10]\n        go to [front v] layer\n    end\n    repeat (5)\n        change [ghost v] effect by (20)\n    end\n    delete this clone\nend\n\nwhen I start as a clone\nif <(Intro Clone ID) = [Name]> then\n    go to x: (0) y: (0)\n    switch costume to (name v)\n    go to [front v] layer\n    show\n    set size to (10) %\n    point in direction (-90)\n    repeat until <<(round (size)) = [75]> and <(round (direction)) = [90]>>\n        Frame Animation x [0] y [0] size [75] direction [90] at speed [10]\n    end\n    Wait Until [3.5]\n    repeat (5)\n        next costume\n    end\n    delete this clone\nend\n\nwhen I start as a clone\nif <(Intro Clone ID) = [Entry]> then\n    clear graphic effects\n    Set Effects: Color (Color) Brightness [0] Transparency [0]\n    switch costume to (particle 1 v)\n    set size to (100) %\n    go to [front v] layer\n    go to x: (0) y: (-500)\n    show\n    repeat until <(round (y position)) = [0]>\n        Frame Position x [0] y [0] at speed [5]\n    end\n    repeat (10)\n        switch costume to (screen hack v)\n        change size by (500)\n        switch costume to (particle 1 v)\n    end\nend\n\ndefine resetVars\npen down\nset [camerax v] to [0]\nset [cameray v] to [0]\nset [cameraz v] to [-180]\nset [cameraxrot v] to [0]\nset [camerayrot v] to [0]\nset [x1 v] to [0]\nset [x2 v] to [0]\nset [y1 v] to [0]\nset [y2 v] to [0]\nset [z1 v] to [0]\nset [z2 v] to [0]\nset [fov v] to [300]\ndelete all of [stars v]\nrepeat (300)\n    add (pick random (-300) to (300)) to [stars v]\nend\n\ndefine Rotate (x) (y) by (rot)\n-- [Rotates the 2d points as if in a 3d space.]\nset [output1 v] to ((([cos v] of (rot) ) * (x)) - (([sin v] of (rot) ) * (y)))\nset [output2 v] to ((([sin v] of (rot) ) * (x)) + (([cos v] of (rot) ) * (y)))\n\ndefine Projection (x) (y) (z)\ngo to x: (((fov) * (x)) / (z)) y: (((fov) * (y)) / (z))\n\ndefine Render stars\nset pen size to (10)\nif <(pen colour) = [0]> then\n    set pen color to (#ffffff)\nelse\n    set pen color to (#000000)\nend\nset [countingstars v] to [1]\nrepeat ((length of [stars v]) / (3))\n    Draw line (item (countingStars) of [stars v]) (item ((countingStars) + (1)) of [stars v]) (item ((countingStars) + (2)) of [stars v]) to (item (countingStars) of [stars v]) (item ((countingStars) + (1)) of [stars v]) (item ((countingStars) + (2)) of [stars v])\n    change [countingstars v] by (3)\nend\nset pen size to (20)\n\ndefine init 3D items\nRender BG\nRender stars\n\ndefine -- (text)\n\nwhen flag clicked\nset [ghost v] effect to (100)\nresetVars\nerase all\nset pen size to (20)\nrepeat until <(timer) > [9.4]>\n    erase all\n    init 3D items\n    if <(timer) > [5.7]> then\n        Render K (bouncing)\n    end\nend\n\ndefine Draw line (x1) (y1) (z1) to (x2) (y2) (z2)\nSet variables (x1) (y1) (z1)\n-- [x rot]\nRotate (z1) (x1) by (cameraXrot)\nSet variables (output2) (y1) (output1)\n-- [y rot]\nRotate (y1) (z1) by (cameraYrot)\nSet variables (x1) (output1) (output2)\nSet other variables (x2) (y2) (z2)\n-- [x rot]\nRotate (z2) (x2) by (cameraXrot)\nSet other variables (output2) (y2) (output1)\n-- [y rot]\nRotate (y2) (z2) by (cameraYrot)\nSet other variables (x2) (output1) (output2)\n-- [Projection]\nProjection ((x1) - (cameraX)) ((y1) - (cameraY)) ((z1) - (cameraZ))\npen down\nProjection ((x2) - (cameraX)) ((y2) - (cameraY)) ((z2) - (cameraZ))\npen up\n\ndefine Set variables (x1) (y1) (z1)\nset [x1 v] to (x1)\nset [y1 v] to (y1)\nset [z1 v] to (z1)\n\ndefine Set other variables (x2) (y2) (z2)\nset [x2 v] to (x2)\nset [y2 v] to (y2)\nset [z2 v] to (z2)\n\ndefine Render BG\ngo to x: (0) y: (0)\nset pen size to (100000)\nif <(pen colour) = [0]> then\n    set pen color to (#000000)\nelse\n    set pen color to (#ffffff)\nend\npen down\npen up\n\ndefine Render K (at y)\nDraw line [-50] ((75) + (at y)) [0] to [-50] ((-75) - (at y)) [0]\nDraw line [-50] [0] [0] to [50] ((-75) - (at y)) [0]\nDraw line [-50] [0] [0] to [50] ((75) + (at y)) [0]\n\nwhen flag clicked\nset [bouncing v] to [-75]\nWait Until [5.7]\nrepeat (40)\n    change [bouncing v] by (((0) - (bouncing)) / (5))\nend\n\nwhen flag clicked\nWait Until [7.5]\nset [pen colour v] to [0]\nWait Until [8.4]\nset [pen colour v] to [1]\n\ndefine draw lines at (posy)\nset pen color to (#000000)\nset pen size to (100)\ngo to x: (-585) y: (posy)\npen down\ngo to x: (585) y: (posy)\npen up\ngo to x: (-585) y: ((posy) * (-1))\npen down\ngo to x: (585) y: ((posy) * (-1))\npen up\n\nwhen flag clicked\nset [bouncing v] to [-75]\nWait Until [5.7]\nrepeat (40)\n    change [bouncing v] by (((0) - (bouncing)) / (5))\nend\nWait Until [9.4]\nset [bouncing v] to [200]\nrepeat (77)\n    change [bouncing v] by (((50) - (bouncing)) / (14))\n    draw lines at (bouncing)\nend\nerase all\nset pen color to (#000000)\nset pen size to (154642)\ngo to x: (0) y: (0)\nrepeat (100)\n    erase all\n    change pen (transparency v) by (1)\n    pen down\n    pen up\nend\nbroadcast (intro over v)\n\nwhen flag clicked\nbroadcast (intro v)\nWait Until [7.3]\nrepeat (30)\n    change [cameraxrot v] by (((90) - (cameraXrot)) / (2.5))\nend\nrepeat (30)\n    change [cameraxrot v] by (((0) - (cameraXrot)) / (2.5))\nend\n\nwhen I receive [intro over v]\nhide\n\n