Ancient Egypt - A Platformer (Educational)
@Stage\n\n@3D\n\nwhen flag clicked\nset size to (200) %\nset [map # v] to [1]\ninit\ncreate map (map #)\nhide\nrespawn\nforever\n    erase all\n    go to x: ((x) / (20)) y: (((y) / (5)) - (25))\n    stamp\n    render\n    smarts\n    touching bad?\nend\n\ndefine None\nset [length v] to ((z) + ((0.075) * ([sqrt v] of ((((x) - (x cam)) * ((x) - (x cam))) + (((y) - (y cam)) * ((y) - (y cam)))) )))\ngo to x: (((Size) * ((x) - (x cam))) / ((length) / (1))) y: (((Size) * ((y) - (y cam))) / ((length) / (1)))\n\ndefine None\nadd (x) to [x1 v]\nadd ((y) - (50)) to [y1 v]\nadd (x2) to [x2 v]\nadd ((y2) - (50)) to [y2 v]\n\ndefine None\nadd (x) to [hazard x v]\nadd ((y) - (50)) to [hazard y v]\nadd (x2) to [hazard x2 v]\nadd ((y2) - (50)) to [hazard y2 v]\n\ndefine init\ndelete (all) of [x1 v]\ndelete (all) of [x2 v]\ndelete (all) of [y1 v]\ndelete (all) of [y2 v]\ndelete (all) of [hazard x v]\ndelete (all) of [hazard y v]\ndelete (all) of [hazard x2 v]\ndelete (all) of [hazard y2 v]\n\ndefine smarts\nchange [y vel v] by (-0.16)\ntouching\nif <(touching?) = [1]> then\n    set [y vel v] to ((() - (y vel)) / (4))\n    if <key (up arrow v) pressed?> then\n        set [y vel v] to [3.5]\n    end\nend\nif <key (right arrow v) pressed?> then\n    change [x vel v] by (1)\nend\nif <key (left arrow v) pressed?> then\n    change [x vel v] by (-1)\nend\nset [x vel v] to ((x vel) * (0.8))\nchange [x v] by (x vel)\nchange [y v] by (y vel)\nslope\n\ndefine render\nset [render.run v] to [0]\nset [x cam v] to ((x cam) + (((x) - (x cam)) / (3)))\nset [y cam v] to ((y cam) + (((y) - (y cam)) / (3)))\nset [size v] to ((Size) + (((40) - (Size)) / (15)))\nrepeat (length of [hazard x v])\n    change [render.run v] by (1)\n    pen up\n    set pen size to (1)\n    go to x: (item (render.run) of [hazard x v]) y: (item (render.run) of [hazard y v]) z: (19)\n    set pen color to (#ff0000)\n    pen down\n    set pen size to (4)\n    go to x: (item (render.run) of [hazard x v]) y: (item (render.run) of [hazard y v]) z: (24)\n    go to x: (item (render.run) of [hazard x2 v]) y: (item (render.run) of [hazard y2 v]) z: (24)\n    go to x: (item (render.run) of [hazard x2 v]) y: (item (render.run) of [hazard y2 v]) z: (19)\n    go to x: (item (render.run) of [hazard x v]) y: (item (render.run) of [hazard y v]) z: (19)\nend\nset [render.run v] to [0]\nrepeat (length of [x1 v])\n    change [render.run v] by (1)\n    pen up\n    set pen size to (1)\n    go to x: (item (render.run) of [x1 v]) y: (item (render.run) of [y1 v]) z: (17)\n    set pen color to (#ffffff)\n    pen down\n    set pen size to (2)\n    go to x: (item (render.run) of [x1 v]) y: (item (render.run) of [y1 v]) z: (27)\n    go to x: (item (render.run) of [x2 v]) y: (item (render.run) of [y2 v]) z: (27)\n    go to x: (item (render.run) of [x2 v]) y: (item (render.run) of [y2 v]) z: (17)\n    go to x: (item (render.run) of [x1 v]) y: (item (render.run) of [y1 v]) z: (17)\nend\ncreate player\n\ndefine slope\nchange [y v] by (2)\ntouching\nif <(touching?) = [1]> then\n    change [y v] by (1)\n    touching\n    if <(touching?) = [1]> then\n        change [y v] by (1)\n        touching\n        if <(touching?) = [1]> then\n            change [y v] by (1)\n            touching\n            if <(touching?) = [1]> then\n                change [y v] by (1)\n            end\n        end\n    end\nend\nchange [y v] by (-2)\n\ndefine touching\nset [touching? v] to [0]\nset [touch.run v] to [0]\nrepeat (length of [x1 v])\n    change [touch.run v] by (1)\n    touching part (touch.run) of slope?\nend\n\ndefine level 2\n\ndefine level 1\n\ndefine respawn\nset [size v] to [70]\nset [length v] to [30]\nset [x vel v] to [0]\nset [y vel v] to [0]\nset [x v] to [0]\nset [y v] to [20]\nset [x cam v] to [0]\nset [y cam v] to [60]\nset [size v] to [3]\n\ndefine touching bad?\nset [bad.touch.run v] to [0]\nrepeat (length of [hazard x v])\n    change [bad.touch.run v] by (1)\n    if <<<(((y) + (-6)) + (-13)) < (((x) * (((item (bad.touch.run) of [hazard y v]) - (item (bad.touch.run) of [hazard y2 v])) / ((item (bad.touch.run) of [hazard x v]) - (item (bad.touch.run) of [hazard x2 v])))) + ((item (bad.touch.run) of [hazard y v]) - ((((item (bad.touch.run) of [hazard y v]) - (item (bad.touch.run) of [hazard y2 v])) / ((item (bad.touch.run) of [hazard x v]) - (item (bad.touch.run) of [hazard x2 v]))) * (item (bad.touch.run) of [hazard x v]))))> and <(((x) * (((item (bad.touch.run) of [hazard y v]) - (item (bad.touch.run) of [hazard y2 v])) / ((item (bad.touch.run) of [hazard x v]) - (item (bad.touch.run) of [hazard x2 v])))) + ((item (bad.touch.run) of [hazard y v]) - ((((item (bad.touch.run) of [hazard y2 v]) - (item (bad.touch.run) of [hazard y v])) / ((item (bad.touch.run) of [hazard x v]) - (item (bad.touch.run) of [hazard x2 v]))) * (item (bad.touch.run) of [hazard x v])))) < (((y) + (6)) + (-13))>> and <<(item (bad.touch.run) of [hazard x v]) < (x)> and <(x) < (item (bad.touch.run) of [hazard x2 v])>>> then\n        respawn\n    end\nend\n\ndefine level 3\n\ndefine create player\npen up\nset pen size to (1)\ngo to x: (x) y: ((y) - (4)) z: (14)\nset pen color to (#89cada)\nset pen size to (20)\npen down\npen up\nif <(y) < [-300]> then\n    respawn\nend\nif <(y) > [490]> then\n    change [map # v] by (1)\n    respawn\n    init\n    create map (map #)\nend\n\ndefine draw the rubik's cublets\nadd platform from x: (rubiksX) y: (rubiksY) to x: ((rubiksX) + (50)) y: (rubiksY)\nadd platform from x: (rubiksX) y: (rubiksY) to x: (rubiksX) y: ((rubiksY) + (50))\nadd platform from x: ((rubiksX) + (50)) y: (rubiksY) to x: ((rubiksX) + (50)) y: ((rubiksY) + (50))\nadd platform from x: (rubiksX) y: ((rubiksY) + (50)) to x: ((rubiksX) + (50)) y: ((rubiksY) + (50))\n\ndefine None\nif <(#) = [1]> then\n    set [rubiksx v] to [-10]\n    set [rubiksy v] to [50]\n    draw the rubik's cublets\n    repeat (7)\n        change [rubiksx v] by (50)\n        draw the rubik's cublets\n    end\n    repeat (8)\n        change [rubiksy v] by (50)\n        set [rubiksx v] to [-10]\n        repeat (8)\n            draw the rubik's cublets\n            change [rubiksx v] by (50)\n        end\n    end\nend\nif <(#) = [2]> then\n    add platform from x: (-10) y: (0) to x: (50) y: (10)\n    add platform from x: (50) y: (10) to x: (100) y: (30)\n    add platform from x: (100) y: (30) to x: (150) y: (60)\n    add platform from x: (150) y: (60) to x: (200) y: (100)\n    add platform from x: (200) y: (100) to x: (250) y: (150)\n    add platform from x: (250) y: (150) to x: (300) y: (210)\n    add platform from x: (300) y: (210) to x: (350) y: (260)\n    add platform from x: (350) y: (260) to x: (400) y: (300)\n    add platform from x: (400) y: (300) to x: (450) y: (330)\n    add platform from x: (450) y: (330) to x: (500) y: (350)\n    add platform from x: (500) y: (350) to x: (550) y: (360)\n    add platform from x: (550) y: (360) to x: (600) y: (350)\n    add platform from x: (600) y: (350) to x: (650) y: (330)\n    add platform from x: (650) y: (330) to x: (700) y: (320)\n    add platform from x: (700) y: (320) to x: (750) y: (330)\n    add platform from x: (750) y: (330) to x: (800) y: (350)\n    add platform from x: (800) y: (350) to x: (850) y: (380)\n    add platform from x: (850) y: (380) to x: (900) y: (420)\n    add platform from x: (900) y: (420) to x: (950) y: (470)\n    add platform from x: (950) y: (470) to x: (1000) y: (510)\nend\nif <(#) = [3]> then\n    set [diamondsy v] to [0]\n    add platform from x: (-40) y: ((diamondsY) + (50)) to x: (10) y: (diamondsY)\n    add platform from x: (10) y: (diamondsY) to x: (60) y: ((diamondsY) + (50))\n    add platform from x: (-40) y: ((diamondsY) + (50)) to x: (10) y: ((diamondsY) + (100))\n    add platform from x: (10) y: ((diamondsY) + (100)) to x: (60) y: ((diamondsY) + (50))\n    repeat (4)\n        change [diamondsy v] by (100)\n        add platform from x: (-40) y: ((diamondsY) + (50)) to x: (10) y: (diamondsY)\n        add platform from x: (10) y: (diamondsY) to x: (60) y: ((diamondsY) + (50))\n        add platform from x: (-40) y: ((diamondsY) + (50)) to x: (10) y: ((diamondsY) + (100))\n        add platform from x: (10) y: ((diamondsY) + (100)) to x: (60) y: ((diamondsY) + (50))\n    end\nend\nif <(#) = [4]> then\n    draw rainbow\n    add platform from x: (620) y: (50) to x: (640) y: (40)\n    add platform from x: (640) y: (40) to x: (630) y: (0)\n    add platform from x: (630) y: (0) to x: (660) y: (-40)\n    add platform from x: (660) y: (-40) to x: (700) y: (-40)\n    add platform from x: (700) y: (-40) to x: (730) y: (0)\n    add platform from x: (720) y: (40) to x: (730) y: (0)\n    add platform from x: (720) y: (40) to x: (740) y: (50)\n    draw gold pellet at y: (80)\n    draw gold pellet at y: (130)\n    draw gold pellet at y: (180)\n    draw gold pellet at y: (230)\n    draw gold pellet at y: (280)\n    draw gold pellet at y: (330)\n    draw gold pellet at y: (380)\n    draw gold pellet at y: (430)\n    draw gold pellet at y: (480)\nend\nif <(#) = [5]> then\n    add platform from x: (-20) y: (0) to x: (180) y: (0)\n    add platform from x: (-20) y: (0) to x: (-20) y: (200)\n    add platform from x: (20) y: (0) to x: (20) y: (200)\n    add platform from x: (-20) y: (50) to x: (20) y: (50)\n    add platform from x: (-20) y: (100) to x: (20) y: (100)\n    add platform from x: (-20) y: (150) to x: (20) y: (150)\n    add platform from x: (-20) y: (200) to x: (20) y: (200)\n    add platform from x: (-20) y: (200) to x: (0) y: (250)\n    add platform from x: (0) y: (250) to x: (20) y: (200)\n    add platform from x: (140) y: (0) to x: (140) y: (200)\n    add platform from x: (180) y: (0) to x: (180) y: (200)\n    add platform from x: (140) y: (50) to x: (180) y: (50)\n    add platform from x: (140) y: (100) to x: (180) y: (100)\n    add platform from x: (140) y: (150) to x: (180) y: (150)\n    add platform from x: (140) y: (200) to x: (180) y: (200)\n    add platform from x: (140) y: (200) to x: (160) y: (250)\n    add platform from x: (160) y: (250) to x: (180) y: (200)\n    add platform from x: (20) y: (200) to x: (20) y: (350)\n    add platform from x: (140) y: (200) to x: (140) y: (350)\n    add platform from x: (20) y: (200) to x: (140) y: (200)\n    add platform from x: (20) y: (250) to x: (140) y: (250)\n    add platform from x: (20) y: (300) to x: (140) y: (300)\n    add platform from x: (20) y: (350) to x: (140) y: (350)\n    add platform from x: (20) y: (350) to x: (80) y: (450)\n    add platform from x: (80) y: (450) to x: (140) y: (350)\n    add platform from x: (60) y: (500) to x: (100) y: (500)\n    add platform from x: (80) y: (450) to x: (80) y: (525)\nend\nif <(#) = [6]> then\n    add platform from x: (-20) y: (0) to x: (190) y: (0)\n    add platform from x: (-20) y: (100) to x: (190) y: (100)\n    add platform from x: (-20) y: (0) to x: (-20) y: (100)\n    add platform from x: (190) y: (0) to x: (190) y: (100)\n    add platform from x: (0) y: (20) to x: (0) y: (80)\n    add platform from x: (0) y: (80) to x: (50) y: (80)\n    add platform from x: (0) y: (50) to x: (50) y: (50)\n    add platform from x: (0) y: (20) to x: (50) y: (20)\n    add platform from x: (70) y: (20) to x: (70) y: (80)\n    add platform from x: (70) y: (80) to x: (120) y: (20)\n    add platform from x: (120) y: (20) to x: (120) y: (80)\n    add platform from x: (140) y: (20) to x: (140) y: (80)\n    add platform from x: (140) y: (20) to x: (170) y: (50)\n    add platform from x: (140) y: (80) to x: (170) y: (50)\nend\n\ndefine None\nif <<<(((y) + (-6)) + (-13)) < (((x) * (((item (slo) of [y1 v]) - (item (slo) of [y2 v])) / ((item (slo) of [x1 v]) - (item (slo) of [x2 v])))) + ((item (slo) of [y1 v]) - ((((item (slo) of [y1 v]) - (item (slo) of [y2 v])) / ((item (slo) of [x1 v]) - (item (slo) of [x2 v]))) * (item (slo) of [x1 v]))))> and <(((x) * (((item (slo) of [y1 v]) - (item (slo) of [y2 v])) / ((item (slo) of [x1 v]) - (item (slo) of [x2 v])))) + ((item (slo) of [y1 v]) - ((((item (slo) of [y1 v]) - (item (slo) of [y2 v])) / ((item (slo) of [x1 v]) - (item (slo) of [x2 v]))) * (item (slo) of [x1 v])))) < (((y) + (6)) + (-13))>> and <<(item (slo) of [x1 v]) < (x)> and <(x) < (item (slo) of [x2 v])>>> then\n    set [touching? v] to [1]\nend\n\ndefine None\nadd platform from x: (670) y: (y) to x: (690) y: (y)\nadd platform from x: (670) y: ((y) + (20)) to x: (690) y: ((y) + (20))\nadd platform from x: (670) y: (y) to x: (670) y: ((y) + (20))\nadd platform from x: (690) y: (y) to x: (690) y: ((y) + (20))\n\ndefine draw rainbow\nadd platform from x: (-10) y: (0) to x: (70) y: (0)\nadd platform from x: (-10) y: (-20) to x: (70) y: (-20)\nadd platform from x: (-10) y: (0) to x: (-10) y: (-20)\nadd platform from x: (70) y: (0) to x: (70) y: (-20)\nadd platform from x: (40) y: (0) to x: (90) y: (70)\nadd platform from x: (90) y: (70) to x: (140) y: (120)\nadd platform from x: (140) y: (120) to x: (190) y: (150)\nadd platform from x: (190) y: (150) to x: (240) y: (160)\nadd platform from x: (240) y: (160) to x: (290) y: (160)\nadd platform from x: (50) y: (0) to x: (100) y: (70)\nadd platform from x: (100) y: (70) to x: (150) y: (120)\nadd platform from x: (150) y: (120) to x: (200) y: (150)\nadd platform from x: (200) y: (150) to x: (250) y: (160)\nadd platform from x: (250) y: (160) to x: (300) y: (160)\nadd platform from x: (60) y: (0) to x: (110) y: (70)\nadd platform from x: (110) y: (70) to x: (160) y: (120)\nadd platform from x: (160) y: (120) to x: (210) y: (150)\nadd platform from x: (210) y: (150) to x: (260) y: (160)\nadd platform from x: (260) y: (160) to x: (310) y: (160)\nadd platform from x: (70) y: (0) to x: (120) y: (70)\nadd platform from x: (120) y: (70) to x: (170) y: (120)\nadd platform from x: (170) y: (120) to x: (220) y: (150)\nadd platform from x: (220) y: (150) to x: (270) y: (160)\nadd platform from x: (270) y: (160) to x: (320) y: (160)\nadd platform from x: (320) y: (160) to x: (370) y: (150)\nadd platform from x: (370) y: (150) to x: (420) y: (120)\nadd platform from x: (420) y: (120) to x: (470) y: (70)\nadd platform from x: (470) y: (70) to x: (520) y: (0)\nadd platform from x: (260) y: (160) to x: (310) y: (160)\nadd platform from x: (310) y: (160) to x: (360) y: (150)\nadd platform from x: (360) y: (150) to x: (410) y: (120)\nadd platform from x: (410) y: (120) to x: (460) y: (70)\nadd platform from x: (460) y: (70) to x: (510) y: (0)\nadd platform from x: (250) y: (160) to x: (300) y: (160)\nadd platform from x: (300) y: (160) to x: (350) y: (150)\nadd platform from x: (350) y: (150) to x: (400) y: (120)\nadd platform from x: (400) y: (120) to x: (450) y: (70)\nadd platform from x: (450) y: (70) to x: (500) y: (0)\nadd platform from x: (240) y: (160) to x: (290) y: (160)\nadd platform from x: (290) y: (160) to x: (340) y: (150)\nadd platform from x: (340) y: (150) to x: (390) y: (120)\nadd platform from x: (390) y: (120) to x: (440) y: (70)\nadd platform from x: (440) y: (70) to x: (490) y: (0)\nadd platform from x: (490) y: (0) to x: (570) y: (0)\nadd platform from x: (490) y: (-20) to x: (570) y: (-20)\nadd platform from x: (490) y: (0) to x: (490) y: (-20)\nadd platform from x: (570) y: (0) to x: (570) y: (-20)\n\n@Thumbnail\n\nwhen flag clicked\ngo to x: (0) y: (0)\nhide\n\n
YEEEET IT 