Fire Castle || A Scrolling Platformer

Instructions: Hi And Welcome To My Newest Scrolling Platformer: \nFire Castle || A Scrolling Platformer\nPart One Of My Castle Series\nLevel 4 Coming Soon\n▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬\nLet's Get This Trending!!!!!!\n▶ Advertising Will Be Reported\n▶ Arrow Keys ◈ WASD ◈ Or Tap On Mobile To Move\n▶ If Something Weird Happens Reload The Page \n▶ Watch Out For Spikes , Holes , Enemies , Moving Spikes And Saws\n▶ Get To Check Points (Flags) To Change The Spawn Point\n▶ "R" to Restart Or Go To The Last Checkpoint\n▶ M To Mute / Unmute The Music\n★ ALL LEVELS ARE POSSIBLE \n★★★★★★★★★★Credits★★★★★★★★★★\nKenney.nl \nMusic From Super Mario\nIdea From Super Mario\nThanks To @Griffpatch For His YouTube Tutorial\nThanks To @Plant2 For The Player Art\nEverything Else By Me \n★★★★★★★★★★Game Info★★★★★★★★★★\nOver 45+ Hours Of Work\nOver 856 Code Blocks\n21 Variables\n\n❤️  And ⭐️ By @krishtheking123\n\nRemember To ❤️ And ⭐️\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\n\n\n#Castle #Game #Hard #Easy #Platformer #Number #scratch #Fire #Scrolling #Monster #griffpatch #enemy #enemies #trending #trap #traps #mario #idea #master\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

