islands// A platformer

Instructions: Look my newest platformer!\nhttps://scratch.mit.edu/projects/520519757/\nUpdate: in may!\n\n___________________Islands___________________\nIn this game, there are 10 levels (for the moment).\nThere are: good graphics, gravity, water engine (gravity)...\n\nMove: WASD keys or arrow keys.\nAvoid: Spikes.y 

@Stage\n\n@Player\n\nwhen flag clicked\nset [level v] to [1]\nhide\nbroadcast (play v)\n\nwhen I receive [play v]\ngo to [front v] layer\nclear graphic effects\nset [ghost v] effect to (0)\nswitch costume to (player v)\nset size to (100) %\npoint in direction (90)\ngo to x: (item (LEVEL) of [x v]) y: (item (LEVEL) of [y v])\nshow\nset [x v] to [0]\nset [y v] to [0]\nforever\n    change [y v] by (-1)\n    if <touching (sea v)?> then\n        set [y v] to ((y) * (0.7))\n    end\n    if <<key (left arrow v) pressed?> or <key (a v) pressed?>> then\n        change [x v] by (-1)\n        point in direction (-90)\n    end\n    if <<key (right arrow v) pressed?> or <key (d v) pressed?>> then\n        change [x v] by (1)\n        point in direction (90)\n    end\n    set [x v] to ((x) * (0.9))\n    change x by (x)\n    if <touching (platformer level v)?> then\n        change y by (1)\n    end\n    if <touching (platformer level v)?> then\n        change y by (1)\n    end\n    if <touching (platformer level v)?> then\n        change y by (1)\n    end\n    if <touching (platformer level v)?> then\n        change y by (1)\n    end\n    if <touching (platformer level v)?> then\n        change y by (-4)\n        change x by ((x) * (-1))\n        if <<key (up arrow v) pressed?> or <key (w v) pressed?>> then\n            set [y v] to [10]\n            if <([abs v] of (x) ) = (x)> then\n                set [x v] to [-5]\n            else\n                set [x v] to [5]\n            end\n        else\n            set [x v] to [0]\n        end\n    end\n    change y by (y)\n    if <touching (platformer level v)?> then\n        change y by ((y) - ((y) * (2)))\n        set [y v] to [0]\n    end\n    change y by (-1)\n    if <<<key (up arrow v) pressed?> or <key (w v) pressed?>> and <touching (platformer level v)?>> then\n        set [y v] to [20]\n    end\n    if <<<key (up arrow v) pressed?> or <key (w v) pressed?>> and <touching (sea v)?>> then\n        change [y v] by (3)\n    end\n    change y by (1)\n    if <touching (platformer level v)?> then\n        set [y v] to [1]\n    end\n    if <<not <touching (sea v)?>> and <<(x position) > [231]> and <not <(y position) < [10]>>>> then\n        if <not <(LEVEL) = [10]>> then\n            change [level v] by (1)\n            broadcast (play v)\n        end\n    end\n    if <touching (trampoline v)?> then\n        set [y v] to [17]\n    end\n    if <touching (spikes v)?> then\n        repeat (10)\n            change [ghost v] effect by (10)\n        end\n        broadcast (play v)\n    end\n    if <(y position) < [-178]> then\n        broadcast (play v)\n    end\nend\n\nwhen flag clicked\ndelete all of [x v]\ndelete all of [y v]\nadd [-210] to [x v]\nadd [50] to [y v]\nadd [-210] to [x v]\nadd [120] to [y v]\nadd [-210] to [x v]\nadd [120] to [y v]\nadd [-210] to [x v]\nadd [50] to [y v]\nadd [-210] to [x v]\nadd [120] to [y v]\nadd [-210] to [x v]\nadd [120] to [y v]\nadd [-210] to [x v]\nadd [120] to [y v]\nadd [-210] to [x v]\nadd [50] to [y v]\nadd [-210] to [x v]\nadd [120] to [y v]\nadd [-210] to [x v]\nadd [120] to [y v]\n\nwhen flag clicked\nforever\n    play sound (pick random (1) to (2)) until done\nend\n\n@Platformer level\n\nwhen flag clicked\nshow\nreset timer\nforever\n    go to [front v] layer\n    go to x: (0) y: ((0) + (([cos v] of (((timer) - (3)) * (123)) ) * (3)))\n    switch costume to (LEVEL)\nend\n\n@decoration\n\nwhen flag clicked\nshow\nclear graphic effects\ngo to [back v] layer\nforever\n    if <(username) = [blinsing]> then\n        go to x: (0) y: ((0) + (([cos v] of (((timer) - (3)) * (123)) ) * (3)))\n        switch costume to (LEVEL)\n    else\n        go to x: (0) y: ((0) + (([cos v] of (((timer) - (3)) * (123)) ) * (3)))\n        switch costume to (LEVEL)\n    end\nend\n\nhide\n\nset [color v] effect to (100)\n\n@spikes\n\nwhen flag clicked\ngo to [back v] layer\nshow\nforever\n    go to x: (0) y: ((0) + (([cos v] of (((timer) - (3)) * (123)) ) * (3)))\n    switch costume to (LEVEL)\nend\n\n@teller\n\nwhen flag clicked\nhide\nforever\n    if <(LEVEL) = [1]> then\n        set [tell v] to (join [hello ] (join (username) [!!!]))\n    else\n        if <(LEVEL) = [2]> then\n            set [tell v] to (join [welcome ] (join [to ] [islands.]))\n        else\n            if <(LEVEL) = [3]> then\n                set [tell v] to [avoid spikes]\n            else\n                if <(LEVEL) = [4]> then\n                    set [tell v] to [jump, jump!!!]\n                else\n                    if <(LEVEL) = [5]> then\n                        set [tell v] to [new island!!!]\n                    else\n                        if <(LEVEL) = [6]> then\n                            set [tell v] to [use trampoline to:-jump high!!!]\n                        else\n                            if <(LEVEL) = [7]> then\n                                set [tell v] to [be careful!]\n                            else\n                                if <(LEVEL) = [8]> then\n                                    set [tell v] to [use water]\n                                else\n                                    if <(LEVEL) = [9]> then\n                                        set [tell v] to [use tramboline-another time!!!]\n                                    else\n                                        if <(LEVEL) = [10]> then\n                                            set [tell v] to [more levels soon!!!-love / fave / follow]\n                                        end\n                                    end\n                                end\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\nend\n\ngo to [front v] layer\n\n@text engine\n\nwhen I start as a clone\nforever\n    if <(borra) = [1]> then\n        delete this clone\n    else\n        if <touching (player v)?> then\n            set [brightness v] effect to (100)\n            go to [front v] layer\n            show\n        else\n            set [brightness v] effect to (0)\n            go to [front v] layer\n            show\n        end\n    end\nend\n\ndefine copy at X/Y: (x) (y) Text: (t) spacing: (spacing) Size to: (size)\nset [idl v] to [1]\ngo to x: (x) y: (y)\nrepeat (length of (t))\n    switch costume to (letter (idl) of (t))\n    set size to (size) %\n    create clone of (_myself_ v)\n    change [idl v] by (1)\n    change x by (spacing)\n    switch costume to (cs v)\n    if <(letter (idl) of (t)) = [-]> then\n        go to x: ((x) - (spacing)) y: ((y) - ((spacing) + (10)))\n    end\nend\n\nwhen I receive [play v]\nset [borra v] to [1]\nhide\nset size to (size) %\nswitch costume to (cs v)\nwait (0.6) seconds\nset [borra v] to [0]\ncopy at X/Y: [-230] [150] Text: (tell) spacing: [18] Size to: [100]\ncopy at X/Y: [-230] [-170] Text: (join [level:] (LEVEL)) spacing: [18] Size to: [100]\n\n@Sea\n\nwhen flag clicked\nset size to (100) %\nset [ghost v] effect to (20)\nset [i v] to [0]\nforever\n    change [i v] by (10)\n    change y by (([sin v] of (i) ) / (3))\n    go [forward v] (4) layers\n    go to [front v] layer\nend\n\nwhen flag clicked\nshow\ngo to x: (0) y: (40)\nforever\n    switch costume to (LEVEL)\nend\n\n@trampoline\n\nwhen flag clicked\nhide\nswitch costume to (trampolí v)\nforever\n    go [forward v] (1) layers\n    if <(LEVEL) = [6]> then\n        go to x: (-55) y: ((0) + (([cos v] of (((timer) - (3)) * (123)) ) * (3)))\n        show\n        if <touching (player v)?> then\n            switch costume to (trampolí2 v)\n            wait (0.1) seconds\n        else\n            switch costume to (trampolí v)\n        end\n    else\n        hide\n        if <(LEVEL) = [9]> then\n            go to x: (-140) y: ((-5) + (([cos v] of (((timer) - (3)) * (123)) ) * (3)))\n            show\n            if <touching (player v)?> then\n                switch costume to (trampolí2 v)\n                wait (0.1) seconds\n            else\n                switch costume to (trampolí v)\n            end\n        else\n            hide\n        end\n    end\nend\n\n@Thumbnail\n\nwhen flag clicked\nset [ghost v] effect to (0)\nshow\ngo to x: (0) y: (0)\nrepeat (100)\n    change [ghost v] effect by (10)\nend\nforever\n    go to [front v] layer\nend\n\n