Archer || A Scrolling Platformer

Instructions: -------------------------------------\nControls:\nWAD and Arrows to move\nSpacebar or Click Mouse to fire\nPress 'S' to skip level \n(don't try to make bug because you can't find any bug)\n-------------------------------------\n

@Stage\n\nwhen flag clicked\nbroadcast (Start Menu v)\n\n@Blank\n\n@Archer\n\nwhen I receive [green flag v]\nhide\ngo to [front v] layer\ngo [forward v] (999999999) layers\nset size to (80) %\npoint in direction (-90)\n\nwhen I receive [play game v]\nshow\nhide variable [mouse v]\nset [ghost v] effect to (0)\nswitch costume to (costum4 v)\nset [level v] to [1]\nforever\n    broadcast (Reset v) and wait\n    broadcast (Setup v) and wait\n    Game On\n    repeat until <(EXIT) > []>\n        Tick\n        broadcast (Tick v) and wait\n    end\n    if <(EXIT) = [win]> then\n        Win\n    else\n        Die\n    end\nend\n\ndefine Game On\nset size to (30) %\npoint in direction (-90)\nset [ghost v] effect to (0)\nset [scroll x v] to [0]\nset [scroll y v] to [0]\nset [x v] to [0]\nset [y v] to [0]\nset [sy v] to [0]\nset [in air v] to [0]\nset [exit v] to []\nshow\n\ndefine Tick\nif <<<key (left arrow v) pressed?> or <key (a v) pressed?>> or > then\n    switch costume to (costume2 v)\n    Change Player x by [-8]\nend\nif <<<key (right arrow v) pressed?> or <key (d v) pressed?>> or > then\n    switch costume to (costume3 v)\n    Change Player x by [8]\nend\nif <<<key (up arrow v) pressed?> or <key (w v) pressed?>> or > then\n    if <(in air) < [4]> then\n        set [sy v] to [20]\n    end\nend\nchange [sy v] by (-2)\nChange Player y by (sy)\nPosition\nTest Die\nchange [scroll x v] by (round (((x) - (SCROLL X)) / (5)))\nif <(SCROLL X) < [0]> then\n    set [scroll x v] to [0]\nend\nchange [scroll y v] by (round (((y) - (SCROLL Y)) / (4)))\nif <(SCROLL Y) < [0]> then\n    set [scroll y v] to [0]\nend\nPosition\nif <(y) < [-180]> then\n    set [exit v] to [die]\nend\n\ndefine Change Player y by (sy)\nchange [y v] by (sy)\nchange [in air v] by (1)\nPosition\nrepeat until <not <touching (ground v)?>>\n    if <(sy) > [0]> then\n        change [y v] by (-1)\n    else\n        change [y v] by (1)\n        set [in air v] to [0]\n    end\n    Position\n    set [sy v] to [0]\nend\n\ndefine Position\ngo to x: ((x) - (SCROLL X)) y: ((y) - (SCROLL Y))\n\ndefine Change Player x by (sx)\nchange [x v] by (sx)\nPosition\nif <touching (ground v)?> then\n    repeat (12)\n        change [y v] by (1)\n        Position\n        if <not <touching (ground v)?>> then\n            stop [this script v]\n        end\n    end\n    change [y v] by (-12)\n    repeat until <not <touching (ground v)?>>\n        if <(sx) > [0]> then\n            change [x v] by (-1)\n        else\n            change [x v] by (1)\n        end\n        Position\n    end\nend\n\ndefine Die\nset [exit v] to []\nrepeat (4)\n    hide\n    wait (0.1) seconds\n    show\n    wait (0.1) seconds\nend\nhide\nwait (0.5) seconds\n\ndefine Test Die\nif <<<touching (enemy v)?> or <touching (enemy3 v)?>> or <<touching (danger v)?> or <<touching (enemy2 v)?> or <touching (enemy4 v)?>>>> then\n    set [exit v] to [die]\nend\n\ndefine Win\nhide\nchange [level v] by (1)\n\nwhen I receive [start game v]\nbroadcast (Green Flag v) and wait\nbroadcast (Play Game v) and wait\n\nwhen flag clicked\nhide\n\nwhen I receive [die v]\ngo to x: (0) y: (-62)\n\nwhen flag clicked\nwait (7) seconds\nset [x v] to [0]\nset [y v] to [0]\nset [scroll x v] to [0]\nset [scroll y v] to [0]\n\n@Ground\n\nwhen I receive [green flag v]\nshow\n\nwhen I receive [tick v]\nposition ((x) - (SCROLL X)) ((y) - (SCROLL Y))\n\nwhen I receive [setup v]\nshow\nset [x v] to [0]\nset [y v] to [0]\nif <(LEVEL) = [1]> then\n    switch costume to (level 1 1 v)\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\nelse\n    if <(LEVEL) = [2]> then\n        switch costume to (level 2 1 v)\n        Clone at x: [360] y: [0]\n        Clone at x: [360] y: [0]\n        Clone at x: [360] y: [0]\n        Clone at x: [360] y: [0]\n        Clone at x: [360] y: [0]\n        Clone at x: [500] y: [0]\n    else\n        if <(LEVEL) = [3]> then\n            switch costume to (level 3 1 v)\n            Clone at x: [360] y: [0]\n            Clone at x: [360] y: [0]\n            Clone at x: [360] y: [0]\n            Clone at x: [360] y: [0]\n            Clone at x: [360] y: [0]\n        else\n            if <(LEVEL) = [4]> then\n                switch costume to (level 4 1 v)\n                Clone at x: [360] y: [0]\n            end\n        end\n    end\nend\n\ndefine position (x) (y)\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    hide\nend\n\nwhen I receive [reset v]\ndelete this clone\n\ndefine Clone at x: (x) y: (y)\ncreate clone of (_myself_ v)\nchange [x v] by (x)\nchange [y v] by (y)\nnext costume\n\nwhen I receive [start menu v]\nhide\n\n@Ground2\n\nwhen I receive [green flag v]\nshow\n\nwhen I receive [tick v]\nposition ((x) - (SCROLL X)) ((y) - (SCROLL Y))\n\nwhen I receive [setup v]\nshow\ngo to [back v] layer\ngo [backward v] (100) layers\nset [x v] to [0]\nset [y v] to [0]\nif <(LEVEL) = [1]> then\n    switch costume to (level 1 1 v)\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\nelse\n    if <(LEVEL) = [2]> then\n        switch costume to (level 2 1 v)\n        Clone at x: [360] y: [0]\n        Clone at x: [360] y: [0]\n        Clone at x: [360] y: [0]\n        Clone at x: [360] y: [0]\n        Clone at x: [200] y: [0]\n        Clone at x: [360] y: [0]\n        Clone at x: [360] y: [0]\n    else\n        if <(LEVEL) = [3]> then\n            switch costume to (level 3 1 v)\n            Clone at x: [360] y: [0]\n            Clone at x: [360] y: [0]\n        end\n    end\nend\n\ndefine position (x) (y)\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    hide\nend\n\nwhen I receive [reset v]\ndelete this clone\n\ndefine Clone at x: (x) y: (y)\ncreate clone of (_myself_ v)\nchange [x v] by (x)\nchange [y v] by (y)\nnext costume\n\nwhen I receive [start menu v]\nhide\n\n@Main Menu\n\nwhen flag clicked\nif <not <(username) = [Thomas282]>> then\n    set [☁ who visited my project v] to [1]\nend\ngo to x: (0) y: (0)\n\nwhen this sprite clicked\nbroadcast (Start Game v)\n\nwhen I receive [start menu v]\nwait (9) seconds\nshow\nforever\n    if <touching (mouse-pointer v)?> then\n        set size to (130) %\n        set [brightness v] effect to (20)\n    else\n        set size to (100) %\n        set [brightness v] effect to (0)\n    end\nend\n\nwhen I receive [intructions v]\nhide\n\nwhen I receive [back v]\nshow\n\nwhen I receive [play game v]\nhide\n\n@exit\n\nwhen I receive [green flag v]\nhide\n\nwhen I receive [tick v]\nposition ((x) - (SCROLL X)) ((y) - (SCROLL Y))\nif <<<(costume [name v]) = [open]> and <touching (archer v)?>> or <key (s v) pressed?>> then\n    if <not <(LEVEL) > [3]>> then\n        set [exit v] to [win]\n        if <not <key (s v) pressed?>> then\n            change [arrow v] by (5)\n        end\n    end\nend\n\nwhen I receive [setup v]\ngo to [back v] layer\nhide\nset [collected v] to [0]\nset [x v] to [0]\nset [y v] to [0]\nif <(LEVEL) = [1]> then\n    go to [front v] layer\n    switch costume to (closed v)\n    Clone at x: [2050] y: [300]\nelse\n    if <(LEVEL) = [2]> then\n        go to [front v] layer\n        switch costume to (closed v)\n        Clone at x: [2080] y: [300]\n    else\n        if <(LEVEL) = [3]> then\n            go to [front v] layer\n            switch costume to (closed v)\n            Clone at x: [2100] y: [350]\n        else\n            if <(LEVEL) = [4]> then\n                go to [front v] layer\n                switch costume to (closed v)\n                Clone at x: [3333] y: [600]\n            end\n        end\n    end\nend\n\ndefine position (x) (y)\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    hide\nend\n\nwhen I receive [reset v]\ndelete this clone\n\ndefine Clone at x: (x) y: (y)\nset [x v] to (x)\nset [y v] to (y)\n\nwhen I receive [open portal v]\nswitch costume to (open v)\n\nwhen I receive [start menu v]\nhide\n\n@Danger\n\nwhen I receive [start menu v]\nhide\n\nwhen I receive [tick v]\nposition ((x) - (SCROLL X)) ((y) - (SCROLL Y))\n\nwhen I receive [setup v]\ngo to [front v] layer\nhide\nset [x v] to [0]\nset [y v] to [0]\nif <(LEVEL) = [1]> then\n    switch costume to (level 1 1 v)\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\nelse\n    if <(LEVEL) = [2]> then\n        switch costume to (level 2 1 v)\n        Clone at x: [360] y: [0]\n        Clone at x: [360] y: [0]\n        Clone at x: [360] y: [0]\n        Clone at x: [360] y: [0]\n        Clone at x: [360] y: [0]\n        Clone at x: [360] y: [0]\n        Clone at x: [360] y: [0]\n        Clone at x: [360] y: [0]\n        Clone at x: [360] y: [0]\n    else\n        if <(LEVEL) = [3]> then\n            switch costume to (level 3 1 v)\n            Clone at x: [360] y: [0]\n            Clone at x: [360] y: [0]\n            Clone at x: [360] y: [0]\n            Clone at x: [360] y: [0]\n        else\n            if <(LEVEL) = [4]> then\n                switch costume to (level 4 1 v)\n                Clone at x: [360] y: [0]\n            end\n        end\n    end\nend\n\ndefine position (x) (y)\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    hide\nend\n\nwhen I receive [reset v]\ndelete this clone\n\ndefine Clone at x: (x) y: (y)\ncreate clone of (_myself_ v)\nchange [x v] by (x)\nchange [y v] by (y)\nnext costume\n\n@Key\n\ndefine Position (x) (y)\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    hide\nend\n\ndefine Clone (x) (y)\nset [x v] to (x)\nset [y v] to (y)\ncreate clone of (_myself_ v)\n\nwhen [m v] key pressed\nset [mouse v] to (join ((mouse x) + (SCROLL X)) (join [ , ] ((mouse y) + (SCROLL Y))))\n\nwhen I receive [reset v]\ndelete this clone\n\nwhen I receive [setup v]\nset [x v] to [0]\nset [y v] to [0]\nif <(LEVEL) = [1]> then\n    Clone [1000] [70]\n    Clone [3000] [200]\nelse\n    if <(LEVEL) = [2]> then\n        Clone [1000] [250]\n        Clone [3000] [70]\n    else\n        if <(LEVEL) = [3]> then\n            Clone [735] [200]\n            Clone [3000] [600]\n        else\n            if <(LEVEL) = [4]> then\n                Clone [3000] [600]\n            end\n        end\n    end\nend\n\nwhen I receive [tick v]\nPosition ((x) - (SCROLL X)) (((y) - (SCROLL Y)) + ([sin v] of ((timer) * ((100) * (5))) ))\nif <touching (archer v)?> then\n    change [collected v] by (1)\n    if <(Collected) = [1]> then\n        broadcast (open portal v)\n    else\n        start sound [Collect-Connect v]\n        delete this clone\n    end\nend\n\nwhen I receive [start menu v]\nhide\n\nwhen I receive [start game v]\nshow\n\n@Write\n\nwhen I receive [tick v]\nPosition ((x) - (SCROLL X)) ((y) - (SCROLL Y))\n\nwhen I receive [start game v]\nshow\n\nwhen I receive [reset v]\ndelete this clone\n\nwhen I receive [setup v]\nset [x v] to [0]\nset [y v] to [0]\nif <(LEVEL) = [1]> then\n    Clone [3000] [200]\nelse\n    if <(LEVEL) = [2]> then\n        Clone [1100] [110]\n    else\n        if <(LEVEL) = [3]> then\n            Clone [3000] [200]\n        else\n            if <(LEVEL) = [4]> then\n                Clone [3000] [200]\n            end\n        end\n    end\nend\n\nwhen I receive [start menu v]\nhide\n\ndefine Clone (x) (y)\nset [x v] to (x)\nset [y v] to (y)\ncreate clone of (_myself_ v)\n\ndefine Position (x) (y)\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    hide\nend\n\n@Arrow\n\nwhen I receive [bow v]\npoint in direction ([direction v] of [bow v])\ncreate clone of (_myself_ v)\n\nwhen flag clicked\ngo to (bow v)\nhide\n\nwhen I start as a clone\ngo to (bow v)\nswitch costume to (arrow v)\nchange volume by (-20)\nshow\nstart sound [fire_bow_sound-mike-koenig.mp3 v]\nrepeat until <<touching (_edge_ v)?> or <<touching (enemy v)?> or <<touching (ground v)?> or <<touching (danger v)?> or <<touching (enemy2 v)?> or <<touching (enemy3 v)?> or <touching (enemy4 v)?>>>>>>>\n    move (10) steps\n    if <touching (enemy v)?> then\n        broadcast (Enemy Defeat v)\n        delete this clone\n    end\n    if <touching (enemy2 v)?> then\n        broadcast (Enemy Defeat 2 v)\n        delete this clone\n    end\n    if <touching (enemy3 v)?> then\n        broadcast (Enemy Defeat 3 v)\n        delete this clone\n    end\nend\ndelete this clone\n\n@Bow\n\nwhen flag clicked\nset size to (85) %\nhide\nswitch costume to (no arrow v)\npoint in direction (([direction v] of [archer v]) * (-1))\nforever\n    go to (archer v)\n    point towards (mouse-pointer v)\nend\n\nwhen [1 v] key pressed\nshow\nswitch costume to (no arrow v)\nset size to (175) %\ngo to (archer v)\n\ndefine Position (x) (y)\ngo to x: (x) y: (y)\n\nwhen I receive [play game v]\nshow\ngo to (archer v)\nwait (1) seconds\nforever\n    if <<key (space v) pressed?> or <mouse down?>> then\n        if <not <(Arrow) = [0]>> then\n            change [arrow v] by (-1)\n        end\n        if <not <(Arrow) = [0]>> then\n            if <(costume [number v]) = [1]> then\n                switch costume to (no arrow v)\n                set volume to (100) %\n                start sound [string_tension-mike-koenig v]\n                repeat until <(costume [number v]) = [5]>\n                    next costume\n                    wait (0.05) seconds\n                end\n                wait (1) seconds\n                broadcast (bow v)\n                wait (0.1) seconds\n                switch costume to (no arrow v)\n                wait (0.2) seconds\n            end\n        end\n    end\nend\n\n@Enemy\n\nwhen I receive [green flag v]\nhide\n\nwhen I receive [tick v]\nposition ((x) - (SCROLL X)) ((y) - (SCROLL Y))\n\nwhen I receive [setup v]\ngo to [front v] layer\nhide\nset [x v] to [0]\nset [y v] to [0]\nif <(LEVEL) = [1]> then\n    switch costume to (level 1 1 v)\n    set size to (30) %\n    Clone at x: [400] y: [42]\n    Clone at x: [400] y: [42]\n    Clone at x: [400] y: [42]\n    Clone at x: [400] y: [42]\nend\n\ndefine position (x) (y)\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    hide\nend\n\nwhen I receive [reset v]\ndelete this clone\n\ndefine Clone at x: (x) y: (y)\ncreate clone of (_myself_ v)\nchange [x v] by (x)\nchange [y v] by (y)\nnext costume\n\nwhen I receive [enemy defeat v]\ndelete this clone\n\n@Enemy2\n\nwhen I receive [green flag v]\nhide\n\nwhen I receive [tick v]\nposition ((x) - (SCROLL X)) ((y) - (SCROLL Y))\n\nwhen I receive [setup v]\ngo to [front v] layer\nhide\nset [x v] to [0]\nset [y v] to [0]\nif <(LEVEL) = [1]> then\n    switch costume to (level 1 1 v)\n    set size to (30) %\n    Clone at x: [420] y: [42]\n    Clone at x: [420] y: [42]\n    Clone at x: [420] y: [42]\n    Clone at x: [420] y: [42]\nelse\nend\n\ndefine position (x) (y)\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    hide\nend\n\nwhen I receive [reset v]\ndelete this clone\n\ndefine Clone at x: (x) y: (y)\ncreate clone of (_myself_ v)\nchange [x v] by (x)\nchange [y v] by (y)\nnext costume\n\nwhen flag clicked\nforever\n    if <touching (bow v)?> then\n        delete this clone\n    end\nend\n\nwhen I receive [enemy defeat 2 v]\ndelete this clone\n\n@Enemy3\n\nwhen I receive [green flag v]\nhide\n\nwhen I receive [tick v]\nposition ((x) - (SCROLL X)) ((y) - (SCROLL Y))\n\nwhen I receive [setup v]\ngo to [front v] layer\nhide\nset [x v] to [0]\nset [y v] to [0]\nif <(LEVEL) = [1]> then\n    switch costume to (level 1 1 v)\n    set size to (30) %\n    Clone at x: [410] y: [22.5]\n    Clone at x: [410] y: [22.5]\n    Clone at x: [410] y: [22.5]\n    Clone at x: [410] y: [22.5]\nend\n\ndefine position (x) (y)\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    hide\nend\n\nwhen I receive [reset v]\ndelete this clone\n\ndefine Clone at x: (x) y: (y)\ncreate clone of (_myself_ v)\nchange [x v] by (x)\nchange [y v] by (y)\nnext costume\n\nwhen flag clicked\nforever\n    if <touching (bow v)?> then\n        delete this clone\n    end\nend\n\nwhen I receive [enemy defeat 3 v]\ndelete this clone\n\n@clouds\n\nwhen flag clicked\n\nhide\nforever\n    create clone of (_myself_ v)\n    wait (13) seconds\nend\n\nwhen I start as a clone\n\ngo to [back v] layer\ngo [forward v] (3) layers\nswitch costume to (pick random (1) to (3))\nset size to (pick random (90) to (110)) %\nset [ghost v] effect to (pick random (20) to (40))\nset y to (pick random (100) to (185))\nset x to (301)\nshow\nrepeat until <<(x position) < [-290]> or <(x position) = [-290]>>\n    change x by (-1)\nend\ndelete this clone\n\nwhen I receive [the end v]\n\nstop [other scripts in sprite v]\nhide\n\n@Thumbnail\n\nwhen flag clicked\ngo to [front v] layer\nswitch costume to (thumbnail2 v)\nshow\nwait (3) seconds\nset [ghost v] effect to (200)\n\n@sun\n\nwhen I start as a clone\ngo to [back v] layer\nset size to (100) %\nswitch costume to (fantasia2 v)\nset [ghost v] effect to (50)\nforever\n    repeat (45)\n        change size by (0.5)\n    end\n    repeat (45)\n        change size by (-0.5)\n    end\nend\n\nwhen I receive [play game v]\nshow\ngo to [back v] layer\ngo [backward v] (55555) layers\nswitch costume to (fantasia1 v)\ncreate clone of (_myself_ v)\n\nwhen flag clicked\nhide\n\n@Who\n\nwhen flag clicked\nif <not <(username) = [Thomas282]>> then\n    Read In Visited Lists\n    Add Me To Visited List (username)\n    Display and Store Visited List\nend\n\ndefine Read In Visited Lists\ndelete (all) of [who list v]\ndelete (all) of [when list v]\ndelete (all) of [count list v]\nInit Reader (☁ Who visited)\nrepeat until <(parseIdx) > (length of (parseStr))>\n    Read String\n    add (?Val) to [who list v]\n    Read Number\n    add (?Val) to [when list v]\n    Read Number\n    add (?Val) to [count list v]\nend\n\ndefine Init Reader (text)\nset [parsestr v] to (text)\nset [parseidx v] to [1]\n\nwhen flag clicked\nset [_chars v] to [ !"#$%&'\(\)*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ\[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~]\n\ndefine Read Number\nset [?val v] to []\nrepeat (letter (parseIdx) of (parseStr))\n    change [parseidx v] by (1)\n    set [?val v] to (join (?Val) (letter (parseIdx) of (parseStr)))\nend\nif <(?Val) > [8388608]> then\n    set [?val v] to ((?Val) - (16777215))\nend\nchange [parseidx v] by (1)\n\ndefine Write Number (val)\nif <(val) < [0]> then\n    set [?val v] to (round ((val) + (16777215)))\nelse\n    set [?val v] to (round (val))\nend\nset [parsestr v] to (join (parseStr) (join (length of (?Val)) (?Val)))\n\ndefine Write String (txt)\nWrite Number (length of (txt))\nset [?val v] to []\nset [ti v] to [1]\nrepeat (length of (txt))\n    set [tc v] to (letter (ti) of (txt))\n    set [ti2 v] to [1]\n    repeat until <<(tc) = (letter (ti2) of (_Chars))> or <(ti2) > (length of (_Chars))>>\n        change [ti2 v] by (1)\n    end\n    if <(ti2) < [10]> then\n        set [?val v] to (join (?Val) [0])\n    end\n    set [?val v] to (join (?Val) (ti2))\n    change [ti v] by (1)\nend\nset [parsestr v] to (join (parseStr) (?Val))\n\ndefine Read String\nRead Number\nset [parselen v] to (?Val)\nset [?val v] to []\nrepeat (parseLen)\n    set [ti2 v] to (((letter (parseIdx) of (parseStr)) * (10)) + (letter ((parseIdx) + (1)) of (parseStr)))\n    set [?val v] to (join (?Val) (letter (ti2) of (_Chars)))\n    change [parseidx v] by (2)\nend\n\ndefine Add Me To Visited List (who)\nset [whoidx v] to [1]\nset [found? v] to [0]\nrepeat (length of [who list v])\n    set [who v] to (item (whoIdx) of [who list v])\n    if <(who) = (who)> then\n        set [when v] to (item (whoIdx) of [when list v])\n        if <(when) = ([floor v] of (days since 2000) )> then\n            set [found? v] to [1]\n            set [count v] to ((item (whoIdx) of [count list v]) + (1))\n            replace item (whoIdx) of [count list v] with (count)\n        end\n    end\n    change [whoidx v] by (1)\nend\nif <(found?) = [0]> then\n    insert (who) at (1) of [who list v] \n    insert ([floor v] of (days since 2000) ) at (1) of [when list v] \n    insert [1] at (1) of [count list v] \nend\n\ndefine Display and Store Visited List\ndelete (all) of [visited list v]\nset [whoidx v] to [1]\nInit Reader []\nset [last when v] to [0]\nrepeat (length of [who list v])\n    set [who v] to (item (whoIdx) of [who list v])\n    set [when v] to (item (whoIdx) of [when list v])\n    set [count v] to (item (whoIdx) of [count list v])\n    Write String (who)\n    Write Number (when)\n    Write Number (count)\n    if <not <(last when) = (when)>> then\n        set [last when v] to (when)\n        set [when v] to (([floor v] of (days since 2000) ) - (when))\n        if <(when) = [0]> then\n            set [when v] to [Today]\n        else\n            if <(when) = [1]> then\n                set [when v] to [Yesterday]\n            else\n                set [when v] to (join (when) [ days ago])\n            end\n        end\n        add [] to [visited list v]\n        add (join [>>>>>     ] (join (when) [     <<<<<])) to [visited list v]\n        add [] to [visited list v]\n    end\n    add (join (who) (join [     x] (count))) to [visited list v]\n    change [whoidx v] by (1)\nend\ndelete (1) of [visited list v]\nset [☁ who visited v] to (parseStr)\n\n@Arrow (Enemy)\n\nwhen I receive [bow v]\n\npoint in direction ([direction v] of [bow \(enemy\) v])\ncreate clone of (_myself_ v)\n\nwhen flag clicked\n\ngo to (bow \(enemy\) v)\nhide\n\nwhen I start as a clone\n\ngo to (bow \(enemy\) v)\nswitch costume to (arrow v)\nchange volume by (-20)\nshow\nstart sound [fire_bow_sound-mike-koenig.mp3 v]\nrepeat until <<touching (_edge_ v)?> or <touching (archer v)?>>\n    move (10) steps\n    if <touching (archer v)?> then\n        set [exit v] to [die]\n    end\nend\ndelete this clone\n\n@Bow (Enemy)\n\nwhen flag clicked\n\nset size to (85) %\nhide\nswitch costume to (no arrow v)\npoint in direction (([direction v] of [enemy3 v]) * (-1))\nforever\n    go to (enemy3 v)\nend\n\nwhen [1 v] key pressed\n\nshow\nswitch costume to (no arrow v)\nset size to (175) %\ngo to (enemy3 v)\n\ndefine Position (x) (y)\n\ngo to x: (x) y: (y)\n\nwhen [right arrow v] key pressed\n\npoint in direction (90)\n\nwhen [left arrow v] key pressed\n\npoint in direction (-90)\n\nwhen I receive [play game v]\n\nshow\ngo to (enemy3 v)\nforever\n    if <(distance to [archer v]) < [300]> then\n        switch costume to (no arrow v)\n        set volume to (100) %\n        start sound [string_tension-mike-koenig v]\n        repeat until <(costume [number v]) = [5]>\n            next costume\n            wait (0.05) seconds\n        end\n        wait (1) seconds\n        broadcast (bow 2 v)\n        wait (0.1) seconds\n        switch costume to (no arrow v)\n        wait (0.2) seconds\n    end\nend\n\n@writer\n\nwhen I receive [start menu v]\nhide\n\nwhen I receive [green flag v]\nshow\n\nwhen I receive [setup v]\nshow\nset [x v] to [0]\nset [y v] to [0]\nif <(LEVEL) = [4]> then\n    show\nelse\n    hide\nend\n\n@Kukla 2\n\nwhen flag clicked\nset [ghost v] effect to (50)\nhide variable [arrow v]\nhide\n\nwhen I receive [play game v]\nset [arrow v] to [12]\nshow variable [arrow v]\nshow\n\n@Story\n\nwhen flag clicked\nhide\n\nwhen I receive [start menu v]\nwait (3) seconds\nshow\ngo to [front v] layer\ngo [forward v] (888888) layers\nswitch costume to (0 v)\nwait (3) seconds\nswitch costume to (1 v)\nrepeat (4)\n    next costume\n    wait (0.1) seconds\nend\nrepeat (4)\n    next costume\n    wait (0.05) seconds\nend\nrepeat (4)\n    next costume\n    wait (0.01) seconds\nend\nrepeat (3)\n    next costume\n    wait (0.3) seconds\nend\nrepeat (11)\n    next costume\n    wait (0.07) seconds\nend\nwait (1) seconds\nnext costume\nwait (3) seconds\nnext costume\nwait (2) seconds\nhide\n\n