The Adventures of Squbla (a platformer) V1.0

Instructions: =========================================\n                                    =Controls=\nUse arrow keys to move around, don't fall off the platforms, each flag is a checkpoint. This is the first scrolling platformer that I have released. You play as Squbla (my brother came up with that name) you are trying to get the checkpoints. Fullscreen recommended.\nCAN WE GET THIS TOP LOVED!\n \nFuture updates:\n-enemies\n-water\n-maybe another world\n-coins\n-more levels\n-maybe more character animation\n\ncredit to @Griffpatch for scrolling platformer tutorial.\ncredit to Unity Asset store for platformer tiles/character \n

@Stage\n\n@Engine\n\ndefine None\nset [lim v] to [1]\nrepeat until <<(lim) > (limit)> or <(touch) < [100]>>\n    change [@player x v] by (dx)\n    change [@player y v] by (dy)\n    change [lim v] by (1)\n    Check Collide\nend\nif <(lim) > (limit)> then\n    change [@player x v] by ((0) - ((dx) * (limit)))\n    change [@player y v] by ((0) - ((dy) * (limit)))\n    if <(@Player SX) = [0]> then\n        set [@player die v] to [1]\n    else\n        Check Collide\n        if <(@Player SX) > [0]> then\n            Move Out Of Collision dir x,y: (-1) (0) limit: (999)\n        else\n            Move Out Of Collision dir x,y: (1) (0) limit: (999)\n        end\n        set [@player sx v] to [0]\n    end\nend\n\ndefine Check Collide\ngo to x: (round ((@Player X) - (@Scroll X))) y: (round ((@Player Y) - (@Scroll Y)))\nif <touching (level v)?> then\n    set [touch v] to [101]\nelse\n    if <touching (moving platform ahead v)?> then\n        set [touch v] to [102]\n    else\n        set [touch v] to [0]\n    end\nend\n\nset [@player x v] to [3200]\nset [@scroll x v] to (@Player X)\n\ndefine Scroll Level\nchange [@scroll x v] by (round (((@Player X) - (@Scroll X)) * (0.1)))\nif <(@Scroll X) < [0]> then\n    set [@scroll x v] to [0]\nend\nchange [@scroll y v] by (round (((@Player Y) - (@Scroll Y)) * (0.1)))\nif <(@Scroll Y) < [0]> then\n    set [@scroll y v] to [0]\nend\n\ndefine Player Tick\nset [pushed sx v] to [0]\nif <(on platform) = []> then\n    Check Collide\n    if <(touch) = [102]> then\n        set [pushed sx v] to ((@Platform SX) - (@Player SX))\n        change [@player x v] by (@Platform SX)\n        set [@player sx v] to [0]\n        Check Collide\n        if <<(touch) > [100]> and <not <(touch) = [102]>>> then\n            Move Out Of Collision dir x,y: (0) (1) limit: (([abs v] of (@Platform SX) ) + (2))\n            if <(@Player Die) > [0]> then\n                stop [this script v]\n            end\n            set [@player sy v] to [0]\n            set [@falling v] to [0]\n        end\n    end\nend\nif <<key (up arrow v) pressed?> and <(@Falling) < [3]>> then\n    set [@falling v] to [3]\n    set [@player sy v] to [14]\nend\nif <(@Player SY) > [-16]> then\n    change [@player sy v] by (-1.2)\nend\nchange [@player y v] by (@Player SY)\nif <not <(on platform) = []>> then\n    change [@player y v] by (-5)\n    Check Collide\n    if <not <(touch) = [102]>> then\n        change [@player y v] by (5)\n    end\nend\nset [on platform v] to [0]\nCheck Collide\nif <(touch) = [102]> then\n    set [on platform v] to (@Platform SX)\nelse\n    set [on platform v] to []\nend\nif <(touch) > [100]> then\n    if <(@Player SY) > [0]> then\n        Move Out Of Collision dir x,y: (0) (-1) limit: (999)\n        set [@falling v] to [3]\n        set [@player sy v] to [0]\n    else\n        Move Out Of Collision dir x,y: (0) (1) limit: (999)\n        set [@player sy v] to ((@Player SY) / (2))\n        set [@falling v] to [0]\n    end\nelse\n    change [@falling v] by (1)\nend\nif <key (left arrow v) pressed?> then\n    set [@player dir v] to [-90]\n    change [@player sx v] by ((((-7) + (on platform)) - (@Player SX)) * (0.2))\n    change [@walking v] by (1)\nelse\n    if <key (right arrow v) pressed?> then\n        set [@player dir v] to [90]\n        change [@player sx v] by ((((7) + (on platform)) - (@Player SX)) * (0.2))\n        change [@walking v] by (1)\n    else\n        set [@walking v] to [-1]\n        if <([abs v] of ((@Player SX) - (on platform)) ) > [1]> then\n            change [@player sx v] by (((on platform) - (@Player SX)) * (0.35))\n        else\n            set [@player sx v] to (on platform)\n        end\n    end\nend\nchange [@player x v] by (@Player SX)\nCheck Collide\nif <(touch) > [100]> then\n    Move Out Of Collision dir x,y: (0) (1) limit: (round ((([abs v] of (@Player SX) ) * (2)) + (2)))\n    if <(lim) > [2]> then\n        set [@player sx v] to ((@Player SX) * (0.6))\n    end\nend\nif <not <(pushed sx) = [0]>> then\n    change [@player sx v] by (pushed sx)\nend\n\ndefine Reset Player\nset [@player x v] to (@Spawn X)\nset [@player y v] to (@Spawn Y)\nset [@scroll x v] to (@Player X)\nset [@scroll y v] to (@Player Y)\nset [@player sx v] to [0]\nset [@player sy v] to [0]\nset [@falling v] to [0]\nset [@walking v] to [-1]\nset [@player die v] to [0]\nScroll Level\n\nwhen flag clicked\nset [ghost v] effect to (100)\nset [@level v] to [1]\nset [@totalflags v] to [0]\nset [@timer v] to [0]\nset [@player dir v] to [90]\nset [@spawn x v] to [-180]\nset [@spawn y v] to [32]\nReset Player\nbroadcast (setup level v) and wait\nbroadcast (game loop tick v) and wait\nforever\n    change [@timer v] by (1)\n    if <(@Player Die) = [0]> then\n        Player Tick\n        if <(@Player Y) < [-200]> then\n            set [@player die v] to [25]\n        end\n    else\n        change [@player die v] by (1)\n        if <(@Player Die) > [60]> then\n            Reset Player\n        end\n    end\n    Scroll Level\n    broadcast (game loop tick v) and wait\nend\n\n@Player\n\ndefine Set Costume (costume#)\nif <not <(costume#) = (costume [number v])>> then\n    switch costume to (costume#)\nend\n\nwhen I receive [setup level v]\nset size to (100) %\nshow\ngo to [front v] layer\ngo [backward v] (6) layers\nset rotation style [left-right v]\n\nwhen I receive [game loop tick v]\ngo to x: (round ((@Player X) - (@Scroll X))) y: (round ((@Player Y) - (@Scroll Y)))\nif <(@Player Die) = [0]> then\n    if <(last Die) > [0]> then\n        set size to (20) %\n        set [ghost v] effect to (0)\n    end\n    if <(@Falling) > [2]> then\n        if <(@Player SY) > [0]> then\n            Set Costume (2)\n        else\n            if <(@Player SY) > [-2]> then\n                Set Costume (4)\n            else\n                Set Costume (3)\n            end\n        end\n    else\n        if <(@walking) < [0]> then\n            Set Costume (1)\n        else\n            if <((@walking) mod (9)) < [3]> then\n                Set Costume (6)\n            else\n                if <((@walking) mod (9)) < [6]> then\n                    Set Costume (4)\n                else\n                    Set Costume (6)\n                end\n            end\n        end\n    end\n    if <not <(@Player Dir) = (direction)>> then\n        point in direction (@Player Dir)\n    end\nelse\n    if <(@Player Die) < [25]> then\n        set size to ((size) + (10)) %\n        change [ghost v] effect by (4)\n        change [@player y v] by (-1)\n    else\n        change [ghost v] effect by (100)\n    end\n    set [last die v] to [1]\nend\n\n@Level\n\nwhen I receive [setup level v]\nswitch costume to (l1 x0 y0 v)\nsetup clone at x,y: (0) (0)\nswitch costume to (l1 x1 y0 v)\nsetup clone at x,y: (1) (0)\nswitch costume to (l1 x1b y0 v)\nsetup clone at x,y: (2) (0)\nswitch costume to (l1 x2 y0 v)\nsetup clone at x,y: (3) (0)\nswitch costume to (l1 x3 y0 v)\nsetup clone at x,y: (3.7) (0.5)\nswitch costume to (l1 x4 y0 v)\nsetup clone at x,y: (4.9) (0.5)\nswitch costume to (l1 x5 y0 v)\nsetup clone at x,y: (5.6) (0)\nswitch costume to (l1 x6 y0 v)\nsetup clone at x,y: (6.6) (0)\nswitch costume to (l1 x6 y0 v)\nsetup clone at x,y: (7.7) (0)\nset [showing v] to [-1]\n\nwhen I receive [game loop tick v]\nif <(showing) > [-1]> then\n    position (round ((x) - (@Scroll X))) (round ((y) - (@Scroll Y)))\nend\n\ndefine position (x) (y)\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    if <(showing) = [0]> then\n        set [showing v] to [1]\n        show\n    end\nelse\n    if <(showing) = [1]> then\n        set [showing v] to [0]\n        hide\n    end\nend\n\ndefine setup clone at x,y: (x) (y)\ngo to x: (0) y: (0)\nhide\nset [showing v] to [0]\nset [x v] to (round ((x) * (460)))\nset [y v] to (round ((y) * (340)))\ncreate clone of (_myself_ v)\n\n@moving platform\n\nwhen I receive [setup level v]\nswitch costume to (l1 x2 y0 lift v)\nsetup clone at x,y: (2) (-0.5)\nswitch costume to (barrier v)\nsetup clone at x,y: (7.9) (-0.45)\nset [showing v] to [-1]\n\ndefine None\nset [x v] to (x)\nset [y v] to (y)\n\ndefine None\ngo to x: (0) y: (0)\nhide\nset [ox v] to (round ((x) * (460)))\nset [oy v] to (round ((y) * (340)))\nset [showing v] to [0]\nmoving platform? (@timer)\ncreate clone of (_myself_ v)\n\ndefine None\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    if <(showing) = [0]> then\n        set [showing v] to [1]\n        show\n    end\nelse\n    if <(showing) = [1]> then\n        set [showing v] to [0]\n        hide\n    end\nend\n\nwhen I receive [game loop tick v]\nif <(showing) > [-1]> then\n    moving platform? (@timer)\n    position (round ((x) - (@Scroll X))) (round ((y) - (@Scroll Y)))\nend\n\ndefine None\nif <(costume [number v]) = [1]> then\n    move to (round ((ox) + ((140) * ([cos v] of ((timer) * (1.4)) )))) (round ((oy) + ((70) * ([sin v] of ((timer) * (2.8)) ))))\nelse\n    if <(costume [number v]) = [2]> then\n        barrier (((timer) / (100)) mod (1)) run length (-700)\n    else\n    end\nend\n\ndefine None\nif <(percent) < [0.15]> then\n    move to (round ((ox) + ((percent) * (len)))) (round ((oy) - (((0.15) - (percent)) * (800))))\nelse\n    if <(percent) > [0.85]> then\n        move to (round ((ox) + ((percent) * (len)))) (round ((oy) - (((percent) - (0.85)) * (800))))\n    else\n        move to (round ((ox) + ((percent) * (len)))) (round (oy))\n    end\nend\nset [ox v] to (round ((7.9) * (460)))\n\n@moving platform ahead\n\nwhen I receive [setup level v]\nswitch costume to (l1 x2 y0 lift v)\nsetup clone at x,y: (2) (-0.5) width (97)\nswitch costume to (barrier v)\nsetup clone at x,y: (7.9) (-0.45) width (48)\nset [showing v] to [-1]\n\ndefine None\nif <(costume [number v]) = [1]> then\n    move to (round ((ox) + ((140) * ([cos v] of ((timer) * (1.4)) )))) (round ((oy) + ((70) * ([sin v] of ((timer) * (2.8)) ))))\nelse\n    if <(costume [number v]) = [2]> then\n        barrier (((timer) / (100)) mod (1)) run length (-700)\n    else\n    end\nend\n\ndefine None\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    if <(showing) = [0]> then\n        set [showing v] to [1]\n        show\n    end\nelse\n    if <(showing) = [1]> then\n        set [showing v] to [0]\n        hide\n    end\nend\n\nwhen I start as a clone\nset [ghost v] effect to (100)\n\ndefine None\nif <([abs v] of ((@Player X) - (x)) ) < (width)> then\n    set [@platform sx v] to ((x) - (x))\nend\nset [x v] to (x)\nset [y v] to (y)\n\ndefine None\ngo to x: (0) y: (0)\nhide\nset [ox v] to (round ((x) * (460)))\nset [oy v] to (round ((y) * (340)))\nset [width v] to (((width) / (2)) + (16))\nset [showing v] to [0]\nmoving platform? (@timer)\ncreate clone of (_myself_ v)\n\ndefine None\nif <(percent) < [0.15]> then\n    move to (round ((ox) + ((percent) * (len)))) (round ((oy) - (((0.15) - (percent)) * (800))))\nelse\n    if <(percent) > [0.85]> then\n        move to (round ((ox) + ((percent) * (len)))) (round ((oy) - (((percent) - (0.85)) * (800))))\n    else\n        move to (round ((ox) + ((percent) * (len)))) (round (oy))\n    end\nend\nset [ox v] to (round ((7.9) * (460)))\n\nwhen I receive [game loop tick v]\nif <(showing) > [-1]> then\n    moving platform? ((@timer) + (1))\n    position (round ((x) - (@Scroll X))) (round ((y) - (@Scroll Y)))\nend\n\n@background\n\nwhen I receive [setup level v]\ngo [backward v] (1000) layers\nset [x v] to [0]\nshow\ncreate clone of (_myself_ v)\nset [x v] to [470]\n\nwhen I receive [game loop tick v]\nif <(showing) > [-1]> then\n    position (round ((x) - (((@Scroll X) * (0.5)) mod (470)))) ((0) - (((@Scroll Y) * (0.5)) mod (480)))\nend\n\ndefine None\ngo to x: (x) y: (y)\n\n@Edge Fade\n\nwhen I receive [setup level v]\ngo to x: (0) y: (0)\nshow\ngo to [front v] layer\ngo [backward v] (5) layers\n\n@Check Points\n\ndefine None\ngo to x: (0) y: (0)\nhide\nset [showing v] to [0]\nset [x v] to (x)\nset [y v] to (y)\nchange [@totalflags v] by (1)\ncreate clone of (_myself_ v)\n\nwhen I receive [game loop tick v]\nif <(showing) > [-1]> then\n    position (round ((x) - (@Scroll X))) (round ((y) - (@Scroll Y)))\n    if <(showing) > [25]> then\n        delete this clone\n    end\nend\n\nwhen I receive [setup level v]\nswitch costume to (l1 x0 y0 v)\nsetup clone at x,y: (457) (-54)\nsetup clone at x,y: (1198) (63)\nsetup clone at x,y: (2483) (62)\nsetup clone at x,y: (3705) (-54)\nset [showing v] to [-1]\n\ndefine on screen\nif <((@timer) mod (5)) = [0]> then\n    next costume\nend\nif <touching (engine v)?> then\n    set [showing v] to [2]\n    set [@spawn x v] to (x)\n    set [@spawn y v] to (y)\n    change [@totalflags v] by (-1)\nend\n\ndefine None\ngo to x: (x) y: (y)\nif <(showing) < [2]> then\n    if <<(x) = (x position)> and <(y) = (y position)>> then\n        if <(showing) = [0]> then\n            set [showing v] to [1]\n            show\n        end\n        on screen\n    else\n        if <(showing) = [1]> then\n            set [showing v] to [0]\n            hide\n        end\n    end\nelse\n    set size to ((size) + (15)) %\n    change [ghost v] effect by (4)\n    change [y v] by (5)\n    change [showing v] by (1)\nend\n\n@Tiles\n\nwhen flag clicked\nhide\n\n@Level2\n\nwhen I receive [setup level v]\nswitch costume to (l1 x0 y0 v)\nsetup clone at x,y: (0) (0)\nswitch costume to (l1 x1 y0 v)\nsetup clone at x,y: (1) (0)\nswitch costume to (l1 x1b y0 v)\nsetup clone at x,y: (2) (0)\nswitch costume to (l1 x2 y0 v)\nsetup clone at x,y: (3) (0)\nswitch costume to (l1 x3 y0 v)\nsetup clone at x,y: (3.7) (0.5)\nswitch costume to (l1 x4 y0 v)\nsetup clone at x,y: (4.9) (0.5)\nswitch costume to (l1 x5 y0 v)\nsetup clone at x,y: (5.6) (0)\nswitch costume to (l1 x6 y0 v)\nsetup clone at x,y: (6.6) (0)\nswitch costume to (l1 x6 y0 v)\nsetup clone at x,y: (7.7) (0)\nset [showing v] to [-1]\n\ndefine setup clone at x,y: (x) (y)\ngo to x: (0) y: (0)\nhide\nset [showing v] to [0]\nset [x v] to (round ((x) * (460)))\nset [y v] to (round ((y) * (340)))\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    if <(showing) = [0]> then\n        set [showing v] to [1]\n        show\n    end\nelse\n    if <(showing) = [1]> then\n        set [showing v] to [0]\n        hide\n    end\nend\n\nwhen I receive [game loop tick v]\nif <(showing) > [-1]> then\n    position (round ((x) - (@Scroll X))) (round ((y) - (@Scroll Y)))\nend\n\n@Sprite1\n\nwhen flag clicked\nshow\nset [ghost v] effect to (0)\ngo to x: (0) y: (0)\ngo to [front v] layer\nwait (1) seconds\nrepeat (10)\n    change [ghost v] effect by (10)\nend\nhide\n\n@Check Points2\n\ndefine None\ngo to x: (0) y: (0)\nhide\nset [showing v] to [0]\nset [x v] to (x)\nset [y v] to (y)\nchange [@totalflags v] by (1)\ncreate clone of (_myself_ v)\n\nwhen I receive [game loop tick v]\nif <(showing) > [-1]> then\n    position (round ((x) - (@Scroll X))) (round ((y) - (@Scroll Y)))\n    if <(showing) > [25]> then\n        delete this clone\n    end\nend\n\nwhen I receive [setup level v]\ngo to [front v] layer\ngo [backward v] (6) layers\nswitch costume to (l1 x0 y0 v)\nsetup clone at x,y: (242) (-90)\nsetup clone at x,y: (920) (63)\nsetup clone at x,y: (2000) (250)\nsetup clone at x,y: (2930) (-54)\nsetup clone at x,y: (3195) (-54)\nsetup clone at x,y: (3440) (-54)\nset [showing v] to [-1]\n\ndefine on screen\nif <((@timer) mod (3)) = [0]> then\n    next costume\nend\nif <touching (engine v)?> then\n    set [showing v] to [2]\n    change [@totalflags v] by (-1)\n    set [+10 v] to [1]\nend\n\ndefine None\nset size to (10) %\nshow\ngo to x: (x) y: (y)\nif <(showing) < [2]> then\n    if <<(x) = (x position)> and <(y) = (y position)>> then\n        if <(showing) = [0]> then\n            set [showing v] to [1]\n            show\n        end\n        on screen\n    else\n        if <(showing) = [1]> then\n            set [showing v] to [0]\n            hide\n        end\n    end\nelse\n    set size to ((size) + (15)) %\n    change [ghost v] effect by (4)\n    change [y v] by (5)\n    change [showing v] by (1)\nend\n\n@Sprite2\n\nwhen flag clicked\nset [+10 v] to [0]\nhide\nforever\n    if <(+10) = [1]> then\n        show\n        go to (([y position v] of [engine v]) + (50))\n        repeat (5)\n            set size to ((size) + (15)) %\n            change [ghost v] effect by (4)\n            change y by (1)\n        end\n        set [+10 v] to [0]\n    else\n        hide\n        set size to (100) %\n        set [ghost v] effect to (0)\n    end\nend\n\n@death\n\ndefine None\ngo to x: (0) y: (0)\nhide\nset [showing v] to [0]\nset [x v] to (x)\nset [y v] to (y)\nchange [@totalflags v] by (1)\ncreate clone of (_myself_ v)\n\nwhen I receive [game loop tick v]\nif <(showing) > [-1]> then\n    position (round ((x) - (@Scroll X))) (round ((y) - (@Scroll Y)))\n    if <(showing) > [25]> then\n        delete this clone\n    end\nend\n\nwhen I receive [setup level v]\nhide\n\ndefine on screen\nif <touching (engine v)?> then\n    set [showing v] to [2]\n    change [@totalflags v] by (-1)\n    set [+10 v] to [1]\nend\n\ndefine None\nset size to (10) %\nshow\ngo to x: (x) y: (y)\nif <(showing) < [2]> then\n    if <<(x) = (x position)> and <(y) = (y position)>> then\n        if <(showing) = [0]> then\n            set [showing v] to [1]\n            show\n        end\n        on screen\n    else\n        if <(showing) = [1]> then\n            set [showing v] to [0]\n            hide\n        end\n    end\nelse\n    set size to ((size) + (15)) %\n    change [ghost v] effect by (4)\n    change [y v] by (5)\n    change [showing v] by (1)\nend\n\nswitch costume to (spike_up v)\nsetup clone at x,y: (442) (-75)\nsetup clone at x,y: (920) (63)\nsetup clone at x,y: (2000) (250)\nsetup clone at x,y: (2930) (-54)\nsetup clone at x,y: (3195) (-54)\nsetup clone at x,y: (3440) (-54)\nset [showing v] to [-1]\n\n