Atlantis II A platformer


@Stage\n\nwhen I receive [start v]\nforever\n    play sound [bensound-summer v] until done\nend\n\nwhen flag clicked\nset [level v] to [1]\n\n@Player\n\ndefine Platform (jump heigh) (graity) (friction) (running speed)\nif <<key (right arrow v) pressed?> or <<mouse down?> and <(mouse x) > (x position)>>> then\n    change [xvel v] by (running speed)\nend\nif <<key (left arrow v) pressed?> or <<mouse down?> and <(mouse x) < (x position)>>> then\n    change [xvel v] by ((running speed) * (-1))\nend\nset [xvel v] to ((Xvel) * (friction))\nchange x by (Xvel)\nif <touching (level v)?> then\n    set [slope v] to [0]\n    repeat until <<(Slope) = [8]> or <not <touching (level v)?>>>\n        change [slope v] by (1)\n        change y by (1)\n    end\n    if <touching (level v)?> then\n        change y by ((Slope) * (-1))\n        repeat ([ceiling v] of ([abs v] of (Xvel) ) )\n            if <touching (level v)?> then\n                change x by ((([abs v] of (Xvel) ) / (Xvel)) * (-1))\n            end\n        end\n        set [xvel v] to [0]\n    end\nend\nchange y by (Yvel)\nif <touching (level v)?> then\n    repeat ([ceiling v] of ([abs v] of (Yvel) ) )\n        if <touching (level v)?> then\n            change y by ((([abs v] of (Yvel) ) / (Yvel)) * (-1))\n        end\n    end\n    if <<(([abs v] of (Yvel) ) / (Yvel)) = [-1]> and <<key (space v) pressed?> or <<key (up arrow v) pressed?> or <<mouse down?> and <(mouse y) > ((y position) + (50))>>>>> then\n        set [yvel v] to (jump heigh)\n    else\n        set [yvel v] to [0]\n    end\nelse\n    change [yvel v] by (-1)\nend\nset [scrollx v] to ((x position) * (-0.5))\nset [scrolly v] to ((y position) * (-0.5))\n\nwhen flag clicked\nhide\n\nwhen I receive [play the game v]\nswitch costume to (Player)\ngo to x: (-204) y: (-20)\nset [xvel v] to [0]\nset [yvel v] to [0]\nshow\nforever\n    Platform [12] [-1] [0.8] [2]\n    if <(y position) < [-190]> then\n        go to x: (-204) y: (-20)\n        set [xvel v] to [0]\n        set [yvel v] to [0]\n    end\n    if <(x position) > [250]> then\n        go to x: (-204) y: (-20)\n        set [xvel v] to [0]\n        set [yvel v] to [0]\n        change [level v] by (1)\n    end\n    if <key (r v) pressed?> then\n        go to x: (-204) y: (-20)\n        set [xvel v] to [0]\n        set [yvel v] to [0]\n    end\n    if <touching (spikes v)?> then\n        go to x: (-204) y: (-20)\n        set [xvel v] to [0]\n        set [yvel v] to [0]\n    end\n    if <(Level) = [10]> then\n        go to x: (0) y: (-40)\n    end\n    if <key (s v) pressed?> then\n        go to x: (-204) y: (-20)\n        set [xvel v] to [0]\n        set [yvel v] to [0]\n        change [level v] by (1)\n    end\nend\n\n@intro\n\nwhen flag clicked\npoint in direction (90)\nclear graphic effects\ngo to x: (0) y: (0)\nhide\nswitch costume to (back v)\ncreate clone of (_myself_ v)\nwait (.1) seconds\nswitch costume to (logo v)\ncreate clone of (_myself_ v)\n\nwhen I start as a clone\nif <(costume [number v]) = [2]> then\n    go to x: (0) y: (0)\n    show\n    forever\n        repeat (10)\n            change [brightness v] effect by (1)\n        end\n        repeat (10)\n            change [brightness v] effect by (-1)\n        end\n    end\nend\n\nwhen I start as a clone\nif <(costume [number v]) = [1]> then\n    go to x: (0) y: (0)\n    set size to (200) %\n    show\n    set [ghost v] effect to (100)\n    repeat (20)\n        change size by (-5)\n        change [ghost v] effect by (-5)\n    end\n    forever\n        go to [front v] layer\n    end\nend\n\nwhen flag clicked\nplay sound [avengers v] until done\nstart sound [Crunch v]\nswitch costume to (block v)\ncreate clone of (_myself_ v)\nplay sound [Revenge v] until done\nwait (.5) seconds\nbroadcast (start v)\n\nwhen I start as a clone\nif <(costume [number v]) = [3]> then\n    go to x: (0) y: (0)\n    show\nend\n\nwhen I start as a clone\nif <(costume [number v]) = [1]> then\n    wait (2) seconds\n    forever\n        repeat (10)\n            change y by (1)\n        end\n        repeat (10)\n            change y by (-1)\n        end\n    end\nend\n\nwhen I start as a clone\nif <(costume [number v]) = [3]> then\n    go to x: (0) y: (0)\n    show\n    forever\n        repeat (10)\n            change y by (1)\n        end\n        repeat (10)\n            change y by (-1)\n        end\n    end\nend\n\nwhen I start as a clone\nif <(costume [number v]) = [1]> then\n    wait (2) seconds\n    forever\n        repeat (10)\n            turn right (1) degrees\n        end\n        repeat (20)\n            turn left (1) degrees\n        end\n        repeat (10)\n            turn right (1) degrees\n        end\n    end\nend\n\nwhen I receive [start v]\ndelete this clone\n\n@Level\n\nwhen flag clicked\nhide\n\nwhen I receive [play the game v]\nshow\nforever\n    switch costume to (Level)\n    go to x: (Scrollx) y: (Scrolly)\nend\n\n@Shadow\n\nwhen I receive [play the game v]\nshow\nforever\n    switch costume to (Level)\n    set [ghost v] effect to (70)\n    go to [back v] layer\n    go to (level v)\nend\n\nwhen flag clicked\nhide\n\n@Spikes\n\nwhen flag clicked\nhide\n\nwhen I receive [play the game v]\nshow\nforever\n    switch costume to (Level)\n    go to (level v)\nend\n\n@Text\n\nwhen flag clicked\nhide\n\nwhen I receive [start v]\ngo to x: (0) y: (51)\nshow\nforever\n    if <touching (mouse-pointer v)?> then\n        switch costume to (2 v)\n        start sound [Clang v]\n        wait until <not <touching (mouse-pointer v)?>>\n    else\n        switch costume to (1 v)\n    end\nend\n\nwhen I receive [play the game v]\nhide\n\n@Select player\n\nwhen flag clicked\nswitch costume to (1 v)\nset [player v] to [1]\nhide\n\nwhen I receive [start v]\ngo to x: (0) y: (0)\nshow\nforever\n    if <touching (mouse-pointer v)?> then\n        set size to (120) %\n        start sound [F Trumpet v]\n        wait until <not <touching (mouse-pointer v)?>>\n    else\n        set size to (100) %\n    end\nend\n\nwhen I receive [back v]\nswitch costume to ((costume [number v]) - (1))\nset [player v] to (costume [number v])\n\nwhen I receive [next v]\nnext costume\nset [player v] to (costume [number v])\n\nwhen I receive [play the game v]\nhide\n\n@Switch player1\n\nwhen flag clicked\nhide\n\nwhen I receive [start v]\ngo to x: (61) y: (-6)\nshow\nforever\n    if <touching (mouse-pointer v)?> then\n        set size to (120) %\n        if <mouse down?> then\n            start sound [Basketball Bounce v]\n            wait until <not <mouse down?>>\n            broadcast (Next v)\n        end\n    else\n        set size to (100) %\n    end\nend\n\nwhen I receive [play the game v]\nhide\n\n@Switch player2\n\nwhen flag clicked\nhide\n\nwhen I receive [start v]\ngo to x: (-61) y: (-6)\nshow\nforever\n    if <touching (mouse-pointer v)?> then\n        set size to (120) %\n        if <mouse down?> then\n            start sound [Basketball Bounce v]\n            wait until <not <mouse down?>>\n            broadcast (Back v)\n        end\n    else\n        set size to (100) %\n    end\nend\n\nwhen I receive [play the game v]\nhide\n\n@Play\n\nwhen flag clicked\nhide\n\nwhen I receive [start v]\ngo to x: (0) y: (-114)\nshow\nforever\n    point in direction ((90) + (([cos v] of (((timer) - (3)) * (400)) ) * (10)))\n    if <touching (mouse-pointer v)?> then\n        switch costume to (2 v)\n        if <mouse down?> then\n            broadcast (Play the game v)\n            wait until <not <mouse down?>>\n        end\n    else\n        switch costume to (1 v)\n    end\nend\n\nwhen I receive [play the game v]\nhide\n\n@Thumbnail\n\nwhen flag clicked\nforever\n    go to [front v] layer\n    go to x: (0) y: (0)\n    set [ghost v] effect to (100)\nend\n\n