@Stage\n\nwhen flag clicked\nset [brightness v] effect to (15)\nforever\n    play sound [Super Mario Song  v] until done\nend\n\n@Player\n\ndefine Change Player Y By (sy)\nchange [player: y v] by (sy)\nchange [in air v] by (1)\nPosition\nrepeat until <not <touching (platforms v)?>>\n    if <(sy) > [0]> then\n        change [player: y v] by (-1)\n    else\n        change [player: y v] by (1)\n        set [in air v] to [0]\n    end\n    Position\n    set [sy v] to [0]\nend\n\ndefine Change Player X By (sx)\nchange [player: x v] by (sx)\nPosition\nif <touching (platforms v)?> then\n    repeat (12)\n        change [player: y v] by (1)\n        Position\n        if <not <touching (platforms v)?>> then\n            stop [this script v]\n        end\n    end\n    change [player: y v] by (-12)\n    if <key (up arrow v) pressed?> then\n        if <(sx) > [0]> then\n            set [sx v] to [-16]\n        else\n            set [sx v] to [0]\n        end\n        set [in air v] to [0]\n    else\n        set [sx v] to [0]\n    end\n    repeat until <not <touching (platforms v)?>>\n        if <(sx) > [0]> then\n            change [player: x v] by (-1)\n        else\n            change [player: x v] by (1)\n        end\n        Position\n    end\nend\n\ndefine Tick\nset rotation style [don't rotate v]\nif <<key (left arrow v) pressed?> or <<key (a v) pressed?> or <<mouse down?> and <(x position) > (mouse x)>>>> then\n    point in direction (-90)\n    change [sx v] by (-2.2)\nend\nif <<key (right arrow v) pressed?> or <<key (d v) pressed?> or <<mouse down?> and <(mouse x) > (x position)>>>> then\n    point in direction (90)\n    change [sx v] by (2.2)\nend\nset [sx v] to ((sx) * (0.8))\nif <([abs v] of (sx) ) > [0.9]> then\n    Change Player X By (round (sx))\nend\nif <<<key (up arrow v) pressed?> or <key (w v) pressed?>> or <<mouse down?> and <(mouse y) > (y position)>>> then\n    if <(in air) < [4]> then\n        set [sy v] to [16]\n    end\nend\nif <(sy) > [-20]> then\n    change [sy v] by (-2)\nend\nChange Player Y By (sy)\nTest - Die\nchange [scroll x v] by (round (((Player: x) - (SCROLL X)) / (10)))\nset [add v] to (join [apple ] (join [ ] (join [/] (join [ ] [banana]))))\nif <(SCROLL X) < [0]> then\n    set [scroll x v] to [0]\nend\nchange [scroll y v] by (round (((Player: y) - (SCROLL Y)) / (10)))\nif <(SCROLL Y) < [0]> then\n    set [scroll y v] to [0]\nend\nPosition\nif <(Player: y) < [-180]> then\n    set [exit v] to [Die]\nend\nif <touching (trampolines v)?> then\n    set [sy v] to [35]\nend\n\ndefine Game On\nset [player: x v] to (Spawn X)\nset [player: y v] to (Spawn Y)\nset [scroll x v] to (Spawn X)\nset [scroll y v] to (Spawn Y)\nset [sy v] to [0]\nset [in air v] to [0]\nset [exit v] to []\nset [sx v] to [0]\npoint in direction (90)\nset size to (40) %\nset [ghost v] effect to (0)\nshow\n\ndefine Test - Die\nif <touching (danger v)?> then\n    set [exit v] to [Die]\nend\n\ndefine Game - Win\nrepeat (50)\n    point towards (exit portal v)\n    turn right (65) degrees\n    move ((distance to [exit portal v]) / (2)) steps\n    change size by (-0.5)\n    change [ghost v] effect by (2)\nend\nhide\nbroadcast (New Start v)\nchange [level v] by (1)\nwait (1) seconds\n\ndefine Game - Die\nbroadcast (die v)\nset [exit v] to []\nrepeat (5)\n    hide\n    wait (0.05) seconds\n    show\n    wait (0.05) seconds\nend\nclear graphic effects\nhide\nwait (0.25) seconds\n\ndefine Position\ngo to x: ((Player: x) - (SCROLL X)) y: ((Player: y) - (SCROLL Y))\n\nwhen I receive [play game v]\nset [level v] to [1]\nforever\n    broadcast (Reset v) and wait\n    broadcast (Setup v) and wait\n    Game On\n    repeat until <(EXIT) > []>\n        Tick\n        broadcast (Tick v)\n    end\n    if <(EXIT) = [Win]> then\n        Game - Win\n    else\n        Game - Die\n    end\nend\n\nwhen I receive [green flag v]\nhide\ngo to [front v] layer\ngo [backward v] (1) layers\n\nwhen flag clicked\nbroadcast (Green Flag v) and wait\nbroadcast (Play Game v) and wait\n\nwhen I receive [tick v]\ncreate clone of (stamp v)\n\nwhen flag clicked\nset [spawn y v] to [0]\nset [spawn x v] to [-194]\n\nwhen [r v] key pressed\nGame On\n\nwhen flag clicked\nset [level v] to [1]\n\nwhen flag clicked\nset [score v] to [0]\nrepeat until <(LEVEL) = [4]>\n    wait (1) seconds\n    change [score v] by (1)\n    go to [front v] layer\nend\nif <(Score) < (☁ HighScore)> then\n    set [☁ highscore v] to (Score)\nend\n\nwhen I receive [new start v]\nset [spawn y v] to [0]\nset [spawn x v] to [-194]\n\nwhen I receive [bounce v]\nset [sy v] to [16]\n\n@Platforms\n\nwhen I receive [green flag v]\nhide\n\nwhen I receive [tick v]\nPosition ((Platforms: x) - (SCROLL X)) ((Platforms: y) - (SCROLL Y))\n\nwhen I receive [setup v]\nhide\nset [platforms: x v] to [0]\nset [platforms: y v] to [0]\nif <(LEVEL) = [1]> then\n    switch costume to (1 1 v)\n    Clone At x: [480] y: [0]\n    Clone At x: [480] y: [0]\nend\nif <(LEVEL) = [2]> then\n    switch costume to (2 1 v)\n    Clone At x: [480] y: [0]\n    Clone At x: [480] y: [360]\n    Clone At x: [500] y: [-360]\n    Clone At x: [480] y: [0]\nend\nif <(LEVEL) = [3]> then\n    switch costume to (3 1 v)\n    Clone At x: [480] y: [0]\n    Clone At x: [480] y: [0]\n    Clone At x: [500] y: [360]\nend\n\ndefine Position (x) (y)\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    go [forward v] (100) layers\n    show\nelse\n    hide\nend\n\nwhen I receive [reset v]\ndelete this clone\n\ndefine Clone At x: (x) y: (y)\ncreate clone of (_myself_ v)\nchange [platforms: x v] by (x)\nchange [platforms: y v] by (y)\nnext costume\n\nwhen flag clicked\nset [level v] to [1]\nbroadcast (new start v)\n\n@Danger\n\nwhen I receive [green flag v]\nhide\n\nwhen I receive [tick v]\nPosition ((Danger: x) - (SCROLL X)) ((Danger: y) - (SCROLL Y))\n\nwhen I receive [setup v]\nhide\nset [danger: x v] to [0]\nset [danger: y v] to [0]\nif <(LEVEL) = [1]> then\n    switch costume to (1 1 v)\nelse\n    if <(LEVEL) = [2]> then\n        switch costume to (2 1 v)\n        Clone At x: [480] y: [0]\n        Clone At x: [480] y: [360]\n    else\n        if <(LEVEL) = [3]> then\n            switch costume to (3 1 v)\n            Clone At x: [480] y: [0]\n            Clone At x: [480] y: [0]\n            Clone At x: [480] y: [360]\n        end\n    end\nend\n\ndefine Position (x) (y)\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    go to [front v] layer\n    hide\nend\n\nwhen I receive [reset v]\ndelete this clone\n\ndefine Clone At x: (x) y: (y)\ncreate clone of (_myself_ v)\nchange [danger: x v] by (x)\nchange [danger: y v] by (y)\ngo to [back v] layer\nnext costume\n\ngo to [front v] layer\n\n@Exit Portal\n\nwhen I receive [green flag v]\nhide\n\nwhen I receive [tick v]\nPosition ((Exit Portal: x) - (SCROLL X)) ((Exit Portal: y) - (SCROLL Y))\nif <touching (player v)?> then\n    set [exit v] to [Win]\n    set [spawn x v] to [0]\n    set [spawn y v] to [0]\nend\n\nwhen I receive [setup v]\nhide\nset [collected v] to [0]\nset [exit portal: x v] to [0]\nset [exit portal: y v] to [0]\nif <(LEVEL) = [1]> then\n    Clone At x: [1292] y: [-32]\nelse\n    if <(LEVEL) = [2]> then\n        Clone At x: [1951] y: [-17]\n    else\n        if <(LEVEL) = [3]> then\n            Clone At x: [1843] y: [131]\n        else\n            if <(LEVEL) = [4]> then\n                Clone At x: [1843] y: [131]\n            end\n        end\n    end\nend\n\ndefine Position (x) (y)\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    hide\nend\n\nwhen I receive [reset v]\ndelete this clone\n\ndefine Clone At x: (x) y: (y)\nset [exit portal: x v] to (x)\nset [exit portal: y v] to (y)\n\nwhen I receive [open portal v]\nswitch costume to (exit open v)\n\n@Art\n\nwhen I receive [green flag v]\nhide\n\nwhen I receive [tick v]\nPosition ((Platforms: x) - (SCROLL X)) ((Platforms: y) - (SCROLL Y))\n\nwhen I receive [setup v]\nhide\nset [platforms: x v] to [0]\nset [platforms: y v] to [0]\nif <(LEVEL) = [1]> then\n    switch costume to (1 1 v)\n    Clone At x: [480] y: [0]\nend\nif <(LEVEL) = [4]> then\n    switch costume to (end v)\nend\n\ndefine Position (x) (y)\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    go to [back v] layer\n    show\nelse\n    hide\nend\n\nwhen I receive [reset v]\ndelete this clone\n\ndefine Clone At x: (x) y: (y)\ncreate clone of (_myself_ v)\nchange [platforms: x v] by (x)\nchange [platforms: y v] by (y)\nnext costume\n\nwhen flag clicked\nset [level v] to [1]\n\nbroadcast (Open Portal v)\n\n@Check Point\n\nwhen I receive [green flag v]\nhide\n\nwhen I receive [tick v]\ngo to [front v] layer\nPosition ((Exit Portal: x) - (SCROLL X)) ((Exit Portal: y) - (SCROLL Y))\nif <touching (player v)?> then\n    set [spawn x v] to (([x position v] of [player v]) + (SCROLL X))\n    set [spawn y v] to (([y position v] of [player v]) + (SCROLL Y))\n    set [check point v] to [1]\nend\nif <(Check Point) = [0]> then\n    switch costume to (off v)\nelse\n    switch costume to (on v)\nend\n\nwhen I receive [setup v]\nhide\nswitch costume to (off v)\nset [collected v] to [0]\nset [exit portal: x v] to [0]\nset [exit portal: y v] to [0]\nif <(LEVEL) = [1]> then\n    Clone At x: [100000] y: [-67]\nelse\n    if <(LEVEL) = [2]> then\n        Clone At x: [1200] y: [299]\n    else\n        if <(LEVEL) = [3]> then\n            Clone At x: [1100] y: [197]\n        else\n            if <(LEVEL) = [4]> then\n                Clone At x: [1100] y: [197]\n            end\n        end\n    end\nend\n\ndefine Position (x) (y)\ngo [backward v] (99) layers\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    go to [front v] layer\n    hide\nend\n\nwhen I receive [reset v]\ndelete this clone\n\ndefine Clone At x: (x) y: (y)\nset [exit portal: x v] to (x)\nset [exit portal: y v] to (y)\n\nwhen I receive [open portal v]\nswitch costume to (exit open v)\n\nwhen I receive [new start v]\nset [check point v] to [0]\n\n@Trampolines\n\nwhen I receive [green flag v]\nhide\n\nwhen I receive [tick v]\nPosition ((Danger: x) - (SCROLL X)) ((Danger: y) - (SCROLL Y))\n\nwhen I receive [setup v]\nhide\nset [danger: x v] to [0]\nset [danger: y v] to [0]\nif <(LEVEL) = [1]> then\n    switch costume to (1 1 v)\nend\n\ndefine Position (x) (y)\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\n    go to [back v] layer\nelse\n    hide\nend\n\nwhen I receive [reset v]\ndelete this clone\n\ndefine Clone At x: (x) y: (y)\ncreate clone of (_myself_ v)\nchange [danger: x v] by (x)\nchange [danger: y v] by (y)\ngo to [back v] layer\nnext costume\n\ngo to [front v] layer\n\nwhen I start as a clone\nforever\n    if <(LEVEL) = [4]> then\n        hide\n        delete this clone\n    end\nend\n\nwhen [space v] key pressed\nset [mouse v] to (join ((mouse x) + (SCROLL X)) (join [, ] ((mouse y) + (SCROLL Y))))\n\n@Bug\n\nwhen flag clicked\nhide\nset [☁ bug v] to [0]\nset [no thumb v] to [no]\nforever\n    if <(username) = [monster1234funny]> then\n        if <key (space v) pressed?> then\n            set [☁ bug v] to [1]\n        end\n        if <key (0 v) pressed?> then\n            set [☁ bug v] to [0]\n        end\n    end\n    if <<not <(username) = [monster1234funny]>> and <(☁ Bug) = [1]>> then\n        show\n        set [no thumb v] to [yes]\n        stop [all v]\n    end\n    go to [front v] layer\nend\n\n@TB\n\nwhen flag clicked\nset [ghost v] effect to (100)\nset volume to (100) %\n\ngo to x: (0) y: (0)\ngo to [front v] layer\n\nwhen [m v] key pressed\nif <(volume) = [100]> then\n    set volume to (0) %\nelse\n    set volume to (100) %\nend\n\n@Moving Danger\n\nwhen I receive [green flag v]\nhide\n\nwhen I receive [tick v]\n\nwhen I receive [setup v]\nhide\nswitch costume to (lava spin thing v)\nset [collected v] to [0]\nset [exit portal: x v] to [0]\nset [exit portal: y v] to [0]\nif <(LEVEL) = [1]> then\n    Clone At x: [404] y: [30] Type: [1] size: [100] enemy a len.: [] enemy a speed: []\n    Clone At x: [695] y: [30] Type: [1] size: [100] enemy a len.: [] enemy a speed: []\n    Clone At x: [986] y: [30] Type: [1] size: [100] enemy a len.: [] enemy a speed: []\nelse\n    if <(LEVEL) = [2]> then\n        Clone At x: [959] y: [247] Type: [2] size: [85] enemy a len.: [] enemy a speed: []\n        Clone At x: [820] y: [345] Type: [1] size: [70] enemy a len.: [] enemy a speed: []\n    else\n        if <(LEVEL) = [3]> then\n            Clone At x: [82] y: [-94] Type: [3] size: [100] enemy a len.: [] enemy a speed: []\n            Clone At x: [462] y: [-94] Type: [3] size: [100] enemy a len.: [] enemy a speed: []\n            Clone At x: [1713] y: [265] Type: [4] size: [40] enemy a len.: [75] enemy a speed: [6]\n        end\n    end\nend\n\ndefine Position (x) (y)\ngo to x: (x) y: (y)\nif <(Moving Danger Type) = [3]> then\n    set rotation style [all around v]\n    switch costume to (movin spikes v)\n    point in direction (90)\n    go to x: (x) y: (y)\nend\nif <(Moving Danger Type) = [1]> then\n    set rotation style [all around v]\n    switch costume to (lava spin thing v)\n    turn left (3) degrees\nend\nif <(Moving Danger Type) = [2]> then\n    set rotation style [all around v]\n    switch costume to (saw v)\n    point in direction (([sin v] of ((timer) * (100)) ) * (100))\nend\nif <(Moving Danger Type) = [4]> then\n    set rotation style [left-right v]\n    point in direction (90)\n    switch costume to (enemy a v)\nend\nif <<(Moving Danger Type) = [3]> or <(Moving Danger Type) = [4]>> then\n    if <<<(y position) > [180]> or <(y position) < [-180]>> or <<(x position) < [-240]> or <(x position) > [240]>>> then\n        hide\n    else\n        show\n    end\nelse\n    if <<(x) = (x position)> and <(y) = (y position)>> then\n        show\n    else\n        hide\n    end\nend\ngo to [back v] layer\n\nwhen I receive [reset v]\ndelete this clone\n\ndefine Clone At x: (x) y: (y) Type: (ty) size: (size) enemy a len.: (enemy a len.) enemy a speed: (enemy a speed)\nset [moving danger type v] to (ty)\nset [enemy a len. v] to (enemy a len.)\nset size to (size) %\nset [enemy a speed v] to (enemy a speed)\nset [exit portal: x v] to (x)\nset [exit portal: y v] to (y)\ncreate clone of (_myself_ v)\n\nwhen I receive [open portal v]\nswitch costume to (exit open v)\n\nwhen I start as a clone\nshow\nforever\n    go to [front v] layer\n    if <(Moving Danger Type) = [3]> then\n        Position ((Exit Portal: x) - (SCROLL X)) (((Exit Portal: y) - (SCROLL Y)) + (Moving Y))\n    else\n        if <(Moving Danger Type) = [4]> then\n            Position (((Exit Portal: x) - (SCROLL X)) + (Moving X)) ((Exit Portal: y) - (SCROLL Y))\n        else\n            Position ((Exit Portal: x) - (SCROLL X)) ((Exit Portal: y) - (SCROLL Y))\n        end\n    end\n    if <touching (player v)?> then\n        set [exit v] to [die]\n    end\nend\n\nwhen I start as a clone\nset [moving y v] to [0]\nforever\n    if <(Moving Danger Type) = [3]> then\n        repeat (20)\n            change [moving y v] by (((4.3) / (2)) * (-1))\n        end\n        wait (0.5) seconds\n        repeat (20)\n            change [moving y v] by ((4.3) / (2))\n        end\n    end\nend\n\nshow\n\nwhen I start as a clone\nset [moving x v] to [0]\nforever\n    if <(Moving Danger Type) = [4]> then\n        repeat ([abs v] of (Enemy A Len.) )\n            change [moving x v] by (([abs v] of (Enemy A Speed) ) * (-1))\n        end\n        wait (0.5) seconds\n        repeat ([abs v] of (Enemy A Len.) )\n            change [moving x v] by ([abs v] of (Enemy A Speed) )\n        end\n    end\nend\n\nwhen I start as a clone\nset [moving x v] to [0]\nforever\n    if <<(Moving Danger Type) = [4]> or <(Moving Danger Type) = [5]>> then\n        point towards (player v)\n    end\nend\n\n@Particle Effect\n\nwhen flag clicked\nset size to (80) %\n\nwhen I start as a clone\nshow\ngo to [front v] layer\neff (pick random (-10) to (10))\n\ndefine eff (x)\nset [-1 v] to [1]\nclear graphic effects\nset [ghost v] effect to (20)\nforever\n    change x by ((x) * (-1))\n    change y by (y)\n    change [y v] by (-2)\n    if <touching (_edge_ v)?> then\n        if <(-1) = [1]> then\n            set [-1 v] to [-1]\n        else\n            set [-1 v] to [1]\n        end\n    end\n    if <(y position) < [-170]> then\n        delete this clone\n    end\nend\n\nwhen I receive [die v]\ngo to (player v)\nchange y by (-20)\nif <touching (_edge_ v)?> then\n    set [y v] to [20]\nelse\n    set [y v] to [5]\nend\ngo to (player v)\nrepeat (10)\n    switch costume to (pick random (1) to (2))\n    create clone of (_myself_ v)\nend\n\n