Fruit Ninja Platformer 

Instructions: 最大5人でプレイできます。\n矢印キー・タップで操作

@Stage\n\ndefine Layer\ngo to [front v] layer\ngo [backward v] ((item # of [Death particles] in [layers v]) - (1)) layers\n\ndefine Set up layers\ndelete all of [layers v]\nadd [TN] to [layers v]\nadd [Game over] to [layers v]\nadd [Player] to [layers v]\nadd [Cursor] to [layers v]\nadd [Title] to [layers v]\nadd [Play button] to [layers v]\nadd [Title screen] to [layers v]\nadd [Portal] to [layers v]\nadd [Decor] to [layers v]\nadd [Ground] to [layers v]\nadd [Spikes] to [layers v]\nadd [Cursor annotations] to [layers v]\nadd [Death particles] to [layers v]\nadd [no pen] to [layers v]\nadd [Clouds] to [layers v]\n\nwhen I receive [green flag clicked v]\nforever\n    broadcast (Position portal v)\nend\n\nwhen flag clicked\nSet up layers\nforever\n    broadcast (Layer v)\n    Set up layers\nend\n\nwhen I receive [layer v]\nLayer\n\nwhen flag clicked\nset [music volume v] to [50]\nforever\n    set volume to (Music volume) %\nend\n\nwhen flag clicked\nhide variable [music volume v]\n\nwhen flag clicked\nset [lag mode? v] to [0]\nif <(username) = [--Explosion--]> then\n    set [lag mode? v] to [1]\nend\nhide\n\nwhen I receive [intro done v]\nforever\n    play sound [Inferno v] until done\nend\n\nwhen I receive [intro done v]\nforever\n    if <<(mouse y) > [100]> and <[-150] > (mouse x)>> then\n        show variable [music volume v]\n    else\n        hide variable [music volume v]\n    end\nend\n\n@Assets\n\n@Player\n\ndefine Reset\npoint in direction (90)\nset size to (20) %\nset rotation style [left-right v]\nif <(Level) = [9]> then\n    go to x: (-200) y: (-100)\nelse\n    go to x: (-200) y: (0)\nend\nshow\nset [speed y v] to [0]\nset [falling? v] to [10]\n\nwhen I receive [green flag clicked v]\nstop [other scripts in sprite v]\nReset\nset [level v] to [1]\nforever\n    Platforming Engine\n    if <<touching (moving spikes up/down v)?> or <<touching (spikes v)?> or <touching (right/left v)?>>> then\n        switch costume to (die  v)\n        start sound [whoop v]\n        broadcast (Die v)\n        Go down\n        repeat (11)\n            next costume\n        end\n        repeat (20)\n            change [ghost v] effect by (5)\n        end\n        broadcast (Retry v)\n        set [ghost v] effect to (0)\n        go to x: (-200) y: (0)\n    end\nend\n\ndefine Walk (direction) (speed)\npoint in direction (direction)\nchange x by (speed)\nset [slope v] to [0]\nrepeat until <<(slope) = [8]> or <not <<touching (moving platforms v)?> or <<<touching color (#58ddff)?> and <(Level) > [8]>> or <touching (ground v)?>>>>>\n    change y by (1)\n    change [slope v] by (1)\nend\nif <(slope) = [8]> then\n    change x by ((0) - (speed))\n    change y by ((0) - (slope))\n    if <<<key (w v) pressed?> or <<key (up arrow v) pressed?> or <<mouse down?> and <(mouse y) > (y position)>>>> and <([abs v] of (speed) ) > [3]>> then\n        start sound [Jump v]\n        if <(wall jump) = [0]> then\n            set [speed x v] to ((-1.2) * (speed))\n            set [max bounce v] to [11]\n            set [speed y v] to [11]\n            set [falling? v] to [6]\n            set [wall jump v] to [15]\n        end\n    else\n        set [speed x v] to [0]\n    end\nend\nif <(speed) < [0]> then\n    change [frame v] by ((speed) / (-8))\nelse\n    change [frame v] by ((speed) / (8))\nend\n\nwhen I receive [retry v]\nReset\n\nwhen I receive [next level v]\nReset\n\ndefine Set Costume\nif <(falling?) < [6]> then\n    if <(frame) = [0]> then\n        switch costume to ([floor v] of ((13) + ((Idle Frame) mod (15))) )\n        change [idle frame v] by (0.5)\n    else\n        switch costume to ([floor v] of ((29) + ((frame) mod (15))) )\n    end\nelse\n    if <touching (ladder v)?> then\n        switch costume to ([floor v] of ((61) + (((timer) * (10)) mod (3))) )\n    else\n        switch costume to ([floor v] of ((((15) / ((Max Bounce) * (2))) * ((speed y) + (Max Bounce))) + (45)) )\n    end\nend\n\ndefine Touch Ground <up?>\nchange [falling? v] by (1)\nrepeat until <not <<touching (moving platforms v)?> or <<<touching color (#58ddff)?> and <(Level) > [8]>> or <touching (ground v)?>>>>\n    if <up?> then\n        change y by (-1)\n    else\n        change y by (1)\n        set [falling? v] to [0]\n    end\n    set [speed y v] to [0]\nend\n\nwhen flag clicked\nhide\n\ndefine Go down\nrepeat until <<touching (_edge_ v)?> or <touching (ground v)?>>\n    change y by (-2)\nend\n\ndefine Platforming Engine\nswitch costume to (hitbox v)\nif <<(speed y) < [4]> or <<key (w v) pressed?> or <<key (up arrow v) pressed?> or <<mouse down?> and <(mouse y) > (y position)>>>>> then\n    change [speed y v] by (-1)\nelse\n    change [speed y v] by (-2)\nend\nchange y by (speed y)\nTouch Ground <(speed y) > [0]>\nif <(wall jump) > [0]> then\n    change [wall jump v] by (-1)\nelse\n    set [speed x v] to ((speed x) * (0.7))\n    if <<key (left arrow v) pressed?> or <<key (a v) pressed?> or <<mouse down?> and <(x position) > (mouse x)>>>> then\n        change [speed x v] by (-1.5)\n    end\n    if <<key (right arrow v) pressed?> or <<key (d v) pressed?> or <<mouse down?> and <(mouse x) > (x position)>>>> then\n        change [speed x v] by (1.5)\n    end\nend\nif <(speed x) < [-0.5]> then\n    Walk (-90) (speed x)\nelse\n    if <(speed x) > [0.5]> then\n        Walk (90) (speed x)\n    else\n        set [frame v] to [0]\n    end\nend\nif <<key (w v) pressed?> or <<key (up arrow v) pressed?> or <<mouse down?> and <(mouse y) > (y position)>>>> then\n    if <<(jump key) = [0]> and <(falling?) < [3]>> then\n        start sound [Jump v]\n        set [max bounce v] to [14]\n        set [speed y v] to [14]\n        set [falling? v] to [6]\n        set [jump key v] to [1]\n    end\nelse\n    set [jump key v] to [0]\nend\nif <(y position) < [-180]> then\n    go to x: (-200) y: (0)\n    broadcast (Retry v)\n    set [speed y v] to [0]\nend\nif <touching (portal v)?> then\n    if <(Level) = [12]> then\n        start sound [Connect v]\n        broadcast (--------- v)\n    else\n        start sound [Connect v]\n        go to x: (-200) y: (0)\n        change [level v] by (1)\n        broadcast (Retry v)\n        Reset\n    end\nend\nif <touching (bounce v)?> then\n    start sound [Jump v]\n    set [max bounce v] to [25]\n    set [speed y v] to [25]\nend\nif <(x position) < [-190]> then\n    set x to (-190)\nend\nif <<<key (w v) pressed?> or <<key (up arrow v) pressed?> or <<mouse down?> and <(mouse y) > (y position)>>>> and <touching (ladder v)?>> then\n    set [speed y v] to [5]\nend\nSet Costume\n\ndefine Layer\ngo to [front v] layer\ngo [backward v] ((item # of [Player] in [layers v]) - (1)) layers\nMoving platforms check\n\nwhen I receive [layer v]\nLayer\n\ndefine Moving platforms check\nchange y by (-3)\nif <touching (moving platforms v)?> then\n    change x by ((([x position v] of [moving platforms v]) - (x position)) / (2))\nend\nchange y by (3)\n\nwhen I receive [intro done v]\npoint in direction (90)\nshow\nset size to (50) %\nset [level v] to [1]\ngo to x: (-200) y: (-20)\nswitch costume to (idle  v)\nforever\n    switch costume to (idle  v)\n    repeat (15)\n        next costume\n        wait (0) seconds\n    end\nend\n\n@Ground\n\nwhen flag clicked\nhide\n\nwhen I receive [green flag clicked v]\nshow\nforever\n    switch costume to (Level)\nend\n\ndefine Layer\ngo to [front v] layer\ngo [backward v] ((item # of [Ground] in [layers v]) - (1)) layers\n\nwhen I receive [layer v]\nLayer\n\n@Decor\n\nwhen flag clicked\nhide\n\nwhen I receive [green flag clicked v]\nshow\nforever\n    switch costume to (Level)\nend\n\ndefine Layer\ngo to [front v] layer\ngo [backward v] ((item # of [Decor] in [layers v]) - (1)) layers\n\nwhen I receive [layer v]\nLayer\n\n@Clouds\n\nwhen I start as a clone\nset [ghost v] effect to (50)\nshow\nswitch costume to (pick random (1) to (2))\nset size to (pick random (30) to (50)) %\ngo to x: (400) y: (pick random (0) to (180))\nglide (pick random (5) to (10)) secs to x: (-275) y: (y position)\ndelete this clone\n\ndefine Layer\ngo to [front v] layer\ngo [backward v] ((item # of [Clouds] in [layers v]) - (1)) layers\n\nwhen I receive [layer v]\nLayer\n\nwhen I start as a clone\nforever\n    if <(Level) = [9]> then\n        delete this clone\n    end\nend\n\nwhen flag clicked\nhide\n\nwhen I receive [intro done v]\nforever\n    wait (pick random (1) to (5)) seconds\n    create clone of (_myself_ v)\nend\n\n@Title\n\nwhen I receive [green flag clicked v]\nstop [other scripts in sprite v]\nhide\n\ndefine Layer\ngo to [front v] layer\ngo [backward v] ((item # of [Title] in [layers v]) - (1)) layers\n\nwhen I receive [layer v]\nLayer\n\nwhen I receive [intro done v]\nshow\nforever\n    go to x: (-30) y: ((([sin v] of ((timer) * (300)) ) * (10)) + (90))\n    point in direction ((([sin v] of ((timer) * (300)) ) * (10)) + (90))\n    switch costume to (hitbox v)\n    if <touching (cursor v)?> then\n        change size by (((110) - (size)) / (3))\n    else\n        change size by (((90) - (size)) / (3))\n    end\n    switch costume to (costume1 v)\nend\n\nwhen flag clicked\nhide\n\n@Cursor\n\nwhen flag clicked\nhide\n\nwhen I receive [green flag clicked v]\nstop [other scripts in sprite v]\nhide\n\ndefine Layer\ngo to [front v] layer\ngo [backward v] ((item # of [Cursor] in [layers v]) - (1)) layers\n\nwhen I receive [layer v]\nLayer\n\nwhen I receive [intro done v]\nshow\nforever\n    go to (mouse-pointer v)\nend\n\nwhen I receive [intro done v]\nforever\n    wait until <mouse down?>\n    start sound [click v]\n    wait until <not <mouse down?>>\nend\n\n@Play button\n\ndefine Layer\ngo to [front v] layer\ngo [backward v] ((item # of [Play button] in [layers v]) - (1)) layers\n\nwhen I receive [layer v]\nLayer\n\nwhen I receive [intro done v]\nshow\nforever\n    switch costume to (hitbox v)\n    point in direction ((([sin v] of ((timer) * (300)) ) * (<touching (cursor v)?> * (5))) + (90))\n    if <touching (cursor v)?> then\n        if <mouse down?> then\n            broadcast (Green Flag clicked v)\n            hide\n            stop [this script v]\n        end\n        change size by (((60) - (size)) / (3))\n    else\n        change size by (((50) - (size)) / (3))\n    end\n    switch costume to (play button v)\nend\n\nwhen flag clicked\nhide\n\n@Title screen bg\n\nwhen flag clicked\nhide\n\nwhen I receive [green flag clicked v]\nhide\n\ndefine Layer\ngo to [front v] layer\ngo [backward v] ((item # of [Title screen] in [layers v]) - (1)) layers\n\nwhen I receive [layer v]\nLayer\n\nwhen I receive [intro done v]\nshow\n\n@Cursor annotations\n\nwhen flag clicked\nshow\nforever\n    go to (mouse-pointer v)\n    show\n    if <<touching (player v)?> and <(y position) > [40]>> then\n        switch costume to (player v)\n        show\n    else\n        if <<touching (play button v)?> and <(distance to [play button v]) < [30]>> then\n            switch costume to (play button v)\n            show\n        else\n            hide\n        end\n    end\nend\n\nwhen I receive [green flag clicked v]\nstop [other scripts in sprite v]\nhide\n\ndefine Layer\ngo to [front v] layer\ngo [backward v] ((item # of [Cursor annotations] in [layers v]) - (1)) layers\n\nwhen I receive [layer v]\nLayer\n\n@Portal\n\nwhen flag clicked\nhide\n\nwhen I receive [green flag clicked v]\ncreate clone of (_myself_ v)\nshow\nforever\n    turn right (5) degrees\nend\n\nwhen I receive [position portal v]\nset size to (25) %\nshow\nif <(Level) = [1]> then\n    go to x: (180) y: (-30)\nend\nif <(Level) = [2]> then\n    go to x: (190) y: (-40)\nend\nif <(Level) = [7]> then\n    go to x: (190) y: (-80)\nend\nif <(Level) = [8]> then\n    go to x: (190) y: (-80)\nend\nif <(Level) = [9]> then\n    go to x: (190) y: (-40)\nend\nif <(Level) = [12]> then\n    go to x: (0) y: (20)\n    set size to (50) %\nend\n\nwhen I start as a clone\nforever\n    turn left (5) degrees\nend\n\ndefine Layer\ngo to [front v] layer\ngo [backward v] ((item # of [Portal] in [layers v]) - (1)) layers\n\nwhen I receive [layer v]\nLayer\n\n@TN\n\nwhen flag clicked\nforever\n    go to [front v] layer\n    set [ghost v] effect to (100)\nend\n\ndefine Layer\ngo to [front v] layer\ngo [backward v] ((item # of [TN] in [layers v]) - (1)) layers\n\nwhen I receive [layer v]\nLayer\n\n@Spikes\n\nwhen I receive [green flag clicked v]\nshow\nforever\n    switch costume to (Level)\nend\n\nwhen flag clicked\nhide\n\ndefine Layer\ngo to [front v] layer\ngo [backward v] ((item # of [Spikes] in [layers v]) - (1)) layers\n\nwhen I receive [layer v]\nLayer\n\n@Moving platforms\n\nwhen flag clicked\nhide\n\nwhen I receive [green flag clicked v]\nforever\n    if <(Level) = [2]> then\n        show\n    else\n        hide\n    end\nend\n\ndefine Layer\ngo to [front v] layer\ngo [backward v] ((item # of [Moving platforms] in [layers v]) - (1)) layers\n\nwhen I receive [green flag clicked v]\nforever\n    if <(Level) = [2]> then\n        go to x: (140) y: (-100)\n        glide (4) secs to x: (-100) y: (-100)\n        glide (4) secs to x: (140) y: (-100)\n    end\nend\n\n@Background particles\n\nwhen flag clicked\nhide\n\nwhen I start as a clone\nset [speed v] to (pick random (3) to (5))\nshow\nset size to (pick random (60) to (150)) %\nset [ghost v] effect to (pick random (80.0) to (100))\ngo to (random position v)\nset x to (200)\npoint in direction (pick random (-60) to (-105))\nrepeat until <touching (_edge_ v)?>\n    move (speed) steps\n    turn right (pick random (-1) to (1.0)) degrees\n    if <<(Lag mode?) = [1]> or <(Level) > [8]>> then\n        delete this clone\n    end\nend\ndelete this clone\n\nwhen I receive [intro done v]\nforever\n    create clone of (_myself_ v)\n    hide\nend\n\n@Right/left\n\nwhen flag clicked\nhide\n\nwhen I receive [retry v]\nrepeat (1)\n    delete this clone\nend\nClone level (Level)\n\ndefine Clone level (#)\nif <(Level) = [5]> then\n    go to x: (0) y: (-90)\n    create clone of (_myself_ v)\nend\nif <(Level) = [6]> then\n    go to x: (20) y: (-90)\n    create clone of (_myself_ v)\nend\nif <(Level) = [7]> then\n    go to x: (27) y: (-80)\n    create clone of (_myself_ v)\nend\n\nwhen I start as a clone\nshow\nset size to (50) %\nforever\n    turn right (9) degrees\nend\n\n@The pencil\n\nwhen flag clicked\nhide\n\nwhen flag clicked\nwait until <touching (player v)?>\nset [got pencil? v] to [1]\n\nwhen I receive [retry v]\nerase all\n\nwhen I receive [intro done v]\nerase all\nset pen (transparency v) to (0)\nset pen color to (#58ddff)\nset pen size to (10)\nhide\nset [got pencil? v] to [0]\npoint in direction (90)\nforever\n    if <(Got pencil?) = [0]> then\n        go to x: (-120) y: ((([sin v] of ((timer) * (150)) ) * (5)) - (30))\n        if <(Level) < [9]> then\n            hide\n        else\n            show\n        end\n    else\n        switch costume to (hitbox v)\n        set pen (transparency v) to (0)\n        point towards (mouse-pointer v)\n        turn right (90) degrees\n        go to x: ((x position) + (((mouse x) - (x position)) / (3))) y: ((y position) + (((mouse y) - (y position)) / (3)))\n        if <touching (no pen areas v)?> then\n            pen up\n            set [ghost v] effect to ((([sin v] of ((timer) * (500)) ) * (50)) + (50))\n        else\n            set [ghost v] effect to (0)\n        end\n        if <key (space v) pressed?> then\n            if <not <touching (no pen areas v)?>> then\n                pen down\n            end\n        else\n            pen up\n        end\n        switch costume to (costume1 v)\n    end\nend\n\n@No pen areas\n\nwhen I receive [green flag clicked v]\nshow\nforever\n    switch costume to (Level)\n    if <touching (player v)?> then\n        set [ghost v] effect to (70)\n    else\n        set [ghost v] effect to (0)\n    end\nend\n\nwhen I receive [layer v]\nLayer\n\ndefine Layer\ngo to [front v] layer\ngo [backward v] ((item # of [no pen] in [layers v]) - (1)) layers\n\nwhen flag clicked\nhide\n\n@Intro\n\nwhen flag clicked\nstart sound [Drawing sound v]\nwait (0) seconds\npoint in direction (90)\nshow\nclear graphic effects\ngo to [front v] layer\nswitch costume to (sketch intro v)\nrepeat (103)\n    next costume\nend\nrepeat (10)\n    change [ghost v] effect by (10)\nend\nbroadcast (Intro done v)\n\nwhen I receive [intro done v]\nstop sound [Drawing sound v]\nhide\n\n@Intro background\n\nwhen flag clicked\ngo to [front v] layer\n\nwhen I receive [intro done v]\nhide\n\n@Game over screen\n\nwhen flag clicked\nhide\n\nwhen I receive [--------- v]\nshow\n\ndefine Layer\ngo to [front v] layer\ngo [backward v] ((item # of [Game over] in [layers v]) - (1)) layers\n\nwhen I receive [layer v]\nLayer\n\n