Cube adventure // a platformer game
@Stage\n\n@level\n\nwhen flag clicked\nshow\ngo to x: (-2) y: (6)\nswitch costume to (costume1 v)\n\nwhen I receive [end v]\nnext costume\n\n@player\n\ndefine Platformer Physics (speed) (friction) (jump height)\nchange [y vel v] by (-1)\nif <<key (right arrow v) pressed?> or <key (d v) pressed?>> then\n    change [x vel v] by (speed)\n    switch costume to (costume1 v)\nend\nif <<key (left arrow v) pressed?> or <key (a v) pressed?>> then\n    change [x vel v] by ((speed) * (-1))\n    switch costume to (costume2 v)\nend\nset [x vel v] to ((X vel) * (friction))\nchange x by (X vel)\nset [slope v] to [0]\nif <touching (level v)?> then\n    repeat until <<not <touching (level v)?>> or <(slope) = [-8]>>\n        change [slope v] by (-1)\n        change y by (1)\n    end\nend\nif <touching (level v)?> then\n    change y by (slope)\n    repeat until <not <touching (level v)?>>\n        change x by ((([abs v] of (X vel) ) / (X vel)) * (-1))\n    end\n    if <<key (up arrow v) pressed?> or <key (w v) pressed?>> then\n        if <(X vel) > [0]> then\n            set [x vel v] to [-12]\n        else\n            set [x vel v] to [12]\n        end\n        set [y vel v] to [12]\n    else\n        set [x vel v] to [0]\n    end\nend\nchange y by (Y vel)\nif <touching (level v)?> then\n    repeat until <not <touching (level v)?>>\n        change y by ((([abs v] of (Y vel) ) / (Y vel)) * (-1))\n    end\n    set [y vel v] to [0]\nend\nchange y by (-1)\nif <<<key (up arrow v) pressed?> or <key (w v) pressed?>> and <touching (level v)?>> then\n    set [y vel v] to (jump height)\nend\nchange y by (1)\n\nwhen flag clicked\n\nwhen I receive [end v]\ngo to x: (-198) y: (-10)\n\nwhen flag clicked\nset [level v] to [1]\nforever\n    play sound [Inferno v] until done\nend\n\nwhen I receive [hurt v]\ngo to x: (-198) y: (-10)\n\nwhen flag clicked\nshow\ngo to [front v] layer\nset [level v] to [1]\nset [x vel v] to [0]\nset [y vel v] to [0]\nswitch costume to (costume1 v)\ngo to x: (-198) y: (-10)\npoint in direction (90)\nforever\n    Platformer Physics [1] [0.9] [13]\n    if <touching (danger v)?> then\n        broadcast (hurt v)\n        broadcast (danger v)\n    end\n    if <touching (trampoline v)?> then\n        start sound [Jump v]\n        set [y vel v] to [20]\n    end\n    if <touching (end v)?> then\n        start sound [ding v]\n        broadcast (end v)\n    end\n    if <(y position) < [-200]> then\n        broadcast (hurt v)\n    end\n    if <touching (mosnter v)?> then\n        broadcast (hurt v)\n    end\nend\n\nwhen I receive [danger v]\nstart sound [Roblox Death Sound - OOF Sound Effect v]\n\n@End\n\n@danger\n\nwhen flag clicked\ngo to x: (5) y: (-132)\nshow\nswitch costume to (level 1 v)\ngo to [back v] layer\nforever\n    glide (1) secs to x: (5) y: (-145)\n    wait (0.1) seconds\n    glide (1) secs to x: (5) y: (-132)\nend\n\nwhen I receive [end v]\nnext costume\n\n@Trampoline\n\nwhen flag clicked\nhide\nforever\n    if <(level) = [9]> then\n        switch costume to (costume2 v)\n        show\n    end\n    if <(level) = [10]> then\n        show\n        switch costume to (costume3 v)\n    end\n    if <(level) = [11]> then\n        hide\n    end\nend\n\nwhen I receive [end v]\nchange [level v] by (1)\n\n@TB\n\nwhen flag clicked\nforever\n    go to [front v] layer\nend\n\nwhen flag clicked\nset [ghost v] effect to (100)\n\n@Text\n\nwhen flag clicked\nshow\nswitch costume to (traje 1 v)\n\nwhen I receive [end v]\nnext costume\n\n@Clouds\n\nwhen flag clicked\nset [ghost v] effect to (100)\nshow\nforever\n    wait (pick random (0.1) to (3)) seconds\n    create clone of (_myself_ v)\nend\n\nwhen I start as a clone\nset [ghost v] effect to (25)\ngo to x: (-17999) y: (pick random (75) to (130))\nforever\n    change x by (pick random (3) to (6))\n    if <touching (end v)?> then\n        delete this clone\n    end\nend\n\n@Notification\n\nwhen flag clicked\nhide\nwait (pick random (10) to (25)) seconds\nshow\ngo to x: (79) y: (239)\nglide (0.5) secs to x: (79) y: (209)\nwait (2) seconds\nglide (0.5) secs to x: (79) y: (239)\nhide\n\nwhen flag clicked\nforever\n    if <(level) = [13]> then\n        show\n        go to x: (-79) y: (106)\n        glide (0.5) secs to x: (-79) y: (75)\n        glide (0.5) secs to x: (-79) y: (106)\n    end\nend\n\n@mosnter\n\nwhen flag clicked\nhide\nforever\n    if <(level) = [11]> then\n        switch costume to (traje 1 v)\n        show\n        go to x: (36) y: (10)\n        glide (3) secs to x: (-273) y: (12)\n        wait (0.00001) seconds\n        switch costume to (traje 2 v)\n        glide (3) secs to x: (36) y: (12)\n    end\nend\n\nwhen flag clicked\nforever\n    if <(level) = [12]> then\n        hide\n    end\nend\n\n
See this: https://scratch.mit.edu/projects/622536691/\nNew game: https://scratch.mit.edu/projects/625034057/\nWelcome to another platforme game, cube adventure!!\nALL LEVELS ARE POSSIBLE\n__Instructions__\n- Use the arrows key or WASD to move the cube!\n- Avoid spikes and lava\n- Use trampoline to bounce\n- Avoid monsters\n- Complete all the 12 levels!!!\nHave fun!!\n__Credits__\n- Thank you @amazingQ by some of the codes\n- Art: me\n-Sounds:@amazingQ\n- Music: AKAV_BROTHERS\n- Notification: @amazingQ\nPLZ give a like, fave and follow!!