Dinosaurs (platformer)

Instructions: follow directions on screen

@Stage\n\nwhen flag clicked\nforever\n    set [tmpfps v] to [0]\n    reset timer\n    repeat until <[1] < (timer)>\n        change [tmpfps v] by (1)\n    end\n    set [fps v] to (tmpfps)\nend\n\nwhen I receive [show v]\nif <[4] = (Level)> then\n    switch backdrop to (backdrop2 v)\nelse\n    switch backdrop to (backdrop1 v)\nend\n\nwhen flag clicked\nforever\n    play sound [bradsmith - My lizard is the Lizard of Soundtrack - 02 Maze.mp3 v] until done\n    play sound [bradsmith - My lizard is the Lizard of Soundtrack - 01 Ruins.mp3 v] until done\nend\n\n@Hitbox\n\nwhen flag clicked\nreset\nbroadcast (start v)\n\ndefine ground\nrepeat until <not <touching (ground v)?>>\n    change y by ((0) - (([abs v] of (yV) ) / (yV)))\nend\n\ndefine reset\nset [xv v] to [0]\nset [yv v] to [0]\ngo to x: (-220) y: (-92)\nset [attack v] to [0]\n\nwhen I receive [start v]\nset [ghost v] effect to (100)\nif <[6] = (Level)> then\n    broadcast (end v)\n    stop [this script v]\nend\nforever\n    change y by (yV)\n    if <touching (ground v)?> then\n        ground\n        if <(yV) < [.1]> then\n            set [yv v] to [0]\n            set [j v] to [16]\n        else\n            set [yv v] to [-1]\n        end\n    else\n        change [yv v] by (-1)\n        if <touching color (#0058f8)?> then\n            change [yv v] by (-1)\n            set [j v] to [0]\n        end\n    end\n    change y by (-1)\n    if <touching (ground v)?> then\n        set [ycol v] to [1]\n    else\n        set [ycol v] to [0]\n    end\n    change y by (1)\n    if <<[-.1] < (yV)> and <<key (up arrow v) pressed?> or <key (z v) pressed?>>> then\n        if <not <<(swim) = [1]> and <touching color (#0058f8)?>>> then\n            if <[16] = (j)> then\n                start sound [Jump v]\n                set [yv v] to (jumphieght)\n            end\n            change [j v] by (-1)\n            change [yv v] by (0.05)\n        end\n    else\n        set [j v] to [0]\n        if <[1] < (yV)> then\n            set [yv v] to [1]\n        end\n    end\n    if <<(swim) = [1]> and <<key (up arrow v) pressed?> or <key (z v) pressed?>>> then\n        if <touching color (#0058f8)?> then\n            change [yv v] by (2.35)\n        end\n    end\n    if <(attack) < [1]> then\n        if <key (left arrow v) pressed?> then\n            point in direction (-90)\n            change x by ((0) - (speed))\n            if <touching (ground v)?> then\n                change x by (speed)\n            end\n        end\n        if <key (right arrow v) pressed?> then\n            point in direction (90)\n            change x by (speed)\n            if <touching (ground v)?> then\n                change x by ((0) - (speed))\n            end\n        end\n    end\n    if <[236] < (x position)> then\n        broadcast (beatlevel v)\n        reset\n        stop [this script v]\n    end\n    if <(y position) < [-170]> then\n        reset\n    end\n    if <[1] = (canattack?)> then\n        if <[0] < (attack)> then\n            change [attack v] by (-1)\n        else\n            if <<key (x v) pressed?> and <[1] = (ycol)>> then\n                set [attack v] to [8]\n            end\n        end\n    end\n    broadcast (render v)\nend\n\nwhen [timer v] > (1.5)\nset [ghost v] effect to (100)\n\nwhen I receive [die v]\nreset\n\nwhen I receive [egg v]\nstop [other scripts in sprite v]\n\n@Ground\n\nwhen flag clicked\nset size to (1600) %\ngo to x: (0) y: (-4)\nset [level v] to [1]\nswitch costume to (Level)\nbroadcast (tiles v)\n\nwhen I receive [hide v]\nset [ghost v] effect to (100)\n\nwhen I receive [beatlevel v]\nchange [level v] by (1)\nswitch costume to (Level)\nbroadcast (tiles v)\n\nwhen I receive [show v]\nclear graphic effects\n\n@Cosmetic\n\nwhen flag clicked\nset size to (1600) %\ngo to x: (0) y: (-4)\nswitch costume to (Level)\n\nwhen I receive [tiles v]\nswitch costume to (Level)\n\nwhen I receive [hide v]\nset [ghost v] effect to (100)\n\nwhen I receive [show v]\nclear graphic effects\n\n@Costume\n\nwhen I receive [egg v]\nstop [other scripts in sprite v]\nhide\n\nwhen I receive [hide v]\nshow\n\nwhen I receive [start v]\nforever\n    if <[0] = ([ycol v] of [hitbox v])> then\n        set [ani v] to [2]\n    else\n        if <<key (right arrow v) pressed?> or <key (left arrow v) pressed?>> then\n            change [ani v] by (1)\n            if <[4] < (ani)> then\n                set [ani v] to [1]\n            end\n            wait (0.05) seconds\n        else\n            set [ani v] to [1]\n        end\n    end\nend\n\nwhen I receive [show v]\nhide\nstop [other scripts in sprite v]\n\nwhen I receive [render v]\ngo to (hitbox v)\n\nwhen I receive [end v]\nstop [other scripts in sprite v]\nswitch costume to (1-1 v)\ngo to x: (-168) y: (-76)\nshow\nstamp\nchange x by (64)\nchange y by (16)\nswitch costume to (2-1 v)\nstamp\nchange x by (64)\nchange y by (16)\nswitch costume to (3-1 v)\nstamp\nchange x by (64)\nchange y by (16)\nswitch costume to (4-1 v)\nstamp\nchange x by (64)\nchange y by (16)\nswitch costume to (5-1 v)\nstamp\nchange x by (64)\nchange y by (16)\nswitch costume to (5-9 v)\nstamp\nhide\n\nwhen I receive [start v]\nset [ani v] to [1]\nshow\nforever\n    point in direction ([direction v] of [hitbox v])\n    switch costume to (ani)\n    switch costume to (((4) * (type)) + (costume [number v]))\n    if <[0] < (attack)> then\n        switch costume to (4-1 v)\n        if <[1] < (attack)> then\n            switch costume to (4-5 v)\n            if <[3] < (attack)> then\n                switch costume to (4-1 v)\n                turn right (180) degrees\n                if <[5] < (attack)> then\n                    switch costume to (4-5 v)\n                end\n            end\n        end\n    end\nend\n\n@Tiles\n\ndefine render\ngo to x: (-232) y: (-172)\nbroadcast (show v) and wait\nerase all\ndelete (all) of [meatx v]\ndelete (all) of [meaty v]\ndelete (all) of [nestx v]\ndelete (all) of [nesty v]\nrepeat (23)\n    set [tmp v] to [0]\n    repeat until <[30] < (tmp)>\n        switch costume to (. v)\n        set x to ((-232) + ((16) * (tmp)))\n        show\n        if <touching color (#000000)?> then\n            switch costume to (g v)\n            stamp\n        else\n            if <touching color (#666666)?> then\n                switch costume to (d v)\n                stamp\n            else\n                if <touching color (#7f7f7f)?> then\n                    switch costume to (d2 v)\n                    stamp\n                    change [tmp v] by (3)\n                else\n                    if <touching color (#995900)?> then\n                        switch costume to (g v)\n                        stamp\n                        add (x position) to [nestx v]\n                        add (y position) to [nesty v]\n                    else\n                        if <touching color (#663b00)?> then\n                            switch costume to (g v)\n                            stamp\n                            add (x position) to [meatx v]\n                            add (y position) to [meaty v]\n                        else\n                            if <touching color (#99ffff)?> then\n                                set [tmp v] to [31]\n                            else\n                                if <touching color (#00ffff)?> then\n                                    switch costume to (w1 v)\n                                    stamp\n                                else\n                                    if <touching color (#00cccc)?> then\n                                        switch costume to (w2 v)\n                                        stamp\n                                    end\n                                end\n                            end\n                        end\n                    end\n                end\n            end\n        end\n        hide\n        change [tmp v] by (1)\n    end\n    change y by (16)\nend\nbroadcast (hide v)\nbroadcast (start v)\n\nwhen I receive [tiles v]\nrender\n\ndefine show in w1 and w2 only\n\n@Meat\n\nwhen flag clicked\nhide\n\nwhen I start as a clone\nswitch costume to (costume1 v)\nshow\nwait until <touching (hitbox v)?>\nstart sound [meat v]\nset [tmp v] to [6]\nrepeat (13)\n    change y by (tmp)\n    change [tmp v] by (-1)\nend\nswitch costume to (costume2 v)\nset [nest v] to [1]\nrepeat (60)\n    change y by (0.5)\nend\ndelete this clone\n\nwhen I receive [hide v]\nset [tmp v] to [0]\nrepeat (length of [meaty v])\n    change [tmp v] by (1)\n    go to x: (item (tmp) of [meatx v]) y: (item (tmp) of [meaty v])\n    change y by (16)\n    create clone of (_myself_ v)\nend\n\n@Nest\n\nwhen flag clicked\nhide\nwait (0) seconds\nset [type v] to ((Level) - (1))\nset [swim v] to [0]\ntypedata\n\nwhen I receive [hide v]\nset [nest v] to [0]\nset [tmp v] to [0]\nrepeat (length of [nestx v])\n    change [tmp v] by (1)\n    go to x: (item (tmp) of [nestx v]) y: (item (tmp) of [nesty v])\n    change y by (16)\n    create clone of (_myself_ v)\n    switch costume to (nest v)\n    show\n    wait until <[1] = (nest)>\n    wait until <<[1] = ([ycol v] of [hitbox v])> and <<key (down arrow v) pressed?> and <touching (hitbox v)?>>>\n    change [nest v] by (1)\n    broadcast (egg v)\nend\n\ndefine typedata\nset [speed v] to [3]\nset [jumphieght v] to [8]\nset [canattack? v] to [0]\nif <[0] < (type)> then\n    set [jumphieght v] to [9.5]\n    if <[1] < (type)> then\n        set [swim v] to [1]\n        if <[2] < (type)> then\n            set [canattack? v] to [1]\n            if <[4] < (type)> then\n                set [speed v] to [4]\n            end\n        end\n    end\nend\n\nwhen I receive [beatlevel v]\nhide\ndelete this clone\n\nwhen I start as a clone\nwait until <[2] = (nest)>\nswitch costume to (1 v)\nshow\nset [tmp v] to [6]\nrepeat (13)\n    change y by (tmp)\n    change [tmp v] by (-1)\nend\nrepeat (4)\n    wait until <<key (z v) pressed?> or <key (up arrow v) pressed?>>\n    next costume\n    set [tmp v] to [3]\n    start sound [crack v]\n    repeat (7)\n        change y by (tmp)\n        change [tmp v] by (-1)\n    end\n    wait until <not <<key (z v) pressed?> or <key (up arrow v) pressed?>>>\nend\nwait until <<key (z v) pressed?> or <key (up arrow v) pressed?>>\nstart sound [crack v]\nset [tmp v] to [6]\nrepeat (13)\n    change y by (tmp)\n    change [tmp v] by (-1)\nend\nstart sound [break v]\nchange [type v] by (1)\ntypedata\nbroadcast (start v)\nchange [nest v] by (1)\ndelete this clone\n\n@Text\n\nwhen I receive [hide v]\nclear graphic effects\nif <[1] = (Level)> then\n    print [g\et_the_meat!] at x: (-100) y: (48) size: (1) centered: (0) clones: (1)\n    print [g\eorge_can't_jump_high_enough...] at x: (16) y: (32) size: (1) centered: (0) clones: (1)\n    wait (1) seconds\n    wait until <[1] = (nest)>\n    broadcast (textdelete v) and wait\n    print [p\ress_down_to] at x: (-22) y: (32) size: (1) centered: (0) clones: (1)\n    print [lay_an_egg!] at x: (-22) y: (22) size: (1) centered: (0) clones: (1)\n    wait until <[2] = (nest)>\n    broadcast (textdelete v) and wait\n    print [j\ump_to_hatch!] at x: (-22) y: (48) size: (1) centered: (0) clones: (1)\n    wait until <[3] = (nest)>\n    broadcast (textdelete v) and wait\n    print [m\u\t\a\t\i\o\n\_c\o\m\p\l\e\t\e\!] at x: (0) y: (138) size: (2) centered: (1) clones: (1)\n    print [g\eorge_i\i\_has_stronger_feet_and_can_jump_higher!] at x: (0) y: (118) size: (1) centered: (1) clones: (1)\nend\nif <[2] = (Level)> then\n    print [g\eorge_i\i\_can't_swim.] at x: (20) y: (-60) size: (1) centered: (0) clones: (1)\n    wait (1) seconds\n    wait until <[3] = (nest)>\n    broadcast (textdelete v) and wait\n    print [m\u\t\a\t\i\o\n\_c\o\m\p\l\e\t\e\!] at x: (0) y: (138) size: (2) centered: (1) clones: (1)\n    print [g\eorge_i\i\i\_has_forearms_and_can_swim!] at x: (0) y: (118) size: (1) centered: (1) clones: (1)\nend\nif <[3] = (Level)> then\n    print [a\_predator_approaches!] at x: (32) y: (-60) size: (1) centered: (0) clones: (1)\n    wait (1) seconds\n    wait until <[3] = (nest)>\n    broadcast (textdelete v) and wait\n    print [m\u\t\a\t\i\o\n\_c\o\m\p\l\e\t\e\!] at x: (0) y: (138) size: (2) centered: (1) clones: (1)\n    print [g\eorge_i\v\_has_a_spiked_tail!_p\ress_x\_to_attack!] at x: (0) y: (118) size: (1) centered: (1) clones: (1)\nend\nif <[4] = (Level)> then\n    wait (1) seconds\n    wait until <[3] = (nest)>\n    set [brightness v] effect to (100)\n    print [m\u\t\a\t\i\o\n\_c\o\m\p\l\e\t\e\!] at x: (0) y: (118) size: (2) centered: (1) clones: (1)\n    print [g\eorge_v\_has_enhanced_eyesight!] at x: (0) y: (98) size: (1) centered: (1) clones: (1)\nend\nif <[5] = (Level)> then\n    wait (1) seconds\n    wait until <[3] = (nest)>\n    print [m\u\t\a\t\i\o\n\_c\o\m\p\l\e\t\e\!] at x: (0) y: (138) size: (2) centered: (1) clones: (1)\n    print [g\eorge_v\i\_has_stronger_legs_and_can_run_faster!] at x: (0) y: (118) size: (1) centered: (1) clones: (1)\nend\nif <[6] = (Level)> then\n    print [c\ongratulations!] at x: (0) y: (138) size: (2) centered: (1) clones: (1)\n    print [y\ou_went_through_5_generations_of_g\eorges_and_mutated] at x: (0) y: (118) size: (1) centered: (1) clones: (1)\n    print [to_accomodate_your_envirorment!] at x: (0) y: (108) size: (1) centered: (1) clones: (1)\nend\n\ndefine None\nset size to ((size) * (100)) %\nif <[1] = (centered)> then\n    set [.. v] to [0]\n    set [. v] to [0]\n    set y to (y)\n    repeat until <(length of (text)) < ((.) + (1))>\n        change [. v] by (1)\n        switch costume to (letter (.) of (text))\n        if <[\] = (letter ((1) + (.)) of (text))> then\n            switch costume to (join (letter (.) of (text)) (letter (.) of (text)))\n        else\n        end\n        if <[\] = (letter ((1) + (.)) of (text))> then\n            change [. v] by (1)\n        end\n        change [.. v] by (((item (costume [number v]) of [width v]) + (1)) * (size))\n    end\n    hide\n    set x to ((0) - ((..) / (2)))\nelse\n    go to x: (x) y: (y)\nend\nset [. v] to [0]\nshow\nrepeat until <(length of (text)) < ((.) + (1))>\n    change [. v] by (1)\n    switch costume to (letter (.) of (text))\n    if <[\] = (letter ((1) + (.)) of (text))> then\n        switch costume to (join (letter (.) of (text)) (letter (.) of (text)))\n    else\n    end\n    if <not <[_] = (letter (.) of (text))>> then\n        if <[0] = (clones)> then\n            stamp\n        else\n            create clone of (_myself_ v)\n        end\n    end\n    change x by ((size) * ((item (costume [number v]) of [width v]) + (1)))\n    if <[\] = (letter ((1) + (.)) of (text))> then\n        change [. v] by (1)\n    end\nend\nhide\n\nwhen I receive [widths v]\ndelete (all) of [width v]\nadd [5] to [width v]\nadd [3] to [width v]\nadd [3] to [width v]\nadd [3] to [width v]\nadd [3] to [width v]\nadd [3] to [width v]\nadd [2] to [width v]\nadd [3] to [width v]\nadd [3] to [width v]\nadd [1] to [width v]\nadd [2] to [width v]\nadd [3] to [width v]\nadd [1] to [width v]\nadd [5] to [width v]\nadd [3] to [width v]\nadd [3] to [width v]\nadd [3] to [width v]\nadd [3] to [width v]\nadd [2] to [width v]\nadd [3] to [width v]\nadd [3] to [width v]\nadd [3] to [width v]\nadd [3] to [width v]\nadd [5] to [width v]\nadd [3] to [width v]\nadd [3] to [width v]\nadd [3] to [width v]\nadd [4] to [width v]\nadd [4] to [width v]\nadd [4] to [width v]\nadd [4] to [width v]\nadd [4] to [width v]\nadd [4] to [width v]\nadd [4] to [width v]\nadd [4] to [width v]\nadd [1] to [width v]\nadd [4] to [width v]\nadd [4] to [width v]\nadd [3] to [width v]\nadd [5] to [width v]\nadd [4] to [width v]\nadd [4] to [width v]\nadd [4] to [width v]\nadd [4] to [width v]\nadd [4] to [width v]\nadd [4] to [width v]\nadd [3] to [width v]\nadd [4] to [width v]\nadd [5] to [width v]\nadd [8] to [width v]\nadd [4] to [width v]\nadd [5] to [width v]\nadd [4] to [width v]\nadd [1] to [width v]\nadd [2] to [width v]\nadd [2] to [width v]\nadd [1] to [width v]\nadd [4] to [width v]\nadd [5] to [width v]\nadd [3] to [width v]\nadd [3] to [width v]\nadd [4] to [width v]\nadd [2] to [width v]\nadd [4] to [width v]\nadd [4] to [width v]\nadd [4] to [width v]\nadd [4] to [width v]\nadd [4] to [width v]\nadd [4] to [width v]\nadd [4] to [width v]\nadd [4] to [width v]\nadd [4] to [width v]\nadd [4] to [width v]\nadd [4] to [width v]\nadd [1] to [width v]\nadd [3] to [width v]\nadd [4] to [width v]\nadd [3] to [width v]\nadd [3] to [width v]\n\nwhen I receive [textdelete v]\ndelete this clone\n\nwhen I receive [beatlevel v]\nbroadcast (textdelete v)\n\n@enemy\n\nwhen I receive [beatlevel v]\nhide\n\nwhen I receive [hide v]\nif <[3] = (Level)> then\n    go to x: (120) y: (-108)\n    set rotation style [left-right v]\n    show\n    forever\n        repeat until <[150] < (distance to [hitbox v])>\n            point towards (hitbox v)\n            point in direction (((round (((direction) + (-90)) / (180))) * (180)) + (90))\n            next costume\n            repeat (4)\n                move (4) steps\n                if <(x position) < [-16]> then\n                    set x to (-16)\n                end\n                if <[156] < (x position)> then\n                    set x to (156)\n                end\n            end\n        end\n        repeat until <<(distance to [hitbox v]) < [150]> or <[120] = (x position)>>\n            repeat (4)\n                if <[120] < (x position)> then\n                    point in direction (-90)\n                    change x by (-4)\n                else\n                    point in direction (90)\n                    change x by (4)\n                end\n            end\n            next costume\n        end\n        switch costume to (costume1 v)\n    end\nend\nif <[5] = (Level)> then\n    go to x: (212) y: (68)\n    set rotation style [left-right v]\n    show\n    forever\n        repeat until <[64] < (distance to [hitbox v])>\n            point towards (hitbox v)\n            point in direction (((round (((direction) + (-90)) / (180))) * (180)) + (90))\n            next costume\n            repeat (4)\n                move (4) steps\n                if <(x position) < [130]> then\n                    set x to (130)\n                end\n            end\n        end\n        repeat until <<(distance to [hitbox v]) < [64]> or <[212] = (x position)>>\n            repeat (4)\n                if <[212] < (x position)> then\n                    point in direction (-90)\n                    change x by (-4)\n                else\n                    point in direction (90)\n                    change x by (4)\n                end\n            end\n            next costume\n        end\n        switch costume to (costume1 v)\n    end\nend\nforever\n    change [color v] effect by (1)\nend\n\nwhen I receive [hide v]\nhide\n\nwhen I receive [hide v]\nif <[1] = (Level)> then\n    forever\n        if <touching (hitbox v)?> then\n            if <[0] = (attack)> then\n                broadcast (die v) and wait\n            else\n                stop [other scripts in sprite v]\n                set rotation style [all around v]\n                point in direction (-90)\n                stop [this script v]\n            end\n        end\n    end\nend\nif <[4] = (Level)> then\n    forever\n        if <touching (hitbox v)?> then\n            if <<(type) < [4]> or <[0] = (attack)>> then\n                broadcast (die v) and wait\n            else\n                stop [other scripts in sprite v]\n                set rotation style [all around v]\n                point in direction (-90)\n                stop [this script v]\n            end\n        end\n    end\nend\n\n@NES color palette\n\nwhen flag clicked\nhide\n\n@Dark\n\nwhen I receive [hide v]\nif <[4] = (Level)> then\n    wait (1) seconds\n    wait until <[2] < (nest)>\n    repeat (25)\n        change [ghost v] effect by (4)\n    end\n    stop [other scripts in sprite v]\n    hide\nend\n\ndefine None\nswitch costume to (costume2 v)\nset size to (number1) %\nswitch costume to (costume1 v)\n\nwhen I receive [show v]\nhide\n\nwhen I receive [hide v]\nif <[4] = (Level)> then\n    size (3200)\n    go to [front v] layer\n    show\n    forever\n        go to (hitbox v)\n    end\nend\n\n@Screenshot 2015-05-08 at 9.51.22 AM\n\nwhen flag clicked\nhide\n\nset size to (800) %\ngo to x: (64) y: (-32)\nshow\ngo to [front v] layer\nstop [all v]\n\n