pixel platformer (scrolling)

Instructions: another game by me is https://scratch.mit.edu/projects/395033446/\nUse arrow keys or WASD to control. After collecting 10 coins, the white blocks will open. After collecting 60 coins, the gold blocks will open. For the blue and red blocks, you will need to find a switch. The flags are checkpoints. If you fall in lava, you will return to your most recent flag. To avoid the spikes which appear late in the game, you have to go over them when they are down.

@Stage\n\n@levels\n\nset [level height v] to [0]\n\ndefine render\nset [object v] to [0]\nchange [tick v] by (1)\nerase all\ngo to x: ((-224) - ((x scroll) mod (32))) y: ((-164) - ((y scroll) mod (32)))\nset [render.x v] to [0]\nrepeat (16)\n    set [render.y v] to [0]\n    set y to ((-164) - ((y scroll) mod (32)))\n    repeat (12)\n        set y to ((((-164) - ((y scroll) mod (32))) + ((32) * ((render.y) - (0)))) - (0))\n        set [block v] to (item (((((render.x) + (1)) + ([floor v] of ((x scroll) / (32)) )) * (level height)) + (((render.y) + (0)) + ([floor v] of ((y scroll) / (32)) ))) of [level v])\n        if <(block) < [48]> then\n            switch costume to (block)\n        else\n            if <<(block) = [48]> or <(block) = [49]>> then\n                switch costume to (join (block) (join [-] (red)))\n            else\n                if <<(block) = [50]> or <(block) = [51]>> then\n                    switch costume to (join (block) (join [-] (blue)))\n                else\n                    if <<(block) = [52]> or <(block) = [53]>> then\n                        switch costume to (join (block) (join [-] ((4) - (([floor v] of ((tick) / (3)) ) mod (4)))))\n                    else\n                        if <(block) = [54]> then\n                            set [tile v] to (((([floor v] of ((((x position) + (x scroll)) + (272)) / (32)) ) * (level height)) + ([floor v] of ((((y position) + (y scroll)) + (156)) / (32)) )) + (1))\n                            if <(tile) = (save block)> then\n                                switch costume to (54-2 v)\n                            else\n                                switch costume to (54-1 v)\n                            end\n                        else\n                            if <(block) = [55]> then\n                                switch costume to (join [55-] (jumps))\n                            else\n                                if <(block) = [56]> then\n                                    switch costume to (join [56-] (wall jumps))\n                                else\n                                    if <(block) = [57]> then\n                                        switch costume to (join [57-] (jumps))\n                                    else\n                                        if <(letter (1) of (block)) = [c]> then\n                                            if <[0] = (item (join (join (letter (2) of (block)) (letter (3) of (block))) (join (letter (4) of (block)) (letter (5) of (block)))) of [coins v])> then\n                                                change y by (([sin v] of (((tick) + ((100) * (join (letter (3) of (block)) (join (letter (4) of (block)) (letter (5) of (block)))))) * (3)) ) * (10))\n                                                switch costume to (58 v)\n                                            else\n                                                switch costume to (0 v)\n                                            end\n                                        else\n                                            if <(block) = [59]> then\n                                                if <(([floor v] of ((tick) / (3)) ) mod (16)) < [10]> then\n                                                    switch costume to (59-1 v)\n                                                else\n                                                    switch costume to (join [59-] ((([floor v] of ((tick) / (3)) ) - (9)) mod (16)))\n                                                end\n                                            else\n                                                if <(block) < [63]> then\n                                                    switch costume to (block)\n                                                else\n                                                    if <(block) = [63]> then\n                                                        if <(item (14) of [not solid v]) = [0]> then\n                                                            switch costume to (63-1 v)\n                                                        else\n                                                            switch costume to (63-2 v)\n                                                        end\n                                                    else\n                                                        if <(block) = [64]> then\n                                                            switch costume to (64 v)\n                                                            broadcast (message v)\n                                                        else\n                                                            if <(block) = [65]> then\n                                                                if <(item (15) of [not solid v]) = [0]> then\n                                                                    switch costume to (65-1 v)\n                                                                else\n                                                                    switch costume to (65-2 v)\n                                                                end\n                                                            end\n                                                        end\n                                                    end\n                                                end\n                                            end\n                                        end\n                                    end\n                                end\n                            end\n                        end\n                    end\n                end\n            end\n        end\n        stamp\n        change [render.y v] by (1)\n    end\n    set x to ((((-224) - ((x scroll) mod (32))) + ((32) * (render.x))) - (-32))\n    change [render.x v] by (1)\nend\nmap\n\nif <key (up arrow v) pressed?> then\n    change [y scroll v] by (1)\nend\nif <key (down arrow v) pressed?> then\n    change [y scroll v] by (-1)\nend\nif <key (right arrow v) pressed?> then\n    change [x scroll v] by (1)\nend\nif <key (left arrow v) pressed?> then\n    change [x scroll v] by (-1)\nend\nif <(x scroll) < [0]> then\n    set [x scroll v] to [0]\nend\nif <(y scroll) < [0]> then\n    set [y scroll v] to [0]\nend\nif <((y scroll) / (32)) > ((level height) - (12))> then\n    set [y scroll v] to (((level height) - (12)) * (32))\nend\nif <((x scroll) / (32)) > ((level width) - (16))> then\n    set [x scroll v] to (((level width) - (16)) * (32))\nend\n\ndelete all of [level v]\nset [level height v] to [125]\nset [level width v] to [200]\nrepeat (25000)\n    add [0] to [level v]\nend\n\nwhen I receive [tick v]\nrender\nif <not <(object) = [0]>> then\n    switch costume to (object)\n    show\n    go to x: (x) y: (y)\n    broadcast (say v)\n    think (message) for (.01) seconds\nend\nhide\nbroadcast (coins v)\n\nif <mouse down?> then\n    replace item (((([floor v] of ((((mouse x) + (x scroll)) + (272)) / (32)) ) * (level height)) + ([floor v] of ((((mouse y) + (y scroll)) + (156)) / (32)) )) + (1)) of [level v] with (tile type)\nend\n\nwhen [space v] key pressed\n\nif <key (space v) pressed?> then\n    ask [] and wait\n    set [tile type v] to (answer)\nend\nif <((y scroll) / (32)) > ((level height) - (12))> then\n    set [y scroll v] to (((level height) - (12)) * (32))\nend\nif <((x scroll) / (32)) > ((level width) - (16))> then\n    set [x scroll v] to (((level width) - (16)) * (32))\nend\n\ndefine rest coins\ndelete all of [coins v]\nrepeat (999)\n    add [0] to [coins v]\nend\n\nwhen flag clicked\nrest coins\n\nwhen I receive [say v]\n\nwhen I receive [tick v]\nchange y by (() - ())\n\nwhen I receive [remder v]\nrender\n\nset [wall jumps v] to [1]\n\ndefine map\n\ngo to x: (0) y: (0)\nset [render.x v] to [0]\nrepeat (200)\n    set y to (0)\n    change x by (1)\n    repeat (125)\n        change [render.x v] by (1)\n        change y by (1)\n        set pen color to (#cecece)\n        if <(item (render.x) of [level v]) < [48]> then\n            set pen color to (#76ce85)\n        end\n        if <(letter (1) of (item (render.x) of [level v])) = [c]> then\n            set pen color to (#bba965)\n        end\n        if <not <(item (render.x) of [level v]) = [0]>> then\n            pen up\n            pen down\n            pen up\n        end\n    end\nend\n\nwhen flag clicked\n\nforever\nend\n\nset [stuff v] to (item (((([floor v] of ((((mouse x) + (x scroll)) + (272)) / (32)) ) * (level height)) + ([floor v] of ((((mouse y) + (y scroll)) + (156)) / (32)) )) + (1)) of [level v])\nif <(x scroll) < [0]> then\n    set [x scroll v] to [0]\nend\n\nsay [you need 200 coins]\n\nrest coins\nset [stuff v] to [0]\nset [coins v] to [0]\nrepeat (length of [level v])\n    change [stuff v] by (1)\n    if <(letter (1) of (item (stuff) of [level v])) = [c]> then\n        if <(item (join (join (letter (2) of (item (stuff) of [level v])) (letter (3) of (item (stuff) of [level v]))) (join (letter (4) of (item (stuff) of [level v])) (letter (5) of (item (stuff) of [level v])))) of [coins v]) = [0]> then\n            change [coins v] by (1)\n            replace item (join (join (letter (2) of (item (stuff) of [level v])) (letter (3) of (item (stuff) of [level v]))) (join (letter (4) of (item (stuff) of [level v])) (letter (5) of (item (stuff) of [level v])))) of [coins v] with [1]\n        end\n    end\nend\n\n@player\n\nif <(water) = [0]> then\n    broadcast (go to save v) and wait\nend\nif <(y vel) < [0]> then\n\ndefine find tile\nset [total x pos v] to ((x position) + (x scroll))\nset [total y pos v] to ((y position) + (y scroll))\nset [tile v] to ((([floor v] of (((total x pos) + (272)) / (32)) ) * (level height)) + ([floor v] of (((total y pos) + (180)) / (32)) ))\n\ndefine scroll\nx scroll\nchange [x scroll v] by ((x position) / (20))\nchange x by ((x position) / (-20))\nchange [y scroll v] by ((((y vel) * (2)) - (y position)) / (-20))\nchange y by ((((y vel) * (2)) - (y position)) / (20))\nif <(x scroll) < [0]> then\n    change x by (x scroll)\n    set [x scroll v] to [0]\nend\nif <(y scroll) < [32]> then\n    change y by ((y scroll) - (32))\n    set [y scroll v] to [32]\nend\nif <((y scroll) / (32)) > ((level height) - (12))> then\n    change y by ((y scroll) - (((level height) - (12)) * (32)))\n    set [y scroll v] to (((level height) - (12)) * (32))\nend\nif <((x scroll) / (32)) > ((level width) - (16))> then\n    change x by ((x scroll) - (((level width) - (16)) * (32)))\n    set [x scroll v] to (((level width) - (16)) * (32))\nend\n\ndefine x scroll\nif <(x scroll) < [0]> then\n    change x by (x scroll)\n    set [x scroll v] to [0]\nend\nif <((x scroll) / (32)) > ((level width) - (16))> then\n    change x by ((x scroll) - (((level width) - (16)) * (32)))\n    set [x scroll v] to (((level width) - (16)) * (32))\nend\n\ndefine down\nset [ground v] to [0]\nif <(total y pos) < ((round ((total y pos) / (32))) * (32))> then\n    if <not <[not solid v] contains (item ((tile) - (1)) of [level v])?>> then\n        if <not <(letter (1) of (item ((tile) - (1)) of [level v])) = [c]>> then\n            change y by (((round ((total y pos) / (32))) * (32)) - (total y pos))\n            change y by (-4)\n            set [touching ground v] to [0]\n            set [y vel v] to [-.1]\n            set [ground v] to [1]\n        end\n    else\n        if <not <[not solid v] contains (item (((tile) - (1)) + (level height)) of [level v])?>> then\n            if <(total x pos) > (((round ((total x pos) / (32))) * (32)) + (4))> then\n                if <not <(letter (1) of (item (((tile) - (1)) + (level height)) of [level v])) = [c]>> then\n                    change y by (((round ((total y pos) / (32))) * (32)) - (total y pos))\n                    change y by (-4)\n                    set [touching ground v] to [0]\n                    set [y vel v] to [-.1]\n                    set [ground v] to [1]\n                end\n            end\n        end\n        if <not <[not solid v] contains (item (((tile) - (1)) - (level height)) of [level v])?>> then\n            if <((round ((total x pos) / (32))) * (32)) > ((total x pos) + (4))> then\n                if <not <(letter (1) of (item (((tile) - (1)) - (level height)) of [level v])) = [c]>> then\n                    change y by (((round ((total y pos) / (32))) * (32)) - (total y pos))\n                    change y by (-4)\n                    set [touching ground v] to [0]\n                    set [y vel v] to [-.1]\n                    set [ground v] to [1]\n                end\n            end\n        end\n    end\nend\nif <not <<[not solid v] contains (item (tile) of [level v])?> or <(letter (1) of (item (tile) of [level v])) = [c]>>> then\n    change y by (32)\nend\nif <(ground) = [0]> then\n    if <(touching ground) = [0]> then\n        set [touching ground v] to [1]\n    end\nend\n\ndefine up\nfind ceiling\nif <not <[not solid v] contains (item (tile) of [level v])?>> then\n    if <not <(letter (1) of (item (tile) of [level v])) = [c]>> then\n        change y by (((round ((total y pos) / (32))) * (32)) - (total y pos))\n        change y by (-4)\n        set [y vel v] to [0]\n    end\nelse\n    if <not <[not solid v] contains (item ((tile) + (level height)) of [level v])?>> then\n        if <(total x pos) > (((round ((total x pos) / (32))) * (32)) + (4))> then\n            if <not <(letter (1) of (item ((tile) + (level height)) of [level v])) = [c]>> then\n                change y by (((round ((total y pos) / (32))) * (32)) - (total y pos))\n                change y by (-4)\n                set [y vel v] to [0]\n            end\n        end\n    end\n    if <not <[not solid v] contains (item ((tile) - (level height)) of [level v])?>> then\n        if <((round ((total x pos) / (32))) * (32)) > ((total x pos) + (4))> then\n            if <not <(letter (1) of (item ((tile) - (level height)) of [level v])) = [c]>> then\n                change y by (((round ((total y pos) / (32))) * (32)) - (total y pos))\n                change y by (-4)\n                set [y vel v] to [0]\n            end\n        end\n    end\nend\n\ndefine find ceiling\nset [tile v] to ((([floor v] of (((total x pos) + (272)) / (32)) ) * (level height)) + ([ceiling v] of (((total y pos) + (164)) / (32)) ))\n\ndefine right\nfind right\nif <not <[not solid v] contains (item (tile) of [level v])?>> then\n    if <not <(letter (1) of (item (tile) of [level v])) = [c]>> then\n        change x by (((round ((total x pos) / (32))) * (32)) - (total x pos))\n        set [x vel v] to [0]\n        if <<key (w v) pressed?> or <key (up arrow v) pressed?>> then\n            if <(y vel) < [-.1]> then\n                if <(wall jumps) = [1]> then\n                    find tile\n                    if <not <(item (tile) of [level v]) = [52]>> then\n                        set [touching ground v] to [0]\n                        set [x vel v] to [-4]\n                        set [y vel v] to [15]\n                    end\n                    find right\n                end\n            end\n        end\n    end\nelse\n    if <not <[not solid v] contains (item ((tile) - (1)) of [level v])?>> then\n        if <((total y pos) - (12)) > ((round ((total y pos) / (32))) * (32))> then\n            if <not <(letter (1) of (item ((tile) - (1)) of [level v])) = [c]>> then\n                change x by (((round ((total x pos) / (32))) * (32)) - (total x pos))\n                set [x vel v] to [0]\n                if <<key (w v) pressed?> or <key (up arrow v) pressed?>> then\n                    if <(y vel) < [-.1]> then\n                        if <(wall jumps) = [1]> then\n                            find tile\n                            if <not <(item (tile) of [level v]) = [52]>> then\n                                set [touching ground v] to [0]\n                                set [x vel v] to [-4]\n                                set [y vel v] to [15]\n                            end\n                            find right\n                        end\n                    end\n                end\n            end\n        end\n    end\n    if <not <[not solid v] contains (item ((tile) + (1)) of [level v])?>> then\n        if <((round ((total y pos) / (32))) * (32)) > ((total y pos) + (16))> then\n            if <not <(letter (1) of (item ((tile) + (1)) of [level v])) = [c]>> then\n                change x by (((round ((total x pos) / (32))) * (32)) - (total x pos))\n                set [x vel v] to [0]\n                if <<key (w v) pressed?> or <key (up arrow v) pressed?>> then\n                    if <(y vel) < [-.1]> then\n                        if <(wall jumps) = [1]> then\n                            find tile\n                            if <not <(item (tile) of [level v]) = [52]>> then\n                                set [touching ground v] to [0]\n                                set [x vel v] to [-4]\n                                set [y vel v] to [15]\n                            end\n                            find right\n                        end\n                    end\n                end\n            end\n        end\n    end\nend\n\ndefine find right\nfind tile\nset [tile v] to (((round (((total x pos) + (272)) / (32))) * (level height)) + ([ceiling v] of (((total y pos) + (148)) / (32)) ))\n\ndefine find left\nfind tile\nset [tile v] to (((round (((total x pos) + (240)) / (32))) * (level height)) + ([ceiling v] of (((total y pos) + (148)) / (32)) ))\n\ndefine left\nfind left\nif <not <[not solid v] contains (item (tile) of [level v])?>> then\n    if <not <(letter (1) of (item (tile) of [level v])) = [c]>> then\n        change x by (((round ((total x pos) / (32))) * (32)) - (total x pos))\n        set [x vel v] to [0]\n        if <<key (w v) pressed?> or <key (up arrow v) pressed?>> then\n            if <(y vel) < [-.1]> then\n                if <(wall jumps) = [1]> then\n                    find tile\n                    if <not <(item (tile) of [level v]) = [52]>> then\n                        set [touching ground v] to [0]\n                        set [x vel v] to [4]\n                        set [y vel v] to [15]\n                    end\n                    find left\n                end\n            end\n        end\n    end\nelse\n    if <not <[not solid v] contains (item ((tile) - (1)) of [level v])?>> then\n        if <((total y pos) - (12)) > ((round ((total y pos) / (32))) * (32))> then\n            if <not <(letter (1) of (item ((tile) - (1)) of [level v])) = [c]>> then\n                change x by (((round ((total x pos) / (32))) * (32)) - (total x pos))\n                set [x vel v] to [0]\n                if <<key (w v) pressed?> or <key (up arrow v) pressed?>> then\n                    if <(y vel) < [-.1]> then\n                        if <(wall jumps) = [1]> then\n                            find tile\n                            if <not <(item (tile) of [level v]) = [52]>> then\n                                set [touching ground v] to [0]\n                                set [x vel v] to [4]\n                                set [y vel v] to [15]\n                            end\n                            find left\n                        end\n                    end\n                end\n            end\n        end\n    end\n    if <not <[not solid v] contains (item ((tile) + (1)) of [level v])?>> then\n        if <((round ((total y pos) / (32))) * (32)) > ((total y pos) + (16))> then\n            if <not <(letter (1) of (item ((tile) + (1)) of [level v])) = [c]>> then\n                change x by (((round ((total x pos) / (32))) * (32)) - (total x pos))\n                set [x vel v] to [0]\n                if <<key (w v) pressed?> or <key (up arrow v) pressed?>> then\n                    if <(y vel) < [-.1]> then\n                        if <(wall jumps) = [1]> then\n                            find tile\n                            if <not <(item (tile) of [level v]) = [52]>> then\n                                set [touching ground v] to [0]\n                                set [x vel v] to [4]\n                                set [y vel v] to [15]\n                            end\n                            find left\n                        end\n                    end\n                end\n            end\n        end\n    end\nend\n\nwhen I receive [boss fight v]\nset [x scroll v] to [4030]\nset [y scroll v] to [0]\ngo to x: (0) y: (0)\n\nwhen I receive [go to save v]\ndeath\nset [x scroll v] to (save x)\nset [y scroll v] to (save y)\ngo to x: (0) y: (0)\n\ndefine death\nset [death x v] to (total x pos)\nset [death y v] to (total y pos)\nset [ghost v] effect to (0)\nrepeat (20)\n    go to x: (0) y: (0)\n    set [rand v] to (pick random (-7) to (7))\n    set [x scroll v] to ((death x) + (rand))\n    change x by (() - (rand))\n    set [rand v] to (pick random (-7) to (7))\n    set [y scroll v] to ((death y) + (rand))\n    change y by (() - (rand))\n    broadcast (remder v)\n    change [ghost v] effect by (5)\nend\nset [ghost v] effect to (0)\n\nchange [x scroll v] by (1)\nchange [y scroll v] by (pick random (-10) to (10))\n\nwhen I receive [win v]\nset [x scroll v] to (save x)\nset [y scroll v] to (save y)\ngo to x: (0) y: (0)\n\nset [jumps v] to [50]\n\nset [jumps v] to [60]\n\nif <(wall jumps) = [1]> then\n    if <[] = [50]> then\n        set [y vel v] to [20]\n        change [touching ground v] by (1)\n        set [w press v] to [1]\n    end\nend\n\nwhen I receive [start game v]\nshow\ndelete all of [not solid v]\nadd [0] to [not solid v]\nadd [49] to [not solid v]\nadd [0] to [not solid v]\nadd [51] to [not solid v]\nadd [0] to [not solid v]\nadd [52] to [not solid v]\nadd [53] to [not solid v]\nadd [54] to [not solid v]\nadd [55] to [not solid v]\nadd [56] to [not solid v]\nadd [57] to [not solid v]\nadd [58] to [not solid v]\nadd [59] to [not solid v]\nadd [0] to [not solid v]\nadd [0] to [not solid v]\nadd [64] to [not solid v]\nset [wall jumps v] to [0]\nset [red v] to [1]\nset [blue v] to [1]\nset [save block v] to [0]\nset [x scroll v] to [3900]\nset [y scroll v] to [1600]\nset [save x v] to (x scroll)\nset [save y v] to (y scroll)\nset [jumps v] to [1]\nset [coins collected v] to [0]\nset [water v] to [0]\ngo to x: (0) y: (0)\nforever\n    if <(item (tile) of [level v]) = [53]> then\n        broadcast (go to save v) and wait\n    end\n    if <(item (tile) of [level v]) = [59]> then\n        if <((([floor v] of ((tick) / (3)) ) - (9)) mod (16)) = [6]> then\n            go to x: (0) y: (0)\n            set [x scroll v] to (save x)\n            set [y scroll v] to (save y)\n        end\n    end\n    if <<key (d v) pressed?> or <key (right arrow v) pressed?>> then\n        change [x vel v] by (.5)\n    end\n    if <<key (a v) pressed?> or <key (left arrow v) pressed?>> then\n        change [x vel v] by (-.5)\n    end\n    set [x vel v] to ((x vel) * (.93))\n    change x by ((x vel) / (2))\n    scroll\n    right\n    left\n    change x by ((x vel) / (2))\n    scroll\n    right\n    left\n    change [y vel v] by (-.9)\n    find tile\n    if <(item (tile) of [level v]) = [52]> then\n        set [y vel v] to ((y vel) * (.8))\n    else\n        set [y vel v] to ((y vel) * (.93))\n    end\n    change y by ((y vel) / (2))\n    find tile\n    down\n    up\n    change y by ((y vel) / (2))\n    scroll\n    find tile\n    down\n    up\n    find tile\n    if <(item (tile) of [level v]) = [52]> then\n        set [touching ground v] to [0]\n    end\n    if <<key (w v) pressed?> or <key (up arrow v) pressed?>> then\n        if <(touching ground) < (jumps)> then\n            if <(y vel) < [0]> then\n                if <(w press) = [0]> then\n                    set [y vel v] to [20]\n                    change [touching ground v] by (1)\n                    set [w press v] to [1]\n                end\n            end\n        end\n    end\n    if <not <<key (w v) pressed?> or <key (up arrow v) pressed?>>> then\n        set [w press v] to [0]\n    end\n    if <(item (tile) of [level v]) = [49]> then\n        replace item (3) of [not solid v] with [48]\n        set [red v] to [2]\n    end\n    if <(item (tile) of [level v]) = [51]> then\n        replace item (5) of [not solid v] with [50]\n        set [blue v] to [2]\n    end\n    if <(item (tile) of [level v]) = [54]> then\n        set [save x v] to (total x pos)\n        set [save y v] to (total y pos)\n        set [save block v] to (tile)\n    end\n    if <(item (tile) of [level v]) = [55]> then\n        if <(jumps) = [1]> then\n            set [jumps v] to [2]\n        end\n    end\n    if <(item (tile) of [level v]) = [56]> then\n        set [wall jumps v] to [1]\n    end\n    if <(item (tile) of [level v]) = [57]> then\n        set [jumps v] to [3]\n    end\n    if <(letter (1) of (item (tile) of [level v])) = [c]> then\n        if <[0] = (item (join (join (letter (2) of (item (tile) of [level v])) (letter (3) of (item (tile) of [level v]))) (join (letter (4) of (item (tile) of [level v])) (letter (5) of (item (tile) of [level v])))) of [coins v])> then\n            change [coins collected v] by (1)\n            replace item (join (join (letter (2) of (item (tile) of [level v])) (letter (3) of (item (tile) of [level v]))) (join (letter (4) of (item (tile) of [level v])) (letter (5) of (item (tile) of [level v])))) of [coins v] with [1]\n            broadcast (coin v)\n        end\n    end\n    if <(coins collected) > [9]> then\n        replace item (14) of [not solid v] with [63]\n    end\n    if <(coins collected) > [59]> then\n        replace item (15) of [not solid v] with [65]\n    end\n    find tile\n    scroll\n    broadcast (tick v)\nend\n\nwhen flag clicked\nhide\n\n@frame\n\nwhen flag clicked\ngo to x: (0) y: (0)\nhide\n\nwhen I receive [start game v]\nshow\n\n@pixel platformer thumbnail\n\nwhen flag clicked\nset [ghost v] effect to (100)\n\n@text engine\n\ndefine write text (x) (y) (text)\nshow\nset size to (100) %\nset [write text.i v] to [0]\ngo to x: (x) y: (y)\nrepeat (length of (text))\n    change [write text.i v] by (1)\n    switch costume to (letter (write text.i) of (text))\n    stamp\n    change x by (10)\nend\nhide\n\nwhen I receive [coins v]\nwrite text (-200) (140) (join [coins: ] (join (coins collected) [ /301]))\n\nwrite text (-200) (120) [like favorite and follow]\n\n@intro\n\nwhen flag clicked\nswitch backdrop to (backdrop2 v)\nshow\nset volume to (100) %\ngo to x: (0) y: (0)\nstart sound [rolemu_-_neogauge v]\nswitch costume to (logo v)\nerase all\nset size to (800) %\nwait (1.4) seconds\nrepeat (28)\n    change x by (5)\n    change y by ((40) / (28))\n    set size to (((600) / ((x position) / (2))) + (140)) %\nend\nstamp\nset size to (200) %\nswitch costume to (name v)\ngo to x: (-300) y: (40)\nglide (.5) secs to x: (-20) y: (40)\nstamp\nhide\ngo to x: (10) y: (-200)\nwait (1.1) seconds\nswitch costume to (games v)\nshow\nglide (.5) secs to x: (-20) y: (-10)\nstamp\nwait (2) seconds\nswitch backdrop to (backdrop1 v)\nerase all\nhide\nbroadcast (start game v)\n\nbroadcast (start game v)\n\n