 Forest Survivor || A Pixel Platformer
@Stage\n\nwhen flag clicked\nforever\n    play sound [Game1 v] until done\n    play sound [game 2 v] until done\nend\n\n@Sprite1\n\ndefine platform physics (jump height) (gravity) (friction) (movement speed)\nswitch costume to (hitbox v)\nset rotation style [left-right v]\nchange y by (y vel)\nif <<touching (ground v)?> or <touching (moving block v)?>> then\n    repeat ([abs v] of (y vel) )\n        if <<touching (ground v)?> or <touching (moving block v)?>> then\n            change y by ((-1) * (([abs v] of (y vel) ) / (y vel)))\n        end\n    end\n    if <<<<key (up arrow v) pressed?> or <key (w v) pressed?>> or <(Joystick_y_velocity) > [5.5]>> and <not <(y vel) > [0]>>> then\n        set [y vel v] to (jump height)\n        set [in air v] to [1]\n    else\n        set [y vel v] to [0]\n        set [in air v] to [0]\n    end\nelse\n    change [y vel v] by (gravity)\nend\nif <<<key (right arrow v) pressed?> or <key (d v) pressed?>> or <(Joystick_x_velocity) > [2.5]>> then\n    point in direction (90)\n    change [x vel v] by (movement speed)\nend\nif <<<key (left arrow v) pressed?> or <key (a v) pressed?>> or <[-2.5] > (Joystick_x_velocity)>> then\n    point in direction (-90)\n    change [x vel v] by ((-1) * (movement speed))\nend\nchange x by (x vel)\nif <<touching (ground v)?> or <touching (moving block v)?>> then\n    set [old y v] to (y position)\n    repeat ([abs v] of (x vel) )\n        if <<touching (ground v)?> or <touching (moving block v)?>> then\n            change y by (1)\n        end\n    end\n    if <<touching (ground v)?> or <touching (moving block v)?>> then\n        set y to (old y)\n        repeat ([ceiling v] of ([abs v] of (x vel) ) )\n            if <<touching (ground v)?> or <touching (moving block v)?>> then\n                change x by ((-1) * (([abs v] of (x vel) ) / (x vel)))\n            end\n        end\n        set [x vel v] to [0]\n    end\nend\nset [x vel v] to ((x vel) * (friction))\nif <(in air) = [1]> then\n    switch costume to (idle v)\nelse\n    if <<<<key (right arrow v) pressed?> or <key (d v) pressed?>> or <(Joystick_x_velocity) > [2.5]>> or <<<key (left arrow v) pressed?> or <key (a v) pressed?>> or <[-2.5] > (Joystick_x_velocity)>>> then\n        switch costume to (run v)\n    else\n        if <<key (down arrow v) pressed?> or <(Joystick_y_velocity) < [-5.5]>> then\n            switch costume to (duck v)\n        else\n            switch costume to (idle v)\n        end\n    end\nend\n\nwhen flag clicked\ngo to x: (-200) y: (0)\nset [level v] to [1]\nbroadcast (Reset v)\nforever\n    platform physics (12.5) (-1) (0.7) (2)\n    if <(x position) > [240]> then\n        change [level v] by (1)\n        broadcast (Reset v)\n        broadcast (Transition v)\n    end\n    if <touching (danger v)?> then\n        broadcast (Reset v)\n    end\nend\n\nwhen I receive [reset v]\ngo to x: (-220) y: (0)\n\n@Ground\n\nwhen flag clicked\nswitch costume to (costume1 v)\nforever\n    switch costume to (Level)\nend\n\n@Art\n\nwhen flag clicked\nforever\n    switch costume to (Level)\nend\n\n@Stuff\n\n@Clouds\n\nwhen I start as a clone\ngo to [front v] layer\nshow\nset size to (pick random (750) to (1000)) %\nset [ghost v] effect to (pick random (18) to (35))\ngo to x: (300) y: (pick random (160) to (-160))\nrepeat until <(x position) < [-265]>\n    move (-4) steps\nend\ndelete this clone\n\nwhen flag clicked\nforever\n    create clone of (_myself_ v)\n    wait (pick random (2.0) to (4.0)) seconds\nend\n\n@Coins\n\nwhen flag clicked\nhide\nset [coins v] to [0]\nset [level v] to [1]\nCreate Coin At [-3] [-50] Type: [1]\nwait until <(Level) = [2]>\nwait (0.01) seconds\nCreate Coin At [11] [-48] Type: [2]\nwait until <(Level) = [3]>\nwait (0.01) seconds\nCreate Coin At [-2] [113] Type: [2]\nwait until <(Level) = [4]>\nwait (0.01) seconds\nCreate Coin At [15] [-49] Type: [3]\nwait until <(Level) = [5]>\nwait (0.01) seconds\nCreate Coin At [-4] [-41] Type: [3]\nwait until <(Level) = [6]>\nwait (0.01) seconds\nCreate Coin At [2] [-70] Type: [2]\nwait until <(Level) = [8]>\nwait (0.01) seconds\nCreate Coin At [84] [38] Type: [3]\nCreate Coin At [49] [25] Type: [1]\nCreate Coin At [124] [25] Type: [1]\n\ndefine Create Coin At (x) (y) Type: (type)\ngo to x: (x) y: (y)\nswitch costume to (type)\ncreate clone of (_myself_ v)\n\nwhen I start as a clone\nshow\nforever\n    if <touching (sprite1 v)?> then\n        change [coins v] by (1)\n        delete this clone\n    end\nend\n\nwhen I receive [transition v]\ndelete this clone\n\nwhen flag clicked\ndelete this clone\n\n@Danger\n\nwhen flag clicked\nforever\n    switch costume to (Level)\nend\n\n@Trampoline\n\nwhen flag clicked\nset [level v] to [1]\nhide\nwait until <(Level) = [3]>\nwait (0.02) seconds\nCreate Trampoline At [-8] [-127]\n\ndefine Create Trampoline At (x) ()\ngo to x: (x) y: ()\ncreate clone of (_myself_ v)\n\nwhen I receive [transition v]\ndelete this clone\n\nwhen I start as a clone\nshow\nswitch costume to (jupmp v)\nforever\n    go to [back v] layer\n    if <touching (sprite1 v)?> then\n        set [y vel v] to [20]\n        switch costume to (idle v)\n        wait (0.2) seconds\n        switch costume to (jupmp v)\n    end\nend\n\nwhen flag clicked\ndelete this clone\n\n@Enemys\n\nwhen flag clicked\nhide\n\ndefine Create Enemy At X: (x) Y: (y) Type: (type)\ngo to x: (x) y: (y)\nset [enemy type v] to (type)\ncreate clone of (_myself_ v)\n\nwhen I receive [reset v]\nwait (0.01) seconds\nif <(Level) = [4]> then\n    Create Enemy At X: [13] Y: [-124] Type: [1]\n    Create Enemy At X: [122] Y: [0] Type: [2]\nend\nif <(Level) = [5]> then\n    Create Enemy At X: [-3] Y: [58] Type: [3]\n    Create Enemy At X: [122] Y: [134] Type: [2]\nend\nif <(Level) = [6]> then\n    Create Enemy At X: [122] Y: [-127] Type: [4]\nend\n\nwhen I receive [reset v]\ndelete this clone\n\nwhen I start as a clone\nif <(Enemy Type) = [1]> then\n    show\n    switch costume to (enemy 1 v)\n    forever\n        go to [back v] layer\n        repeat (20)\n            change y by (-2.5)\n        end\n        repeat (20)\n            change y by (2.5)\n        end\n    end\nelse\n    if <(Enemy Type) = [2]> then\n        show\n        set rotation style [left-right v]\n        repeat until <(ded) = [1]>\n            set rotation style [left-right v]\n            go to [back v] layer\n            repeat (50)\n                point in direction (90)\n                change x by (-5)\n            end\n            repeat (50)\n                point in direction (-90)\n                change x by (5)\n            end\n        end\n    else\n        if <(Enemy Type) = [3]> then\n            show\n            switch costume to (enemy 3 v)\n            repeat until <(ded) = [1]>\n                if <(distance to [sprite1 v]) < [190]> then\n                    repeat until <<touching (sprite1 v)?> or <touching (ground v)?>>\n                        change y by (-10)\n                    end\n                    repeat (25)\n                        change [ghost v] effect by (4)\n                    end\n                    delete this clone\n                end\n            end\n        else\n            if <(Enemy Type) = [4]> then\n                set rotation style [left-right v]\n                show\n                switch costume to (enemy 4 a v)\n                forever\n                    point in direction (90)\n                    repeat (100)\n                        change x by (-2.5)\n                    end\n                    point in direction (-90)\n                    repeat (100)\n                        change x by (2.5)\n                    end\n                end\n            else\n                delete this clone\n            end\n        end\n    end\nend\n\nwhen I start as a clone\nset [ded v] to [0]\nforever\n    if <touching (sprite1 v)?> then\n        if <not <(ded) = [1]>> then\n            broadcast (Reset v)\n        end\n    end\n    if <<touching (player sensor v)?> and <not <(Enemy Type) = [1]>>> then\n        set [ded v] to [1]\n        set [y vel v] to [12.5]\n        if <(Enemy Type) = [2]> then\n            switch costume to (enemy 2 c v)\n            repeat until <<touching (_edge_ v)?> or <touching (ground v)?>>\n                change y by (-5)\n            end\n            delete this clone\n        end\n        if <(Enemy Type) = [4]> then\n            switch costume to (enemy 4 a2 v)\n            set [ded v] to [1]\n            set [y vel v] to [12.5]\n            wait (0.2) seconds\n            delete this clone\n        end\n        delete this clone\n    end\nend\n\nwhen I start as a clone\nset [ded v] to [0]\nrepeat until <(ded) = [1]>\n    if <(Enemy Type) = [1]> then\n        switch costume to (enemy 1 v)\n    end\n    if <(Enemy Type) = [2]> then\n        switch costume to (enemy 2 a v)\n        wait (0.1) seconds\n        switch costume to (enemy 2 b v)\n        wait (0.1) seconds\n    end\nend\n\nwhen I start as a clone\nforever\n    if <<(Enemy Type) = [1]> or <(Enemy Type) = [3]>> then\n        point in direction (90)\n    else\n    end\nend\n\n@Player Sensor\n\nwhen flag clicked\nset [ghost v] effect to (100)\nforever\n    broadcast (goto v)\nend\n\nwhen I receive [goto v]\ngo to x: ([x position v] of [sprite1 v]) y: ([y position v] of [sprite1 v])\n\n@Joystick\n\ndefine Render Joystick\npen up\nerase all\ngo to x: (Joystick_x_position) y: (Joystick_y_position)\nset pen size to (Joystick_size)\nSet pen color [140] [140] [140] [200]\npen down\npen up\nSet pen color [200] [200] [200] [200]\nset pen size to (Joystickknob_size)\nif <(distance to [mouse-pointer v]) < (((Joystick_size) / (2)) - ((Joystickknob_size) / (2)))> then\n    go to (mouse-pointer v)\nelse\n    point towards (mouse-pointer v)\n    move (((Joystick_size) / (2)) - ((Joystickknob_size) / (2))) steps\nend\npen down\npen up\nset [joystick_x_velocity v] to ((((x position) - (Joystick_x_position)) / (((Joystick_size) / (2)) - ((Joystickknob_size) / (2)))) * (Joystick_x_max_velocity))\nset [joystick_y_velocity v] to ((((y position) - (Joystick_y_position)) / (((Joystick_size) / (2)) - ((Joystickknob_size) / (2)))) * (Joystick_y_max_velocity))\n\ndefine Set pen color (r) (g) (b) (a)\nset pen color to (((((((a) * (256)) + (r)) * (256)) + (g)) * (256)) + (b))\n\nwhen flag clicked\ngo [backward v] (9999999999999999) layers\nset [joystick_size v] to [100]\nset [joystickknob_size v] to [35]\nset [joystick_x_max_velocity v] to [10]\nset [joystick_y_max_velocity v] to [10]\nforever\n    if <mouse down?> then\n        if <(First_Position_set?) = [0]> then\n            set [joystick_x_position v] to (mouse x)\n            set [joystick_y_position v] to (mouse y)\n            set [first_position_set? v] to [1]\n        end\n        Render Joystick\n    else\n        set [joystick_x_velocity v] to ((Joystick_x_velocity) * (.2))\n        set [joystick_y_velocity v] to ((Joystick_y_velocity) * (.9))\n        set [first_position_set? v] to [0]\n        erase all\n    end\nend\n\n@THumbnail\n\nwhen flag clicked\nhide\ngo to x: (0) y: (0)\n\nshow\ngo to [front v] layer\n\n
Hi And Welcome To My Newest Game: Forest Survivor\n▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬\n▶ Advertising Will Be Reported\n▶ Arrow Keys To Move.\n▶  Jump To Kill enemies\n▶ Watch Out For Spikes And Holes And Enemies\n▶ Go To The Right To Complete The Level\n★ ALL LEVELS ARE POSSIBLE\n▬▬▬▬▬▬▬▬▬▬▬Info▬▬▬▬▬▬▬▬▬▬▬\nMade In 7 hours\nOver 512 Blocks\n▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬\nSuggest It To Get Featured Here:\nhttps://scratch.mit.edu/studios/4228481/comments\n\nreport bugs and faults in the comments\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n#Rogue #Knight #Enemies #Attack #Jump #platformer #worm #mushroom #goblin #key #door #levels @hours #hard #To #make #popular @naterose1 @popuiar @flippy445 #lol #money #heart #star #epic #great #good\n#Out # Side #Outside #Adventurer #xamuil2 #game #rat #fly #mushroom #cactus #star #bee #sign #flower #colors #blue  #Lag #Wall #Slope #Art #Grass #Monster #griffpatch #spike #sequel #lava #remix #heart #star #famous #why #are #u #reading #this #Hi #I #God #kay #cool #money #snow #trend #Gravity #dash #I #see #you #xd #space  #Darkness #Gravity #darkness\n▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬\n#games #games #games #games #games #games #games #games #games #games #games #games #games #games #games #games #games #games #games #games #games #games #games #games #games #games #games #games #games #games #games #games #games #games #games #games #games #games #games #games #games #games #games #games #games #games #games #games #games #games #games #games #games #games #games #games #games #games #games #games #games #games #games #games #games #games \n#games #games #games #games #games #games #games #games #games #games #games #games #games #games #games #games #games #games #games #games #games #games #games #games #games #games #games #games #games #games #games #games #games #games #games #games #games #games #games #games #games #games #games #games #games #games #games #games #games #games #games #games #games #games #games #games #games #games #games #games #games #games #games #games #games #games #games #games #games #games #games #games #games #games #games #games #games #games #games #games #games #games #games #games #games #games #games #games #games #games #games #games #games #games #games #games #games #games #games #games #games #games #games #games #games #games #games #games #games #games #games #games #games #games #games #games #games #games #games #games #games #games #games #games #games #games #games #games #games #games #games #games \n\n\n