MINION A Scrolling Platformer DEMO
@Stage\n\nwhen I receive [main menu v]\nswitch backdrop to (backdrop1 v)\n\n@Player\n\nwhen flag clicked\nswitch costume to (1 v)\nbroadcast (change 1 v)\nset [skin v] to [1]\nset [move v] to [1 move]\nshow\n\ndefine Touch Y\nchange [in air? v] by (1)\nif <touching (level v)?> then\n    repeat until <not <touching (level v)?>>\n        change [y v] by ((0) - ((sy) / ([abs v] of (sy) )))\n        Position\n    end\n    if <(sy) < [0]> then\n        set [in air? v] to [0]\n    end\n    set [sy v] to [0]\nend\n\ndefine Touch X\nif <touching (level v)?> then\n    repeat (8)\n        change [y v] by (1)\n    end\n    Position\n    change [y v] by (-8)\n    if <not <touching (level v)?>> then\n        stop [this script v]\n    end\n    repeat until <not <touching (level v)?>>\n        change [x v] by ((0) - ((sx) / ([abs v] of (sx) )))\n        Position\n    end\n    if <key (up arrow v) pressed?> then\n        if <(sx) > [0]> then\n            set [sx v] to [-10]\n        else\n            set [sx v] to [10]\n        end\n        set [in air? v] to [0]\n    else\n        set [sx v] to [0]\n    end\nend\n\ndefine Physics\nchange [sy v] by (-1)\nif <(sy) < [-17]> then\n    set [sy v] to [-17]\nend\nif <<<key (up arrow v) pressed?> or <key (w v) pressed?>> and <(in air?) < [3]>> then\n    set [sy v] to [13]\nend\nchange [y v] by (sy)\nPosition\nTouch Y\nswitch costume to (skin)\nif <<key (right arrow v) pressed?> or <key (d v) pressed?>> then\n    point in direction (90)\n    switch costume to (move)\n    change [sx v] by (1.5)\nend\nif <<key (left arrow v) pressed?> or <key (a v) pressed?>> then\n    point in direction (-90)\n    switch costume to (move)\n    change [sx v] by (-1.5)\nend\nset [sx v] to ((sx) * (0.8))\nchange [x v] by (sx)\nPosition\nTouch X\nMove / Limit Camera\n\ndefine Position\ngo to x: ((x) - (CAM X)) y: ((y) - (CAM Y))\n\nwhen I receive [update v]\nif <(control) = [pc]> then\n    Physics\nend\nif <(control) = [mobile]> then\n    Physics (mobile)\nend\nif <touching color (#bd9200)?> then\n    set [check x v] to [2369.743895]\n    set [check y v] to [-83]\n    set [check cam x v] to [2371]\n    set [check cam y v] to [0]\nend\nif <touching color (#ac8400)?> then\n    set [check x v] to [4059.382452]\n    set [check y v] to [-84]\n    set [check cam x v] to [4058]\n    set [check cam y v] to [0]\nend\nif <touching color (#806200)?> then\n    set [check x v] to [2256.169111]\n    set [check y v] to [-72]\n    set [check cam x v] to [2255]\n    set [check cam y v] to [0]\nend\nif <<touching color (#1d1d1d)?> or <touching color (#b34e00)?>> then\n    broadcast (blank v)\n    broadcast (Main menu v)\n    set [play v] to [n]\nend\n\nwhen I receive [start v]\nset size to (100) %\nSetup Var\nshow\nwait (0.1) seconds\nrepeat until <(PLAY) = [n]>\n    broadcast (Update v)\nend\nbroadcast (Stop v)\n\ndefine Setup Var\nset [x v] to (check X)\nset [y v] to (Check Y)\nset [cam x v] to (Check cam x)\nset [cam y v] to (Check cam Y)\nPosition\n\ndefine Move / Limit Camera\nchange [cam x v] by (round (((x) - (CAM X)) / (4)))\nif <(CAM X) < [0]> then\n    set [cam x v] to [0]\nend\nchange [cam y v] by (round (((y) - (CAM Y)) / (6)))\nif <(CAM Y) < [0]> then\n    set [cam y v] to [0]\nend\nCheck Lose\n\ndefine Check Lose\nif <(y) < [-180]> then\n    Setup Var\nend\nif <touching color (#ff0000)?> then\n    Setup Var\nend\n\nwhen I receive [stop v]\npoint in direction (90)\nset size to (300) %\ngo to x: (101) y: (-68)\n\ndefine Physics (mobile)\nchange [sy v] by (-1)\nif <(sy) < [-17]> then\n    set [sy v] to [-17]\nend\nif <<(STICK Y) > [0.1]> and <(in air?) < [3]>> then\n    set [sy v] to [13]\nend\nchange [y v] by (sy)\nPosition\nTouch Y\nswitch costume to (skin)\nif <(STICK X) > [0.1]> then\n    point in direction (90)\n    switch costume to (move)\n    change [sx v] by (1.5)\nend\nif <(STICK X) < [-0.1]> then\n    point in direction (-90)\n    switch costume to (move)\n    change [sx v] by (-1.5)\nend\nset [sx v] to ((sx) * (0.8))\nchange [x v] by (sx)\nPosition\nTouch X\nMove / Limit Camera\n\nwhen I receive [main menu v]\nset [check x v] to [0]\nset [check y v] to [0]\nset [check cam x v] to [0]\nset [check cam y v] to [0]\nshow\nset size to (300) %\ngo to x: (101) y: (-68)\nrepeat until <(PLAY) = [y]>\n    if <<touching (mouse-pointer v)?> and <mouse down?>> then\n        broadcast (blank v)\n        wait (1) seconds\n        broadcast (Costume v)\n    else\n        if <touching (mouse-pointer v)?> then\n            change size by (((400) - (size)) / (5))\n        else\n            change size by (((300) - (size)) / (5))\n        end\n    end\nend\n\nwhen I receive [play v]\nhide\n\nwhen I receive [costume v]\nswitch backdrop to (chapter2 v)\ngo to x: (129) y: (-73)\nset size to (400) %\nstop [other scripts in sprite v]\nrepeat until <(PLAY) = [y]>\n    if <(skin) = [1]> then\n        switch costume to (1 v)\n    end\n    if <(skin) = [2]> then\n        switch costume to (2 v)\n    end\n    if <(skin) = [3]> then\n        switch costume to (3 v)\n    end\nend\n\nwhen I receive [close settings v]\nshow\nset size to (300) %\ngo to x: (101) y: (-68)\nrepeat until <(PLAY) = [y]>\n    if <<touching (mouse-pointer v)?> and <mouse down?>> then\n        broadcast (blank v)\n        wait (1) seconds\n        broadcast (Costume v)\n    else\n        if <touching (mouse-pointer v)?> then\n            change size by (((400) - (size)) / (5))\n        else\n            change size by (((300) - (size)) / (5))\n        end\n    end\nend\n\nwhen I receive [settings v]\nstop [other scripts in sprite v]\n\nwhen I receive [ending v]\nstop [other scripts in sprite v]\n\nwhen I receive [ending v]\nhide\n\n@Level\n\nwhen I receive [update v]\nPosition ((x) - (CAM X)) ((y) - (CAM Y))\n\nwhen I receive [start v]\nset [x v] to [0]\nset [y v] to [0]\nif <(chapter) = [1]> then\n    switch backdrop to (c 1 v)\n    Clone Level at: [0] [0] Costume [Level1]\n    Clone Level at: [480] [0] Costume [Level2]\n    Clone Level at: [480] [0] Costume [Level3]\n    Clone Level at: [480] [0] Costume [Level4]\n    Clone Level at: [480] [0] Costume [Level5]\n    Clone Level at: [480] [0] Costume [Level6]\n    Clone Level at: [480] [0] Costume [Level7]\n    Clone Level at: [480] [0] Costume [Level8]\n    Clone Level at: [480] [0] Costume [Level9]\n    Clone Level at: [480] [0] Costume [Level10]\nend\nif <(chapter) = [2]> then\n    switch backdrop to (c 2 v)\n    Clone Level at: [0] [0] Costume [11]\n    Clone Level at: [480] [0] Costume [12]\n    Clone Level at: [480] [0] Costume [13]\n    Clone Level at: [480] [0] Costume [14]\n    Clone Level at: [480] [0] Costume [15]\n    Clone Level at: [480] [0] Costume [16]\n    Clone Level at: [480] [0] Costume [17]\n    Clone Level at: [480] [0] Costume [18]\n    Clone Level at: [480] [0] Costume [19]\n    Clone Level at: [0] [410] Costume [20]\n    Clone Level at: [0] [410] Costume [21]\n    Clone Level at: [480] [0] Costume [22]\n    Clone Level at: [480] [0] Costume [23]\n    Clone Level at: [0] [-410] Costume [24]\n    Clone Level at: [0] [-410] Costume [25]\n    Clone Level at: [480] [0] Costume [26]\nend\n\ndefine Clone Level at: (x) (y) Costume (costume)\nswitch costume to (costume)\nchange [x v] by (x)\nchange [y v] by (y)\ncreate clone of (_myself_ v)\n\ndefine Position (x) (y)\ngo to x: (x) y: (y)\nset [onscreen? v] to <<(round (x)) = (round (x position))> and <(round (y)) = (round (y position))>>\nif <(onscreen?) = [true]> then\n    show\nelse\n    hide\nend\n\nwhen flag clicked\nhide\n\nwhen I receive [stop v]\nhide\ndelete this clone\n\nwhen I receive [ending v]\nstop [other scripts in sprite v]\nhide\ndelete this clone\n\nClone Level at: [480] [0] Costume [Level3]\nClone Level at: [480] [0] Costume [Level4]\nClone Level at: [480] [0] Costume [Level5]\nClone Level at: [480] [0] Costume [Level6]\nClone Level at: [480] [0] Costume [Level7]\nClone Level at: [480] [0] Costume [Level8]\nClone Level at: [480] [0] Costume [Level9]\nClone Level at: [480] [0] Costume [Level10]\n\n@Thumbnail\n\nwhen flag clicked\nhide\nforever\n    set [timer v] to (timer)\nend\n\nwhen [timer v] > (Timer)\nshow\ngo to [front v] layer\ngo to x: (0) y: (0)\n\n@Play\n\nwhen flag clicked\ngo to x: (-140) y: (12)\ngo to [back v] layer\nset [play v] to [n]\nhide\n\nwhen I receive [main menu v]\nshow\nif <(PLAY) = [n]> then\n    repeat until <(PLAY) = [y]>\n        if <<touching (mouse-pointer v)?> and <mouse down?>> then\n            broadcast (blank v)\n            broadcast (play v)\n            set [play v] to [y]\n            set [chapter v] to [1]\n            hide\n        else\n            if <touching (mouse-pointer v)?> then\n                change size by (((120) - (size)) / (5))\n                switch costume to (costume2 v)\n            else\n                change size by (((100) - (size)) / (5))\n                switch costume to (costume1 v)\n            end\n        end\n    end\nend\n\nwhen I receive [settings v]\nstop [other scripts in sprite v]\n\nwhen I receive [close settings v]\nshow\nif <(PLAY) = [n]> then\n    repeat until <(PLAY) = [y]>\n        if <<touching (mouse-pointer v)?> and <mouse down?>> then\n            broadcast (blank v)\n            broadcast (play v)\n            set [play v] to [y]\n            set [chapter v] to [1]\n            hide\n        else\n            if <touching (mouse-pointer v)?> then\n                change size by (((120) - (size)) / (5))\n                switch costume to (costume2 v)\n            else\n                change size by (((100) - (size)) / (5))\n                switch costume to (costume1 v)\n            end\n        end\n    end\nend\n\nwhen I receive [main menu v]\nshow\nrepeat until <(PLAY) = [y]>\n    set y to ((12) + (([sin v] of ((timer) * (100)) ) * (6)))\nend\n\nwhen I receive [close settings v]\nshow\nrepeat until <(PLAY) = [y]>\n    set y to ((12) + (([sin v] of ((timer) * (100)) ) * (6)))\nend\n\nchange size by (((120) - (size)) / (5))\nswitch costume to (costume2 v)\n\nwhen I receive [costume v]\nhide\nstop [other scripts in sprite v]\n\n@Mes\n\nwhen flag clicked\nif <[note v] contains (username)?> then\n    hide\n    broadcast (Main menu v)\nelse\n    add (username) to [beta player v]\n    go to [front v] layer\n    show\n    wait (6) seconds\n    repeat (10)\n        change [ghost v] effect by (10)\n    end\n    add (username) to [note v]\n    broadcast (Main menu v)\nend\n\n@Back\n\nwhen flag clicked\nhide\n\nwhen backdrop switches to [backdrop1 v]\n\nwhen I receive [start v]\ngo to [front v] layer\nshow\nrepeat until <(PLAY) = [n]>\n    go to [front v] layer\n    if <<touching (mouse-pointer v)?> and <mouse down?>> then\n        hide\n        broadcast (blank v)\n        wait (1) seconds\n        set [play v] to [n]\n        switch backdrop to (backdrop1 v)\n        broadcast (Main menu v)\n    end\nend\n\nwhen I receive [play v]\nshow\nrepeat until <(PLAY) = [n]>\n    if <<touching (mouse-pointer v)?> and <mouse down?>> then\n        hide\n        broadcast (blank v)\n        wait (1) seconds\n        set [play v] to [n]\n        switch backdrop to (backdrop1 v)\n        broadcast (Main menu v)\n    end\nend\n\nwhen I receive [costume v]\nshow\nrepeat until <(PLAY) = [y]>\n    if <<touching (mouse-pointer v)?> and <mouse down?>> then\n        hide\n        broadcast (blank v)\n        wait (1) seconds\n        set [play v] to [n]\n        switch backdrop to (backdrop1 v)\n        broadcast (Main menu v)\n    end\nend\n\nwhen I receive [main menu v]\nhide\nstop [other scripts in sprite v]\n\nwhen I receive [ending v]\nhide\nstop [other scripts in sprite v]\n\n@ Settings\n\nwhen flag clicked\nset [settings v] to [n]\nhide\n\nwhen I receive [main menu v]\nswitch costume to (costume1 v)\nshow\nrepeat until <(PLAY) = [y]>\n    if <(Settings) = [n]> then\n        if <<touching (mouse-pointer v)?> and <mouse down?>> then\n            broadcast (Settings v)\n            switch costume to (costume2 v)\n            set [settings v] to [y]\n        else\n            if <touching (mouse-pointer v)?> then\n                change size by (((120) - (size)) / (5))\n                switch costume to (costume3 v)\n            else\n                change size by (((100) - (size)) / (5))\n                switch costume to (costume1 v)\n            end\n        end\n        wait until <not <<touching (mouse-pointer v)?> and <mouse down?>>>\n    else\n        if <<touching (mouse-pointer v)?> and <mouse down?>> then\n            broadcast (Close settings v)\n            switch costume to (costume1 v)\n            set [settings v] to [n]\n        else\n            if <touching (mouse-pointer v)?> then\n                change size by (((120) - (size)) / (5))\n                switch costume to (costume4 v)\n            else\n                change size by (((100) - (size)) / (5))\n                switch costume to (costume2 v)\n            end\n        end\n        wait until <not <<touching (mouse-pointer v)?> and <mouse down?>>>\n    end\nend\n\nwhen I receive [play v]\nstop [other scripts in sprite v]\nhide\n\nwhen I receive [start v]\nstop [other scripts in sprite v]\nhide\n\nwhen I receive [costume v]\nstop [other scripts in sprite v]\nhide\n\n@Tab\n\nwhen flag clicked\ngo to x: (0) y: (0)\nhide\n\nwhen I receive [settings v]\nclear graphic effects\nshow\nrepeat until <(Settings) = [n]>\n    change x by (((30) - (x position)) * (0.5))\nend\n\nwhen I receive [close settings v]\nrepeat (5)\n    change x by (((-90) - (x position)) * (0.5))\n    change [ghost v] effect by (20)\nend\nhide\n\n@pc\n\nwhen flag clicked\ngo to x: (0) y: (0)\nset [control v] to [pc]\nswitch costume to (costume2 v)\nhide\n\nwhen I receive [settings v]\nrepeat until <(Settings) = [n]>\n    if <(control) = [mobile]> then\n        switch costume to (costume3 v)\n        if <<mouse down?> and <touching (mouse-pointer v)?>> then\n            switch costume to (costume2 v)\n            set [control v] to [pc]\n        end\n    else\n        switch costume to (costume2 v)\n    end\nend\n\nwhen I receive [close settings v]\nrepeat (5)\n    change x by (((-90) - (x position)) * (0.5))\n    change [ghost v] effect by (20)\nend\nhide\n\nwhen I receive [settings v]\nclear graphic effects\nshow\nrepeat until <(Settings) = [n]>\n    change x by (((30) - (x position)) * (0.5))\nend\n\n@Mobile\n\nwhen flag clicked\ngo to x: (0) y: (0)\nset [control v] to [pc]\nswitch costume to (costume2 v)\nhide\n\nwhen I receive [settings v]\nrepeat until <(Settings) = [n]>\n    if <(control) = [pc]> then\n        switch costume to (costume2 v)\n        if <<mouse down?> and <touching (mouse-pointer v)?>> then\n            switch costume to (costume3 v)\n            set [control v] to [mobile]\n        end\n    else\n        switch costume to (costume3 v)\n    end\nend\n\nwhen I receive [settings v]\nclear graphic effects\nshow\nrepeat until <(Settings) = [n]>\n    change x by (((30) - (x position)) * (0.5))\nend\n\nwhen I receive [close settings v]\nrepeat (5)\n    change x by (((-90) - (x position)) * (0.5))\n    change [ghost v] effect by (20)\nend\nhide\n\n@achievement\n\nwhen flag clicked\ngo to [back v] layer\nset [play v] to [n]\nhide\n\nwhen I receive [main menu v]\nshow\nswitch costume to (costume2 v)\n\nwhen I receive [close settings v]\nshow\nswitch costume to (costume2 v)\n\nwhen I receive [play v]\nhide\n\nwhen I receive [settings v]\nstop [other scripts in sprite v]\n\nswitch costume to (costume1 v)\nshow\nif <(PLAY) = [n]> then\n    repeat until <(PLAY) = [y]>\n        if <<touching (mouse-pointer v)?> and <mouse down?>> then\n            broadcast (Achievements v)\n            set [play v] to [y]\n            hide\n        end\n    end\nend\n\nswitch costume to (costume1 v)\n\nif <(PLAY) = [n]> then\n    repeat until <(PLAY) = [y]>\n        if <<touching (mouse-pointer v)?> and <mouse down?>> then\n            broadcast (Start v)\n            set [play v] to [y]\n            hide\n        end\n    end\nend\n\nwhen I receive [costume v]\nhide\n\n@chapter\n\nwhen flag clicked\nhide\n\nwhen I receive [play v]\nset [chapter v] to [1]\nwait (1) seconds\nswitch backdrop to (chapter v)\nshow\ngo to x: (1) y: (0)\ngo to [back v] layer\nrepeat until <(PLAY) = [n]>\n    switch costume to (chapter)\nend\n\nwhen I receive [close settings v]\nhide\n\nwhen I receive [main menu v]\nhide\n\nwhen I receive [start v]\nhide\n\n@button\n\nwhen flag clicked\nhide\n\nwhen I receive [play v]\nwait (1) seconds\nshow\ngo to x: (-143) y: (97)\nrepeat until <(PLAY) = [n]>\n    if <<touching (mouse-pointer v)?> and <mouse down?>> then\n        set [chapter v] to [1]\n    end\nend\n\nwhen I receive [main menu v]\nhide\n\nwhen I receive [start v]\nstop [other scripts in sprite v]\n\nwhen I receive [update v]\nhide\n\n@button2\n\nwhen flag clicked\nhide\n\nwhen I receive [play v]\nwait (1) seconds\nshow\ngo to x: (-143) y: (30)\nrepeat until <(PLAY) = [n]>\n    if <<touching (mouse-pointer v)?> and <mouse down?>> then\n        set [chapter v] to [2]\n    end\nend\nhide\n\nwhen I receive [main menu v]\nhide\n\nwhen I receive [start v]\nstop [other scripts in sprite v]\n\nwhen I receive [update v]\nhide\n\n@blank\n\nwhen flag clicked\nclear graphic effects\ngo to x: (0) y: (0)\nset [brightness v] effect to (-100)\nset [ghost v] effect to (100)\nhide\n\nwhen I receive [blank v]\ngo to [front v] layer\nswitch costume to (pick random (10) to (12))\nshow\nrepeat (10)\n    change [brightness v] effect by (10)\n    change [ghost v] effect by (-10)\nend\nbroadcast (loading v)\n\nwhen I receive [load v]\nswitch costume to (pick random (10) to (12))\nshow\nrepeat (10)\n    change [brightness v] effect by (10)\n    change [ghost v] effect by (-10)\nend\nbroadcast (load game v)\nloading\nbroadcast (done loading v)\nbroadcast (Start v)\n\ndefine loading\nrepeat until <<(HEALTH) = (MAX HEALTH)> or <(HEALTH) > (MAX HEALTH)>>\n    if <(HEALTH) > (MAX HEALTH)> then\n        set [health v] to [200]\n        broadcast (done v)\n    else\n        change [health v] by (pick random (1) to (35))\n        wait (pick random (1) to (3)) seconds\n    end\nend\n\nwhen I receive [done loading v]\nrepeat (10)\n    change [brightness v] effect by (-10)\n    change [ghost v] effect by (10)\nend\nhide\n\nshow\n\n@bundles\n\n@start\n\nwhen flag clicked\ngo to x: (167) y: (-143)\ngo to [back v] layer\nset [play v] to [n]\nhide\n\nwhen I receive [play v]\nwait (1) seconds\nshow\nif <(PLAY) = [y]> then\n    repeat until <(PLAY) = [n]>\n        if <<touching (mouse-pointer v)?> and <mouse down?>> then\n            if <(chapter) = [4]> then\n                broadcast (Warn v)\n            else\n                broadcast (load v)\n                set [play v] to [y]\n                hide\n                stop [this script v]\n            end\n        else\n            if <touching (mouse-pointer v)?> then\n                change size by (((120) - (size)) / (5))\n                switch costume to (costume2 v)\n            else\n                change size by (((100) - (size)) / (5))\n                switch costume to (costume1 v)\n            end\n        end\n    end\nend\n\nwhen I receive [main menu v]\nhide\n\nwhen I receive [play v]\nrepeat until <(PLAY) = [n]>\n    set y to ((-143) + (([sin v] of ((timer) * (200)) ) * (6)))\nend\n\nbroadcast (blank v)\n\n@shop\n\nwhen flag clicked\ngo to [back v] layer\nset [play v] to [n]\nhide\n\nwhen I receive [main menu v]\nshow\nswitch costume to (costume2 v)\n\nwhen I receive [close settings v]\nshow\nswitch costume to (costume2 v)\n\nif <(PLAY) = [n]> then\n    repeat until <(PLAY) = [y]>\n        if <<touching (mouse-pointer v)?> and <mouse down?>> then\n            broadcast (Start v)\n            set [play v] to [y]\n            hide\n        end\n    end\nend\n\nwhen I receive [play v]\nhide\n\nwhen I receive [settings v]\nstop [other scripts in sprite v]\n\nswitch costume to (costume1 v)\nshow\nif <(PLAY) = [n]> then\n    repeat until <(PLAY) = [y]>\n        if <<touching (mouse-pointer v)?> and <mouse down?>> then\n            broadcast (shop v)\n            set [play v] to [y]\n            hide\n        end\n    end\nend\n\nwhen I receive [costume v]\nhide\n\n@Text\n\nwhen flag clicked\nset [ghost v] effect to (100)\nhide\n\nwhen I receive [warn v]\ngo to [front v] layer\nshow\nrepeat (25)\n    change [ghost v] effect by (-4)\nend\nwait (1) seconds\nrepeat (25)\n    change [ghost v] effect by (4)\nend\n\nwhen I receive [load v]\nset [ghost v] effect to (100)\nhide\n\nwhen I receive [main menu v]\nset [ghost v] effect to (100)\nhide\n\n@Health Bar\n\nwhen flag clicked\nset [max health v] to [200]\nhide\nset [health v] to [0]\n\nwhen I start as a clone\nforever\n    Position Bar\nend\n\ndefine Position Bar\ngo to x: (0) y: (-166)\nset [percent v] to ((HEALTH) / (MAX HEALTH))\nset [color v] effect to ((percent) * (50))\n\nwhen I receive [load v]\nwait (1) seconds\nshow\nswitch costume to (base v)\nset size to (300) %\ngo to [front v] layer\ncreate clone of (_myself_ v)\nswitch costume to (full v)\nrepeat until <(HEALTH) > (MAX HEALTH)>\n    switch costume to (big v)\n    Position Bar\n    if <(percent) < [0.5]> then\n        switch costume to (empty v)\n    else\n        switch costume to (full v)\n    end\n    set [width v] to ((46) * ((size) / (100)))\n    change x by ((width) * (percent))\nend\n\nwhen I receive [main menu v]\nset [health v] to [0]\nhide\ndelete this clone\n\nwhen I receive [done v]\nhide\nset [health v] to [0]\ndelete this clone\n\nwhen I receive [blank v]\nset [health v] to [0]\nhide\ndelete this clone\n\nwhen I receive [start v]\nhide\nset [health v] to [0]\ndelete this clone\n\n@Scene\n\n@skin2\n\nwhen flag clicked\nhide\n\nwhen I receive [main menu v]\nhide\nstop [other scripts in sprite v]\n\nwhen I receive [costume v]\nshow\ngo to x: (-118) y: (93)\nset size to (200) %\nrepeat until <(PLAY) = [y]>\n    if <<touching (mouse-pointer v)?> and <mouse down?>> then\n        set [skin v] to [2]\n        set [move v] to [2 move]\n        switch costume to (2  v)\n        broadcast (change 2 v)\n    end\nend\n\nwhen I receive [change 1 v]\nswitch costume to (1 v)\n\nwhen I receive [change 3 v]\nswitch costume to (1 v)\n\n@text\n\nwhen flag clicked\nhide\n\nwhen I receive [main menu v]\nhide\n\nwhen I receive [costume v]\nwait (5) seconds\nshow\nrepeat until <(PLAY) = [y]>\n    if <(skin) = [1]> then\n        go to [front v] layer\n        switch costume to (costume2 v)\n    end\n    if <(skin) = [2]> then\n        go to [front v] layer\n        switch costume to (costume3 v)\n    end\n    if <(skin) = [3]> then\n        go to [front v] layer\n        switch costume to (costume4 v)\n    end\nend\n\n@Level2\n\nwhen I receive [update v]\nPosition ((x) - (CAM X)) ((y) - (CAM Y))\n\nwhen I receive [start v]\nhide\nset [x v] to [0]\nset [y v] to [0]\nif <(chapter) = [1]> then\n    Clone Level at: [1920] [0] Costume [Level5]\n    Clone Level at: [480] [0] Costume [Level6]\n    Clone Level at: [480] [0] Costume [Level2]\n    Clone Level at: [480] [0] Costume [Level3]\n    Clone Level at: [480] [0] Costume [Level4]\n    Clone Level at: [480] [0] Costume [Level7]\nend\nif <(chapter) = [2]> then\n    Clone Level at: [960] [0] Costume [7]\n    Clone Level at: [960] [0] Costume [8]\n    Clone Level at: [480] [0] Costume [9]\n    Clone Level at: [480] [0] Costume [10]\n    Clone Level at: [2400] [0] Costume [11]\nend\n\ndefine Clone Level at: (x) (y) Costume (costume)\nswitch costume to (costume)\nchange [x v] by (x)\nchange [y v] by (y)\ncreate clone of (_myself_ v)\n\ndefine Position (x) (y)\ngo to x: (x) y: (y)\nset [onscreen? v] to <<(round (x)) = (round (x position))> and <(round (y)) = (round (y position))>>\nif <(onscreen?) = [true]> then\n    show\nelse\n    hide\nend\n\nwhen flag clicked\nhide\n\nwhen I receive [stop v]\nhide\ndelete this clone\n\nwhen I receive [ending v]\nhide\ndelete this clone\n\nClone Level at: [480] [0] Costume [11]\n\n@Control Stick\n\nwhen flag clicked\nhide\n\nwhen I start as a clone\nswitch costume to (stick v)\ngo [forward v] (1) layers\nset [ghost v] effect to (25)\nforever\n    set [stick power v] to []\n    set [stick x v] to [0]\n    set [stick y v] to [0]\n    repeat until <mouse down?>\n        go to (myself)\n    end\n    if <(distance to [mouse-pointer v]) < ((size) * (0.6))> then\n        Stick Drag\n    else\n        wait until <not <mouse down?>>\n    end\nend\n\ndefine Stick Drag\nrepeat until <not <mouse down?>>\n    go to (mouse-pointer v)\n    point towards (myself)\n    turn right (180) degrees\n    set [stick direction v] to (direction)\n    set [stick power v] to (distance to [(myself) v])\n    if <(STICK POWER) > (max stick)> then\n        move ((max stick) - (STICK POWER)) steps\n        set [stick power v] to (max stick)\n    end\n    set [stick power v] to ((STICK POWER) / (max stick))\n    set [stick x v] to ((STICK POWER) * ([sin v] of (STICK DIRECTION) ))\n    set [stick y v] to ((STICK POWER) * ([cos v] of (STICK DIRECTION) ))\nend\n\nwhen I receive [start v]\nif <(control) = [mobile]> then\n    wait (1) seconds\n    show\n    go to [front v] layer\n    set [myself v] to [Control Stick]\n    set size to (120) %\n    set [max stick v] to ((size) / (4))\n    switch costume to (base v)\n    set [ghost v] effect to (60)\n    create clone of (_myself_ v)\nelse\n    hide\nend\n\nwhen I receive [main menu v]\nhide\ndelete this clone\n\nwhen I receive [ending v]\nhide\ndelete this clone\n\n@skin\n\nwhen flag clicked\nhide\n\nwhen I receive [main menu v]\nhide\nstop [other scripts in sprite v]\n\nwhen I receive [costume v]\ngo to x: (-198) y: (93)\nset size to (200) %\nshow\nrepeat until <(PLAY) = [y]>\n    if <<touching (mouse-pointer v)?> and <mouse down?>> then\n        set [skin v] to [1]\n        set [move v] to [1 move]\n        switch costume to (2 v)\n        broadcast (change 1 v)\n    end\nend\n\nwhen I receive [change 2 v]\nswitch costume to (1 v)\n\nwhen I receive [change 3 v]\nswitch costume to (1 v)\n\n@load\n\nwhen flag clicked\nhide\n\nwhen I receive [loading v]\ngo to [front v] layer\nshow\ngo to x: (202) y: (-146)\nrepeat (pick random (90) to (190))\n    turn right (10) degrees\nend\nbroadcast (done loading v)\n\nwhen I receive [done loading v]\nhide\nstop [other scripts in sprite v]\n\nwhen I receive [load game v]\ngo to [front v] layer\nshow\ngo to x: (202) y: (-146)\nforever\n    turn right (10) degrees\nend\n\n@skin3\n\nwhen flag clicked\nhide\n\nwhen I receive [main menu v]\nhide\nstop [other scripts in sprite v]\n\nwhen I receive [costume v]\ngo to x: (-42) y: (93)\nset size to (200) %\nshow\nrepeat until <(PLAY) = [y]>\n    if <<touching (mouse-pointer v)?> and <mouse down?>> then\n        set [skin v] to [3]\n        set [move v] to [3 move]\n        switch costume to (2 v)\n        broadcast (change 3 v)\n    end\nend\n\nwhen I receive [change 2 v]\nswitch costume to (1 v)\n\nwhen I receive [change 1 v]\nswitch costume to (1 v)\n\n@button3\n\nwhen flag clicked\nhide\n\nwhen I receive [play v]\nwait (1) seconds\nshow\ngo to x: (-143) y: (-39)\nrepeat until <(PLAY) = [n]>\n    if <<touching (mouse-pointer v)?> and <mouse down?>> then\n        set [chapter v] to [4]\n    end\nend\nhide\n\nwhen I receive [main menu v]\nhide\n\nwhen I receive [start v]\nstop [other scripts in sprite v]\n\nwhen I receive [update v]\nhide\n\n
READ BEFORE PLAYING \n-----------------------------------------------------------------------\n1. this game is mobile and pc friendly too, if you want to change it to pc or mobile just check at settings. \n2. this is a platformer and is going to have chapters so stay tuned .\n3. use AWSD or arrow key to move\n4. play tutorial for Instructions