Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- while true do
- term.clear()
- term.setCursorPos(1,1)
- print "GAME CONTROLS"
- print "-------------"
- print "Arrows Keys to Move"
- print "Q,W,E,A,D,Z,X,C - Place or Destroy Blocks"
- print "S - To toggle place or destroy"
- print "L - To toggle lighting"
- print "N - To toggle noclip"
- print "#1-X - To change current block"
- print "Esc - To Quit(while in game)"
- print "--------------"
- print ""
- print "Press 1 to Install Font, Press 2 to Play Game"
- event, param = os.pullEvent()
- if event == "char" and param == "1" then
- file = io.open("font.txt", "w")
- font = "137\n80\n78\n71\n13\n10\n26\n10\n0\n0\n0\n13\n73\n72\n68\n82\n0\n0\n0\n128\n0\n0\n0\n128\n8\n6\n0\n0\n0\n195\n62\n97\n203\n0\n0\n0\n1\n115\n82\n71\n66\n0\n174\n206\n28\n233\n0\n0\n0\n6\n98\n75\n71\n68\n0\n255\n0\n255\n0\n255\n160\n189\n167\n147\n0\n0\n0\n9\n112\n72\n89\n115\n0\n0\n14\n193\n0\n0\n14\n193\n1\n184\n145\n107\n237\n0\n0\n0\n7\n116\n73\n77\n69\n7\n220\n1\n19\n1\n25\n27\n198\n67\n173\n246\n0\n0\n21\n40\n73\n68\n65\n84\n120\n218\n237\n93\n123\n108\n92\n85\n122\n255\n157\n153\n59\n30\n143\n199\n99\n143\n31\n227\n119\n28\n54\n118\n60\n155\n134\n215\n38\n149\n86\n108\n121\n132\n208\n77\n200\n6\n104\n233\n110\n27\n160\n136\n173\n90\n181\n37\n130\n85\n41\n116\n181\n168\n21\n141\n171\n44\n8\n164\n236\n110\n212\n118\n31\n168\n176\n170\n22\n85\n33\n44\n93\n160\n2\n20\n40\n27\n178\n148\n135\n20\n178\n4\n130\n201\n146\n144\n135\n99\n199\n73\n198\n227\n199\n216\n158\n135\n61\n158\n241\n237\n31\n73\n198\n115\n39\n247\n222\n243\n188\n51\n99\n199\n71\n178\n146\n153\n51\n231\n245\n157\n239\n124\n175\n243\n125\n223\n33\n96\n40\n186\n174\n235\n102\n223\n19\n66\n8\n79\n61\n33\n132\n228\n255\n223\n108\n28\n179\n239\n11\n199\n176\n251\n141\n85\n29\n239\n218\n104\n99\n137\n182\n47\n252\n189\n21\n12\n105\n237\n242\n127\n199\n58\n135\n66\n216\n235\n186\n174\n107\n44\n0\n98\n217\n20\n150\n250\n252\n207\n133\n253\n94\n172\n51\n27\n207\n172\n31\n222\n141\n150\n45\n180\n13\n146\n217\n48\n179\n141\n177\n90\n163\n221\n161\n51\n131\n231\n197\n241\n204\n230\n71\n8\n33\n46\n17\n0\n208\n6\n151\n61\n133\n188\n192\n46\n68\n32\n187\n113\n236\n234\n201\n133\n98\n213\n119\n126\n189\n25\n69\n202\n239\n95\n244\n208\n176\n192\n202\n170\n15\n61\n175\n216\n33\n93\n62\n66\n104\n172\n3\n211\n54\n152\n134\n32\n188\n36\n244\n226\n36\n205\n234\n205\n78\n12\n141\n66\n216\n81\n31\n179\n245\n217\n33\n161\n221\n41\n182\n163\n110\n188\n164\n155\n151\n37\n89\n81\n84\n59\n68\n213\n156\n38\n129\n86\n11\n189\n248\n123\n90\n189\n44\n2\n161\n196\n197\n14\n89\n11\n97\n192\n34\n231\n168\n46\n174\n98\n80\n0\n26\n178\n208\n78\n163\n221\n124\n104\n245\n170\n40\n152\n147\n44\n144\n214\n158\n151\n82\n20\n34\n146\n21\n139\n226\n146\n1\n236\n120\n36\n11\n127\n98\n221\n48\n59\n193\n71\n244\n179\n236\n252\n105\n60\n158\n38\n35\n240\n242\n245\n252\n207\n188\n130\n182\n213\n188\n173\n88\n152\n20\n153\n101\n85\n3\n85\n75\n224\n86\n27\n160\n146\n133\n168\n84\n3\n105\n20\n209\n138\n93\n176\n168\n191\n44\n66\n167\n157\n26\n72\n68\n121\n165\n157\n160\n69\n251\n158\n38\n196\n137\n168\n61\n34\n252\n88\n117\n253\n66\n44\n26\n239\n194\n236\n132\n46\n17\n1\n204\n202\n72\n100\n198\n115\n11\n79\n134\n200\n56\n162\n90\n130\n44\n130\n201\n34\n79\n225\n73\n102\n29\n131\n70\n161\n92\n188\n58\n38\n43\n82\n200\n234\n187\n44\n60\n88\n134\n204\n243\n8\n125\n34\n243\n228\n65\n12\n17\n62\n79\n83\n67\n153\n231\n76\n35\n191\n44\n228\n89\n53\n11\n176\n162\n6\n52\n83\n114\n41\n88\n128\n44\n252\n100\n13\n71\n118\n99\n176\n200\n104\n26\n171\n74\n162\n242\n68\n243\n78\n84\n181\n144\n202\n139\n68\n118\n237\n105\n200\n46\n139\n180\n102\n237\n105\n54\n150\n66\n182\n97\n39\n136\n186\n88\n213\n36\n187\n58\n59\n53\n198\n172\n45\n15\n249\n182\n163\n28\n50\n214\n51\n145\n241\n89\n205\n209\n86\n106\n41\n139\n153\n218\n204\n156\n43\n59\n127\n59\n59\n131\n50\n45\n192\n78\n213\n161\n177\n0\n22\n235\n161\n93\n91\n86\n53\n116\n73\n11\n48\n129\n145\n147\n102\n79\n213\n253\n138\n96\n191\n172\n158\n127\n217\n23\n22\n190\n76\n179\n90\n177\n222\n212\n241\n240\n95\n158\n121\n178\n174\n193\n74\n218\n118\n82\n254\n41\n245\n126\n186\n202\n105\n82\n52\n96\n219\n233\n191\n162\n183\n107\n133\n194\n146\n149\n236\n163\n226\n26\n183\n28\n224\n204\n77\n241\n88\n117\n84\n150\n59\n106\n179\n13\n86\n113\n117\n44\n74\n25\n84\n140\n207\n170\n127\n151\n11\n2\n148\n4\n115\n121\n144\n68\n116\n243\n89\n47\n79\n84\n35\n0\n171\n1\n141\n101\n141\n78\n180\n151\n222\n71\n85\n30\n44\n172\n11\n224\n181\n202\n177\n178\n143\n203\n153\n2\n148\n156\n250\n216\n157\n78\n22\n228\n176\n3\n178\n168\n9\n84\n84\n208\n85\n189\n9\n197\n144\n45\n164\n198\n40\n6\n11\n144\n213\n2\n100\n88\n64\n169\n181\n0\n167\n17\n96\n49\n105\n48\n151\n173\n154\n237\n184\n33\n72\n214\n231\n158\n213\n105\n129\n102\n120\n97\n181\n242\n241\n152\n97\n89\n218\n171\n154\n127\n41\n212\n52\n150\n54\n182\n243\n231\n37\n177\n188\n36\n154\n215\n144\n35\n162\n38\n242\n176\n22\n167\n63\n139\n158\n112\n25\n74\n32\n179\n126\n141\n165\n35\n150\n43\n71\n75\n18\n195\n232\n100\n194\n66\n25\n172\n78\n47\n171\n171\n116\n57\n179\n1\n158\n235\n96\n179\n203\n38\n90\n32\n9\n179\n128\n38\n99\n80\n17\n9\n202\n144\n61\n81\n178\n42\n38\n139\n29\n66\n133\n30\n94\n12\n25\n64\n104\n253\n102\n87\n185\n170\n172\n112\n34\n27\n40\n19\n110\n38\n50\n127\n167\n72\n122\n169\n52\n45\n222\n122\n151\n44\n153\n164\n93\n11\n179\n220\n198\n229\n151\n114\n86\n99\n88\n226\n22\n69\n230\n111\n199\n98\n89\n14\n8\n139\n32\n104\n85\n175\n21\n14\n78\n115\n150\n100\n149\n180\n173\n22\n39\n226\n200\n96\n215\n222\n233\n254\n237\n214\n173\n84\n29\n179\n224\n227\n44\n18\n190\n10\n57\n107\n169\n44\n82\n61\n159\n86\n52\n179\n73\n242\n232\n201\n44\n206\n26\n50\n237\n85\n4\n133\n208\n188\n149\n104\n159\n85\n107\n52\n118\n227\n241\n254\n158\n165\n63\n46\n59\n128\n21\n217\n47\n151\n207\n170\n132\n31\n94\n59\n136\n140\n144\n43\n211\n119\n161\n153\n219\n74\n136\n22\n133\n167\n198\n194\n231\n120\n128\n168\n194\n46\n192\n203\n131\n89\n121\n180\n136\n12\n163\n146\n13\n136\n242\n224\n124\n249\n192\n46\n212\n92\n164\n127\n141\n117\n2\n60\n36\n89\n181\n176\n161\n10\n169\n88\n66\n209\n157\n64\n6\n90\n68\n143\n42\n24\n136\n204\n221\n181\n208\n132\n150\n133\n92\n84\n184\n150\n169\n166\n174\n154\n76\n99\n85\n186\n244\n66\n151\n242\n23\n242\n122\n52\n158\n240\n101\n17\n25\n128\n71\n207\n102\n149\n65\n120\n131\n58\n100\n236\n4\n118\n201\n171\n84\n244\n47\n187\n62\n167\n215\n191\n84\n22\n59\n91\n114\n90\n143\n103\n209\n195\n121\n132\n202\n114\n252\n204\n42\n84\n242\n230\n70\n228\n209\n176\n132\n89\n81\n169\n245\n120\n218\n239\n138\n49\n31\n21\n129\n45\n50\n235\n87\n229\n243\n32\n34\n96\n106\n34\n214\n46\n213\n50\n64\n185\n72\n231\n118\n129\n177\n172\n158\n55\n165\n72\n96\n89\n24\n137\n204\n51\n7\n77\n197\n166\n208\n236\n0\n78\n219\n9\n84\n1\n81\n102\n110\n178\n58\n190\n104\n123\n222\n203\n35\n170\n29\n96\n33\n235\n214\n34\n105\n109\n205\n78\n80\n41\n84\n65\n167\n109\n4\n74\n16\n192\n137\n100\n204\n197\n62\n225\n75\n118\n0\n11\n67\n16\n11\n102\n138\n144\n170\n98\n220\n215\n179\n240\n112\n39\n79\n25\n235\n141\n38\n171\n57\n215\n105\n211\n180\n97\n204\n37\n77\n120\n113\n23\n234\n117\n121\n185\n133\n61\n171\n142\n236\n145\n29\n79\n54\n216\n180\n220\n35\n119\n180\n197\n130\n229\n78\n241\n97\n21\n249\n136\n202\n90\n6\n96\n225\n235\n172\n145\n67\n118\n214\n46\n187\n246\n60\n169\n210\n172\n248\n43\n143\n63\n3\n111\n100\n17\n111\n74\n26\n39\n94\n52\n177\n123\n248\n129\n117\n109\n74\n16\n84\n181\n71\n138\n93\n118\n49\n86\n146\n42\n27\n25\n196\n51\n127\n81\n22\n32\n155\n192\n130\n53\n114\n74\n216\n35\n72\n134\n79\n201\n166\n92\n163\n233\n194\n142\n75\n194\n14\n147\n237\n114\n86\n21\n185\n223\n12\n82\n33\n52\n22\n147\n175\n58\n109\n96\n97\n245\n201\n151\n69\n2\n167\n16\n72\n83\n1\n64\n153\n187\n0\n158\n116\n170\n42\n4\n179\n82\n73\n221\n118\n126\n255\n78\n11\n177\n182\n240\n191\n220\n244\n96\n39\n0\n189\n228\n112\n81\n34\n221\n127\n161\n173\n81\n214\n45\n156\n245\n55\n11\n14\n158\n139\n29\n1\n84\n4\n214\n178\n230\n79\n226\n133\n165\n139\n37\n203\n150\n93\n14\n30\n158\n246\n118\n106\n94\n169\n28\n66\n84\n124\n118\n50\n124\n156\n71\n190\n161\n37\n244\n22\n34\n31\n44\n122\n186\n172\n30\n93\n202\n12\n31\n52\n36\n228\n89\n143\n211\n42\n172\n108\n22\n52\n179\n246\n92\n225\n225\n44\n79\n180\n89\n73\n185\n165\n206\n185\n203\n162\n105\n168\n12\n147\n103\n213\n114\n120\n88\n128\n108\n86\n119\n179\n185\n80\n93\n194\n84\n232\n209\n78\n122\n4\n21\n134\n77\n201\n0\n201\n78\n77\n91\n168\n134\n30\n42\n252\n100\n109\n221\n60\n247\n8\n118\n84\n132\n199\n155\n71\n230\n229\n113\n26\n66\n138\n68\n235\n178\n80\n74\n209\n187\n6\n21\n143\n77\n217\n205\n79\n83\n113\n2\n89\n234\n31\n248\n223\n14\n244\n252\n126\n19\n0\n96\n247\n209\n71\n240\n103\n43\n111\n196\n65\n28\n197\n26\n242\n93\n106\n63\n44\n139\n23\n109\n207\n251\n10\n184\n168\n15\n158\n29\n251\n220\n182\n109\n27\n38\n83\n41\n180\n181\n183\n227\n200\n167\n159\n162\n177\n179\n19\n201\n68\n2\n255\n250\n212\n83\n202\n252\n53\n127\n248\n200\n245\n120\n248\n7\n239\n230\n190\n127\n237\n71\n91\n176\n249\n239\n119\n159\n191\n13\n124\n227\n241\n123\n245\n79\n142\n159\n133\n166\n185\n17\n29\n143\n227\n236\n232\n20\n218\n26\n107\n240\n196\n11\n239\n17\n0\n248\n135\n87\n191\n161\n207\n206\n206\n98\n124\n124\n28\n219\n222\n254\n83\n108\n221\n125\n147\n62\n54\n54\n134\n221\n91\n63\n37\n0\n176\n225\n186\n30\n189\n165\n190\n18\n203\n155\n3\n136\n140\n39\n224\n118\n187\n225\n114\n17\n180\n124\n115\n165\n139\n16\n232\n99\n145\n120\n186\n102\n172\n210\n147\n220\n235\n77\n111\n223\n29\n38\n71\n62\n58\n67\n190\n127\n240\n249\n169\n80\n91\n77\n61\n0\n188\n245\n179\n191\n212\n251\n135\n35\n104\n171\n175\n71\n36\n22\n195\n242\n80\n51\n116\n125\n14\n183\n220\n255\n115\n162\n235\n58\n238\n186\n235\n46\n253\n240\n225\n195\n216\n178\n101\n11\n182\n111\n223\n142\n205\n155\n55\n163\n191\n191\n31\n31\n125\n244\n17\n1\n128\n199\n158\n63\n50\n252\n121\n95\n2\n154\n155\n32\n20\n244\n226\n204\n88\n10\n171\n86\n87\n7\n183\n223\n21\n174\n0\n128\n109\n219\n182\n233\n83\n83\n83\n104\n105\n105\n193\n137\n19\n39\n16\n10\n133\n144\n74\n165\n176\n99\n199\n14\n66\n171\n191\n176\n65\n185\n250\n251\n239\n191\n95\n207\n175\n215\n117\n29\n189\n189\n189\n150\n237\n105\n245\n23\n241\n204\n29\n143\n35\n59\n50\n130\n234\n234\n106\n212\n76\n78\n162\n98\n102\n6\n0\n200\n35\n191\n209\n161\n235\n176\n200\n208\n6\n178\n227\n70\n160\n192\n191\n3\n102\n56\n67\n8\n50\n223\n90\n223\n181\n166\n174\n198\n91\n125\n242\n244\n120\n252\n236\n232\n228\n39\n221\n29\n94\n226\n202\n33\n184\n14\n100\n102\n179\n88\n119\n237\n10\n120\n43\n52\n116\n183\n55\n228\n26\n183\n86\n54\n96\n121\n67\n59\n106\n106\n106\n144\n76\n38\n209\n54\n214\n0\n207\n240\n60\n241\n136\n199\n227\n168\n246\n185\n241\n65\n223\n25\n172\n9\n183\n98\n50\n49\n131\n254\n51\n147\n185\n250\n186\n166\n106\n226\n241\n184\n145\n201\n100\n9\n0\n196\n162\n113\n61\n61\n51\n171\n15\n15\n77\n26\n38\n153\n205\n100\n208\n119\n116\n4\n110\n55\n201\n199\n96\n0\n64\n34\n145\n192\n211\n79\n63\n141\n157\n59\n119\n2\n0\n86\n174\n92\n153\n251\n205\n244\n168\n30\n106\n168\n169\n8\n133\n26\n42\n67\n196\n77\n66\n173\n141\n254\n80\n52\n6\n143\n161\n239\n108\n22\n167\n79\n159\n70\n56\n28\n6\n33\n4\n126\n191\n63\n7\n48\n0\n104\n173\n241\n0\n241\n17\n132\n195\n97\n116\n214\n121\n17\n110\n171\n55\n204\n109\n116\n116\n20\n125\n125\n125\n248\n224\n189\n247\n16\n141\n70\n145\n74\n165\n12\n243\n187\n230\n247\n226\n8\n213\n29\n69\n56\n28\n198\n234\n213\n13\n88\n187\n182\n195\n80\n239\n90\n126\n53\n34\n21\n33\n132\n195\n97\n180\n118\n173\n198\n138\n43\n215\n26\n198\n175\n25\n27\n195\n228\n225\n195\n232\n232\n232\n192\n151\n70\n70\n240\n229\n120\n220\n104\n175\n53\n251\n187\n208\n191\n174\n235\n185\n63\n43\n130\n65\n8\n57\n19\n240\n87\n236\n2\n240\n108\n115\n125\n245\n174\n143\n143\n12\n233\n55\n173\n233\n58\n175\n5\n28\n63\n59\n134\n153\n76\n22\n167\n34\n49\n28\n63\n59\n134\n186\n234\n74\n188\n251\n105\n127\n110\n130\n190\n151\n71\n145\n248\n143\n126\n104\n191\n152\n194\n208\n83\n39\n113\n234\n87\n199\n225\n125\n55\n155\n235\n252\n218\n47\n183\n193\n235\n173\n196\n85\n43\n91\n112\n248\n212\n56\n8\n33\n136\n77\n38\n241\n216\n150\n93\n250\n233\n227\n163\n208\n103\n181\n209\n192\n205\n71\n225\n107\n202\n122\n102\n43\n38\n60\n117\n77\n213\n83\n21\n94\n207\n193\n127\n190\n107\n87\n129\n78\n226\n198\n166\n175\n173\n194\n192\n240\n48\n166\n207\n159\n128\n92\n185\n247\n222\n123\n81\n95\n95\n143\n103\n158\n121\n6\n183\n221\n118\n27\n214\n173\n91\n151\n171\n75\n207\n206\n225\n150\n27\n27\n17\n29\n157\n70\n77\n147\n11\n169\n212\n44\n18\n209\n105\n227\n6\n183\n182\n194\n227\n241\n96\n104\n104\n8\n13\n13\n13\n8\n6\n131\n134\n13\n202\n86\n214\n33\n146\n200\n98\n104\n104\n8\n73\n119\n0\n113\n226\n51\n140\n191\n106\n213\n42\n52\n54\n54\n226\n134\n155\n110\n66\n56\n28\n70\n119\n119\n183\n161\n254\n236\n200\n10\n244\n125\n94\n139\n161\n161\n33\n68\n34\n4\n231\n206\n25\n15\n109\n99\n234\n28\n48\n216\n135\n161\n161\n33\n204\n78\n68\n48\n51\n126\n46\n55\n190\n166\n105\n240\n94\n121\n37\n92\n21\n21\n24\n138\n70\n49\n220\n209\n129\n115\n107\n215\n178\n242\n120\n16\n66\n114\n127\n22\n153\n224\n224\n113\n107\n254\n190\n223\n69\n54\n206\n204\n100\n239\n60\n124\n50\n186\n241\n134\n107\n175\n136\n63\n251\n63\n135\n207\n35\n64\n87\n107\n61\n146\n158\n58\n212\n180\n116\n162\n171\n181\n30\n87\n119\n181\n34\n20\n244\n231\n58\n184\n88\n239\n107\n236\n192\n95\n220\n186\n22\n235\n215\n116\n161\n177\n118\n254\n4\n205\n205\n205\n97\n98\n42\n5\n143\n27\n232\n106\n169\n66\n85\n133\n39\n55\n145\n80\n91\n45\n136\n39\n83\n31\n219\n19\n78\n167\n134\n221\n179\n254\n108\n115\n186\n102\n195\n145\n122\n66\n200\n154\n237\n187\n239\n206\n141\n113\n69\n83\n51\n252\n222\n74\n12\n142\n68\n49\n112\n38\n129\n42\n223\n252\n6\n172\n91\n183\n14\n135\n14\n29\n194\n61\n247\n220\n131\n238\n238\n110\n28\n56\n112\n0\n110\n183\n123\n158\n66\n53\n120\n241\n254\n254\n113\n120\n61\n46\n140\n159\n1\n234\n2\n21\n88\n214\n52\n223\n62\n24\n12\n34\n145\n72\n160\n165\n165\n5\n126\n191\n31\n83\n83\n83\n185\n141\n215\n117\n29\n193\n96\n16\n117\n158\n12\n238\n190\n182\n1\n126\n191\n31\n43\n188\n113\n232\n48\n214\n15\n14\n14\n226\n195\n15\n63\n68\n32\n16\n192\n222\n189\n123\n161\n105\n154\n161\n190\n163\n163\n10\n59\n118\n36\n225\n247\n251\n241\n173\n77\n251\n145\n205\n186\n13\n227\n215\n52\n117\n160\n243\n193\n29\n240\n251\n253\n24\n189\n246\n155\n32\n115\n243\n7\n168\n170\n170\n10\n158\n247\n223\n199\n242\n215\n94\n195\n149\n163\n163\n112\n237\n217\n99\n184\n164\n177\n33\n0\n185\n57\n92\n252\n195\n78\n162\n155\n33\n72\n103\n83\n40\n113\n197\n178\n224\n27\n46\n23\n121\n105\n229\n178\n250\n55\n64\n220\n213\n119\n111\n232\n158\n167\n0\n115\n19\n231\n128\n169\n8\n246\n125\n124\n2\n209\n137\n4\n134\n199\n231\n73\n16\n173\n158\n16\n130\n68\n114\n6\n110\n23\n193\n231\n131\n19\n232\n233\n12\n34\n88\n83\n117\n126\n113\n237\n105\n196\n70\n226\n158\n217\n217\n44\n116\n29\n72\n103\n167\n201\n228\n155\n225\n217\n200\n96\n172\n80\n184\n194\n217\n241\n49\n44\n107\n12\n225\n43\n61\n45\n152\n203\n195\n228\n125\n251\n246\n225\n142\n59\n238\n192\n169\n83\n167\n0\n0\n107\n214\n172\n65\n54\n59\n15\n192\n145\n137\n52\n70\n39\n102\n224\n113\n17\n76\n198\n83\n136\n198\n102\n112\n242\n76\n50\n87\n31\n139\n197\n208\n216\n216\n136\n153\n11\n84\n165\n186\n186\n218\n112\n82\n98\n177\n24\n218\n171\n9\n94\n58\n54\n139\n191\n186\n121\n53\n14\n79\n85\n130\n192\n88\n63\n48\n48\n128\n245\n235\n215\n163\n175\n175\n15\n27\n54\n108\n64\n38\n147\n49\n212\n175\n255\n234\n126\n124\n239\n209\n70\n244\n246\n246\n226\n23\n255\n125\n37\n220\n238\n172\n161\n254\n92\n247\n205\n24\n126\n250\n123\n232\n237\n237\n133\n239\n253\n231\n160\n187\n230\n17\n100\n98\n98\n2\n85\n3\n3\n24\n124\n252\n113\n108\n254\n229\n47\n145\n120\n232\n33\n204\n165\n211\n60\n130\n94\n238\n239\n246\n95\n245\n152\n82\n128\n233\n153\n89\n255\n209\n83\n209\n141\n186\n174\n223\n57\n18\n79\n110\n36\n208\n227\n187\n222\n60\n6\n23\n33\n4\n131\n145\n24\n66\n65\n63\n54\n125\n53\n140\n254\n115\n227\n88\n217\n86\n135\n85\n215\n111\n202\n117\n64\n171\n63\n118\n122\n18\n201\n153\n44\n14\n30\n57\n139\n207\n142\n71\n81\n237\n175\n130\n203\n117\n62\n228\n32\n51\n90\n133\n218\n166\n74\n212\n46\n67\n69\n99\n15\n60\n68\n203\n122\n134\n7\n38\n198\n103\n103\n50\n7\n31\n219\n178\n43\n183\n17\n233\n116\n26\n110\n151\n11\n131\n35\n81\n64\n215\n49\n125\n129\n199\n94\n172\n63\n118\n236\n24\n154\n154\n154\n240\n242\n203\n47\n163\n178\n178\n18\n135\n14\n29\n154\n103\n81\n94\n55\n90\n27\n124\n168\n171\n245\n226\n246\n13\n45\n23\n172\n91\n70\n25\n34\n153\n76\n194\n227\n241\n32\n18\n137\n192\n229\n114\n33\n145\n72\n24\n128\n20\n157\n173\n64\n79\n83\n53\n158\n120\n126\n47\n124\n94\n207\n37\n245\n61\n61\n61\n152\n152\n152\n64\n91\n91\n27\n230\n230\n230\n46\n169\n63\n248\n89\n39\n214\n253\n193\n28\n182\n110\n221\n10\n191\n223\n127\n73\n125\n213\n224\n65\n212\n94\n179\n206\n180\n158\n16\n130\n248\n13\n55\n160\n238\n208\n33\n124\n127\n211\n38\n4\n127\n251\n91\n36\n162\n81\n33\n169\n63\n57\n157\n49\n69\n16\n125\n46\n155\n8\n95\n17\n122\n3\n192\n75\n157\n77\n193\n55\n146\n169\n233\n234\n63\n191\n117\n229\n124\n96\n136\n191\n202\n139\n137\n196\n52\n174\n104\n169\n195\n111\n62\n57\n133\n206\n153\n227\n6\n0\n218\n213\n39\n147\n73\n100\n179\n153\n220\n231\n116\n58\n141\n185\n185\n57\n0\n192\n208\n241\n81\n184\n116\n109\n44\n53\n236\n30\n27\n253\n2\n99\n122\n198\n61\n214\n212\n89\n171\n181\n119\n53\n24\n250\n247\n120\n60\n104\n170\n61\n207\n151\n199\n147\n73\n84\n120\n189\n134\n250\n215\n95\n127\n29\n47\n190\n248\n34\n118\n238\n220\n137\n39\n159\n124\n18\n251\n247\n239\n207\n213\n15\n68\n82\n56\n126\n38\n137\n200\n248\n52\n222\n122\n39\n138\n134\n160\n145\n5\n0\n192\n200\n200\n8\n34\n145\n8\n194\n225\n48\n250\n251\n251\n17\n139\n197\n12\n253\n247\n157\n60\n135\n3\n95\n12\n225\n161\n141\n171\n177\n174\n37\n3\n119\n122\n202\n80\n175\n235\n58\n222\n254\n245\n175\n209\n223\n223\n143\n23\n94\n120\n1\n39\n79\n158\n52\n212\n239\n253\n191\n25\n188\n186\n39\n142\n159\n254\n244\n118\n124\n231\n65\n23\n154\n234\n79\n25\n17\n236\n163\n183\n113\n250\n221\n87\n241\n237\n109\n63\n193\n178\n59\n191\n131\n177\n202\n38\n163\n12\n17\n8\n224\n100\n115\n51\n174\n219\n183\n15\n190\n231\n158\n67\n186\n191\n159\n153\n5\n228\n151\n180\n5\n229\n200\n2\n193\n147\n167\n199\n55\n214\n250\n125\n119\n30\n31\n26\n219\n232\n209\n220\n51\n255\n181\n231\n139\n243\n118\n128\n101\n205\n65\n124\n208\n119\n10\n205\n117\n213\n248\n195\n181\n221\n120\n243\n192\n23\n56\n51\n54\n149\n107\n76\n171\n215\n117\n29\n183\n126\n173\n27\n111\n125\n56\n128\n111\n92\n215\n142\n153\n217\n76\n14\n33\n218\n187\n26\n144\n83\n52\n116\n160\n186\n198\n139\n216\n72\n2\n21\n149\n6\n33\n29\n253\n195\n17\n52\n7\n235\n176\n172\n49\n132\n72\n44\n6\n183\n203\n24\n180\n212\n209\n209\n129\n193\n193\n65\n236\n219\n183\n15\n247\n221\n119\n31\n94\n121\n229\n149\n92\n221\n151\n218\n170\n16\n29\n79\n195\n227\n38\n104\n15\n85\n226\n208\n137\n41\n120\n61\n110\n67\n123\n159\n207\n135\n84\n42\n133\n88\n44\n134\n182\n182\n54\n68\n11\n78\n152\n207\n231\n3\n82\n41\n236\n250\n120\n4\n129\n64\n0\n49\n163\n12\n10\n159\n207\n135\n91\n190\n254\n117\n4\n2\n1\n4\n2\n1\n243\n246\n72\n161\n183\n119\n255\n133\n250\n122\n147\n122\n96\n207\n207\n254\n5\n129\n64\n0\n30\n99\n251\n3\n190\n138\n10\n32\n153\n196\n225\n135\n31\n70\n109\n77\n13\n210\n3\n3\n181\n172\n228\n191\n144\n220\n231\n151\n171\n195\n15\n226\n170\n158\n7\n112\n110\n252\n147\n183\n123\n150\n55\n190\n147\n201\n102\n245\n174\n246\n122\n226\n214\n60\n191\n187\n119\n83\n15\n132\n34\n88\n120\n45\n117\n172\n49\n242\n118\n94\n175\n118\n115\n74\n164\n50\n250\n220\n156\n14\n16\n224\n231\n175\n13\n53\n125\n240\n89\n12\n149\n30\n151\n235\n63\n255\n233\n234\n8\n75\n123\n218\n248\n178\n121\n250\n120\n96\n232\n148\n87\n239\n138\n102\n159\n97\n143\n78\n68\n82\n4\n80\n224\n17\n68\n179\n195\n171\n2\n144\n42\n211\n180\n172\n57\n213\n41\n143\n34\n171\n76\n98\n170\n214\n247\n149\n21\n117\n186\n215\n13\n84\n92\n32\n172\n239\n28\n25\n39\n57\n127\n0\n150\n100\n196\n44\n119\n246\n118\n57\n236\n46\n22\n43\n36\n97\n245\n39\n144\n53\n229\n138\n124\n206\n79\n102\n45\n122\n221\n204\n122\n27\n202\n115\n175\n194\n178\n55\n133\n229\n145\n191\n254\n91\n156\n142\n77\n95\n122\n29\n108\n151\n177\n155\n37\n81\n33\n141\n188\n219\n1\n80\n182\n222\n169\n251\n119\n149\n167\n155\n246\n148\n189\n232\n171\n169\n140\n129\n61\n0\n128\n173\n127\n188\n25\n0\n240\n163\n239\n254\n157\n17\n1\n88\n31\n109\n92\n202\n33\n168\n142\n85\n153\n29\n30\n209\n155\n82\n6\n207\n106\n124\n251\n250\n107\n0\n0\n63\n248\n247\n127\n195\n37\n254\n0\n162\n2\n210\n98\n40\n197\n72\n204\n224\n100\n76\n128\n29\n245\n205\n149\n71\n31\n213\n31\n90\n181\n10\n0\n240\n143\n71\n143\n226\n143\n66\n171\n204\n41\n128\n25\n37\n40\n204\n192\n193\n251\n44\n12\n77\n6\n80\n93\n79\n147\n65\n172\n128\n72\n99\n127\n50\n243\n203\n135\n141\n93\n108\n163\n8\n252\n88\n238\n10\n242\n203\n19\n127\n242\n128\n241\n250\n133\n152\n20\n59\n0\n89\n45\n144\n181\n61\n239\n6\n240\n214\n243\n206\n191\n16\n249\n157\n154\n191\n213\n41\n229\n133\n191\n0\n245\n192\n142\n129\n247\n241\n236\n103\n111\n231\n190\n203\n255\n191\n70\n211\n69\n121\n108\n3\n34\n89\n189\n85\n191\n7\n192\n171\n71\n171\n72\n228\n204\n43\n4\n58\n161\n230\n137\n22\n151\n25\n166\n209\n190\n179\n227\n71\n52\n126\n101\n213\n191\n29\n133\n225\n57\n33\n188\n90\n4\n171\n250\n165\n194\n177\n149\n215\n221\n140\n71\n240\n182\n113\n219\n55\n252\n110\n253\n143\n103\n46\n69\n0\n22\n27\n0\n109\n112\n209\n103\n225\n88\n109\n16\n162\n237\n69\n173\n153\n86\n155\n194\n43\n52\n202\n166\n186\n231\n121\n165\n196\n66\n6\n177\n220\n124\n83\n75\n96\n177\n159\n52\n97\n77\n197\n106\n71\n170\n85\n153\n162\n89\n129\n91\n248\n127\n150\n77\n19\n57\n253\n60\n237\n104\n191\n187\n170\n231\n1\n61\n20\n60\n175\n10\n238\n221\n255\n55\n132\n153\n2\n44\n4\n85\n77\n70\n136\n226\n201\n0\n106\n181\n217\n52\n33\n141\n134\n48\n249\n253\n243\n238\n1\n205\n72\n103\n198\n6\n12\n44\n160\n144\n71\n46\n52\n125\n157\n102\n202\n150\n125\n152\n178\n112\n227\n74\n149\n77\n84\n20\n9\n236\n252\n4\n1\n139\n247\n2\n100\n54\n198\n137\n192\n18\n187\n190\n84\n240\n88\n150\n60\n132\n162\n60\n159\n135\n229\n201\n192\n202\n74\n213\n164\n77\n157\n106\n9\n148\n245\n201\n231\n237\n159\n247\n179\n42\n196\n114\n146\n114\n241\n32\n151\n83\n235\n173\n109\n250\n4\n93\n171\n210\n23\n100\n0\n6\n210\n103\n22\n240\n105\n246\n175\n213\n179\n102\n44\n129\n164\n44\n150\n68\n214\n122\n218\n216\n42\n244\n121\n214\n181\n137\n140\n175\n162\n127\n169\n240\n240\n66\n94\n87\n40\n241\n90\n253\n107\n214\n110\n233\n210\n104\n225\n20\n173\n112\n163\n205\n62\n219\n33\n129\n153\n205\n90\n37\n18\n20\n235\n77\n63\n30\n75\n164\n170\n249\n171\n128\n147\n108\n123\n205\n110\n227\n89\n40\n64\n161\n116\n156\n79\n134\n84\n240\n175\n98\n189\n233\n199\n163\n211\n203\n202\n23\n42\n61\n140\n100\n225\n163\n156\n2\n152\n81\n3\n25\n12\n118\n178\n158\n55\n3\n154\n200\n134\n137\n188\n141\n204\n107\n9\n149\n161\n112\n210\n20\n160\n80\n248\n144\n49\n149\n202\n92\n12\n209\n108\n252\n86\n243\n147\n237\n159\n117\n125\n34\n119\n16\n170\n235\n77\n51\n132\n216\n9\n127\n102\n70\n134\n194\n127\n89\n76\n181\n75\n165\n124\n139\n180\n22\n96\n103\n238\n92\n66\n132\n5\n164\n5\n208\n72\n160\n21\n233\n84\n105\n184\n80\n145\n18\n86\n133\n95\n190\n25\n2\n211\n12\n58\n178\n6\n33\n218\n248\n178\n243\n183\n164\n0\n75\n103\n224\n50\n167\n0\n139\n113\n81\n170\n212\n44\n218\n45\n158\n10\n29\n157\n55\n14\n64\n197\n248\n249\n223\n47\n74\n4\n112\n66\n119\n231\n233\n219\n201\n241\n85\n183\n215\n156\n208\n189\n121\n12\n33\n78\n156\n112\n153\n247\n118\n69\n222\n66\n22\n145\n85\n138\n213\n63\n23\n2\n200\n98\n30\n207\n243\n104\n229\n208\n191\n74\n193\n78\n132\n28\n171\n132\n147\n168\n21\n115\n73\n8\n188\n220\n237\n0\n75\n32\n184\n188\n11\n81\n165\n135\n170\n208\n83\n157\n52\n32\n169\n24\n95\n70\n63\n23\n37\n243\n188\n119\n17\n220\n254\n0\n75\n103\n96\n201\n14\n224\n40\n6\n171\n148\n242\n157\n184\n174\n165\n197\n34\n44\n118\n115\n54\n211\n163\n81\n229\n166\n199\n171\n206\n54\n94\n12\n22\n84\n182\n50\n64\n177\n222\n228\n99\n185\n14\n117\n226\n58\n184\n152\n8\n90\n140\n57\n168\n150\n25\n52\n209\n11\n7\n94\n33\n75\n165\n5\n141\n245\n241\n73\n171\n211\n237\n180\n16\n90\n14\n207\n212\n45\n9\n129\n75\n101\n9\n1\n150\n10\n135\n29\n160\n84\n69\n212\n85\n170\n216\n227\n171\n184\n127\n80\n121\n75\n105\n199\n106\n120\n238\n55\n136\n8\n144\n88\n120\n28\n139\n112\n102\n198\n143\n101\n157\n33\n236\n62\n179\n202\n8\n188\n242\n77\n49\n229\n11\n153\n185\n155\n125\n166\n2\n136\n21\n184\n118\n27\n200\n3\n64\n145\n83\n74\n243\n103\n44\n252\n63\n13\n137\n105\n115\n19\n93\n15\n237\n123\n17\n13\n138\n215\n122\n89\n248\n217\n197\n122\n2\n89\n253\n253\n69\n162\n140\n105\n161\n211\n102\n26\n133\n76\n214\n18\n171\n205\n162\n205\n67\n52\n228\n204\n238\n109\n69\n59\n141\n201\n10\n230\n102\n243\n20\n157\n159\n203\n12\n48\n118\n49\n246\n78\n168\n54\n11\n193\n0\n67\n75\n146\n85\n24\n55\n105\n118\n160\n156\n14\n66\n21\n25\n195\n101\n182\n17\n180\n192\n67\n167\n46\n137\n204\n78\n139\n232\n73\n227\n181\n41\n176\n158\n54\n213\n48\n176\n58\n205\n118\n135\n142\n149\n106\n177\n20\n205\n204\n191\n223\n204\n187\n214\n233\n211\n73\n227\n115\n172\n236\n71\n116\n19\n236\n250\n183\n155\n3\n45\n183\n144\n89\n230\n15\n39\n158\n158\n19\n61\n160\n100\n161\n147\n103\n39\n30\n86\n44\n167\n245\n58\n13\n127\n229\n102\n96\n217\n197\n176\n232\n179\n50\n115\n16\n25\n215\n73\n74\n199\n146\n245\n196\n201\n185\n153\n166\n139\n23\n73\n84\n68\n227\n67\n60\n155\n175\n90\n216\n180\n75\n100\n225\n228\n184\n162\n218\n137\n25\n66\n56\n53\n55\n141\n247\n118\n201\n106\n35\n237\n34\n115\n138\n193\n70\n88\n244\n96\n167\n4\n217\n114\n96\n5\n162\n81\n204\n26\n141\n7\n178\n90\n232\n88\n133\n40\n21\n55\n126\n60\n60\n156\n69\n144\n101\n69\n142\n82\n33\n143\n147\n227\n106\n42\n58\n101\n149\n208\n101\n98\n247\n100\n16\n133\n197\n20\n236\n20\n28\n84\n242\n111\n39\n16\n129\n148\n147\n20\n44\n106\n103\n103\n53\n191\n150\n202\n213\n203\n105\n135\n91\n41\n22\n32\n234\n101\n202\n155\n152\n161\n84\n8\n86\n76\n91\n6\n11\n245\n43\n182\n12\n164\n76\n13\n44\n37\n175\n91\n44\n78\n154\n229\n184\n142\n255\n7\n63\n147\n72\n222\n250\n184\n164\n38\n0\n0\n0\n0\n73\n69\n78\n68\n174\n66\n96\n130\n"
- file:write(font)
- file:close()
- font = {}
- fonti = 1
- file = io.open("font.txt", "r")
- file2 = io.open("default.png", "wb")
- while true do
- font[fonti] = file:read()
- if font[fonti] == nil then break end
- file2:write(font[fonti])
- fonti = fonti + 1
- end
- file:close()
- file2:close()
- print ""
- print "Font installed to this computer's root directory."
- print "Font Labeled default.png"
- print "Place this font inside your minecraft.jar/font folder"
- print "Make sure to make a backup of either your whole jar or the default.png file located within."
- print ""
- print "I AM NOT RESPONSIBLE FOR YOUR FUCK UPS"
- return
- end
- if event == "char" and param == "2" then break end
- end
- term.clear()
- term.setCursorPos(1,1)
- --- DO NOT CHANGE THESE UNLESS I TELL YOU TO
- startchunkx = -400
- endchunkx = 400
- slowcomp = false
- --------------------------------------------
- map = { {}, }
- lightmap = { {}, }
- ScreenX, ScreenY = term.getSize()
- Player = {
- x = 1,
- y = 1,
- ox = 1,
- oy = 1,
- dir = "none",
- canmove = true,
- block = nil,
- }
- p_top = "ƒ"
- p_bottom = "»"
- b_dirt = "Ç"
- b_grass = "ü"
- b_sapling = "3"
- b_air = "ì"
- b_tree = "é"
- b_leaf = "â"
- b_wood = "ä"
- b_bedrock = "à"
- b_water = "å"
- b_lava = "2"
- b_stone = "ç"
- b_iron = "ê"
- b_coal = "ë"
- b_gold = "è"
- b_diamond = "ï"
- b_redstone = "î"
- b_torch = "Ä"
- b_ladder = "Å"
- block_torch = {
- block = b_torch,
- name = "torch",
- isbreakable = true,
- gravity = false,
- isopac = true,
- isattached = true,
- }
- block_grass = {
- block = b_grass,
- name = "grass",
- isbreakable = true,
- gravity = false,
- isopac = false,
- isattached = false,
- }
- block_bedrock = {
- block = b_bedrock,
- name = "bedrock",
- isbreakable = false,
- gravity = false,
- isopac = false,
- isattached = false,
- }
- block_wood = {
- block = b_wood,
- name = "wood",
- isbreakable = true,
- gravity = true,
- isopac = false,
- isattached = false,
- }
- block_dirt = {
- block = b_dirt,
- name = "dirt",
- isbreakable = true,
- gravity = false,
- isopac = false,
- isattached = false,
- }
- block_sapling = {
- block = b_sapling,
- name = "sapling",
- isbreakable = true,
- gravity = false,
- isopac = true,
- isattached = true,
- }
- block_air = {
- block = b_air,
- name = "air",
- isbreakable = false,
- gravity = false,
- isopac = true,
- isattached = false,
- }
- block_dark = {
- block = " ",
- name = "cave",
- isbreakable = false,
- gravity = false,
- isopac = true,
- isattached = false,
- }
- block_tree = {
- block = b_tree,
- name = "tree",
- isbreakable = true,
- gravity = false,
- isopac = true,
- isattached = false,
- }
- block_leaf = {
- block = b_leaf,
- name = "leaf",
- isbreakable = true,
- gravity = false,
- isopac = false,
- isattached = false,
- }
- block_water = {
- block = b_water,
- name = "water",
- isbreakable = false,
- gravity = true,
- isopac = true,
- isattached = false,
- }
- block_stone = {
- block = b_stone,
- name = "stone",
- isbreakable = true,
- gravity = false,
- isopac = false,
- isattached = false,
- }
- block_coal = {
- block = b_coal,
- name = "coal",
- isbreakable = true,
- gravity = false,
- isopac = false,
- isattached = false,
- }
- block_diamond = {
- block = b_diamond,
- name = "diamond",
- isbreakable = true,
- gravity = false,
- isopac = false,
- isattached = false,
- }
- block_redstone = {
- block = b_redstone,
- name = "redstone",
- isbreakable = true,
- gravity = false,
- isopac = false,
- isattached = false,
- }
- block_gold = {
- block = b_gold,
- name = "gold",
- isbreakable = true,
- gravity = false,
- isopac = false,
- isattached = false,
- }
- block_iron = {
- block = b_iron,
- name = "iron",
- isbreakable = true,
- gravity = false,
- isopac = false,
- isattached = false,
- }
- block_ladder = {
- block = b_ladder,
- name = "ladder",
- isbreakable = true,
- gravity = false,
- isopac = true,
- isattached = true,
- }
- local function dirtfill(sx, ex, y, block_type)
- if block_type == nil then block_type = block_dirt end
- local i = 0
- while true do
- map[sx + i] = map[sx + i] or {}
- map[sx + i][y] = block_type
- if block_type == block_dark and math.random(1,20) == 1 then map[sx + i][y] = block_dirt end
- i = i + 1
- if sx + i > ex then break end
- end
- end
- local function genhill(sx, ex, h, block_type)
- local y = 1
- if block_type == nil then block_type = block_dirt end
- if block_type == block_water then
- for y = -2, h do
- map[sx + y] = map[sx + y] or {}
- map[ex - y] = map[ex - y] or {} -- create slopes and fill accordingly
- if map[sx + y][y + 1] == nil then map[sx + y][y + 1] = block_dirt end
- if map[ex - y][y + 1] == nil then map[ex - y][y + 1] = block_dirt end
- dirtfill(sx + y, ex - y, y + 1, block_type)
- end
- elseif block_type == block_dark then
- local ny = math.random(30,180)
- for y = 0, h do
- map[sx + y] = map[sx + y] or {}
- map[ex - y] = map[ex - y] or {} -- create slopes and fill accordingly
- if map[sx + y][y + 1 + ny] == nil then map[sx + y][y + 1 + ny] = block_dirt end
- if map[ex - y][y + 1 + ny] == nil then map[ex - y][y + 1 + ny] = block_dirt end
- dirtfill(sx + y, ex - y, y + 1 + ny, block_type)
- for nyy = 0, math.random(5,20) do
- local rnd1 = math.random(-5,5)
- local rnd2 = math.random(-5,5)
- map[sx + y + rnd1] = map[sx + y + rnd1] or {}
- map[ex - y + rnd2] = map[ex - y + rnd2] or {}
- map[sx + y + rnd1][y + 1 + ny] = block_dark
- map[ex - y + rnd2][y + 1 + ny] = block_dirt
- end
- end
- else
- for y = 0, h do
- map[sx + y] = map[sx + y] or {}
- map[ex - y] = map[ex - y] or {} -- create slopes and fill accordingly
- if map[sx + y][(y + 1)*-1] == nil then map[sx + y][(y + 1)*-1] = block_dirt end
- if map[ex - y][(y + 1)*-1] == nil then map[ex - y][(y + 1)*-1] = block_dirt end
- dirtfill(sx + y, ex - y, (y + 1)*-1, block_type)
- end
- end
- end
- --[[
- x x
- x x
- x x
- ]]
- -- Generate Starting Area
- -- Generate Level Field
- function genlevel(start, stop)
- for x = start, stop do
- map[x] = {}
- lightmap[x] = {}
- map[x][0] = {}
- map[x][0] = block_dirt
- end
- end
- function makehill(start, stop, block_type)
- -- Generat Random Hills / Mountains
- if block_type == nil then block_type = block_dirt end
- if block_type == block_water then
- for x = start, stop do
- if math.random(1, 75) == 1 then
- -- Get Height
- repeat
- genh = math.ceil(math.random(1,50) / math.random(1,3)) -- 10
- genc = math.random(1,20)
- until genh < 6 or genc == 1
- if math.random(1,20) == 1 then genh = genh * 2 end
- -- Get Length
- genl = (genh * 2) + (math.ceil(math.random(1,100) / math.random(1,4))) -- 40
- sx = x - math.ceil(genl / 2)
- ex = x + math.ceil(genl / 2)
- genhill(sx,ex,genh, block_type)
- end
- end
- elseif block_type == block_dark then
- for x = start, stop do
- if math.random(1, 5) == 1 then
- -- Get Height
- repeat
- genh = math.ceil(math.random(1,30) / math.random(1,3)) -- 10
- genc = math.random(1,20)
- until genh < 6 or genc == 1
- if math.random(1,20) == 1 then genh = genh * 2 end
- -- Get Length
- genl = (genh * 2) + (math.ceil(math.random(1,100) / math.random(1,4))) -- 40
- sx = x - math.ceil(genl / 2)
- ex = x + math.ceil(genl / 2)
- genhill(sx,ex,genh, block_type)
- end
- end
- else
- for x = start, stop do
- if math.random(1, 30) == 1 then
- -- Get Height
- repeat
- genh = math.ceil(math.random(1,30) / math.random(1,3)) -- 10
- genc = math.random(1,20)
- until genh < 6 or genc == 1
- if math.random(1,20) == 1 then genh = genh * 2 end
- -- Get Length
- genl = (genh * 2) + (math.ceil(math.random(1,100) / math.random(1,4))) -- 40
- sx = x - math.ceil(genl / 2)
- ex = x + math.ceil(genl / 2)
- genhill(sx,ex,genh, block_type)
- end
- end
- end
- end
- local function gentrees(start, stop)
- for x = start, stop do
- map[x] = map[x] or {}
- if math.random(1,10) == 1 and map[x][0] ~= block_water then
- -- find the top block
- local y = 0
- repeat
- y = y - 1
- until map[x][y] == nil or map[x][y] == block_air
- -- designate a tree height
- local count = 0 --- make sure theres room for the lovely tree
- local i = 0
- for i = 0, 4 do
- map[x - i] = map[x - i] or {}
- map[x + i] = map[x + i] or {}
- if map[x - i][y] ~= nil and map[x - i][y] ~= block_air then count = count + 1 end
- if map[x + i][y] ~= nil and map[x + i][y] ~= block_air then count = count + 1 end
- end
- if count == 0 then
- treeh = math.random(3,5)
- while true do
- map[x][y] = block_tree
- y = y - 1
- treeh = treeh - 1
- if treeh == 0 then break end
- end
- -- gen leaves
- map[x - 1] = map[x - 1] or {}
- map[x + 1] = map[x + 1] or {}
- map[x][y] = block_leaf
- map[x - 1][y + 1] = block_leaf
- map[x + 1][y + 1] = block_leaf
- end
- end
- end
- end
- local function findhighest(fh)
- local y = 0
- while true do
- if map[fh][y] ~= block_water then
- if map[fh][y] == nil then break end
- if map[fh][y].isopac == true then break end
- if map[fh][y] == block_air then break end
- end
- y = y - 1
- end
- return y
- end
- local function checkmove()
- Player.canmove = false
- if noclip == false then
- if map[Player.x][Player.y] ~= nil then
- if map[Player.x][Player.y].isopac == false then
- -- let you move up 1 block inclines
- if Player.dir ~= "up" then
- if map[Player.x][Player.y - 1] == nil or map[Player.x][Player.y - 1].isopac == true then
- if map[Player.x][Player.y - 2] == nil or map[Player.x][Player.y - 2].isopac == true then
- Player.y = Player.y - 1
- return
- end
- end
- end
- ----------
- if Player.dir == "left" then Player.x = Player.x + 1 end
- if Player.dir == "right" then Player.x = Player.x - 1 end
- if Player.dir == "up" then Player.y = Player.y + 1 end
- if Player.dir == "down" then Player.y = Player.y - 1 end
- end
- end
- if map[Player.x][Player.y - 1] ~= nil then
- if map[Player.x][Player.y - 1].isopac == false then
- if Player.dir == "left" then Player.x = Player.x + 1 end
- if Player.dir == "right" then Player.x = Player.x - 1 end
- if Player.dir == "up" then Player.y = Player.y + 1 end
- if Player.dir == "down" then Player.y = Player.y - 1 end
- end
- end
- end
- end
- local function gengrass(start, stop)
- for x = start, stop do
- local _ = findhighest(x)
- if map[x][_ + 1] == block_dirt then
- map[x][_] = block_grass
- end
- end
- end
- local function genunderground(start, stop)
- for x = start, stop do
- for y = 1, 201 do
- map[x] = map[x] or {}
- map[x][y] = block_dirt
- if y >= 198 then
- if math.random(1,7) == 1 then map[x][y] = block_bedrock end
- end
- if y == 201 then map[x][y] = block_bedrock end
- end
- end
- end
- local function genbedrock(start, stop)
- for x = start, stop do
- for y = 1, 201 do
- map[x] = map[x] or {}
- if y >= 198 then
- if math.random(1,7) == 1 then map[x][y] = block_bedrock end
- end
- if y == 201 then map[x][y] = block_bedrock end
- end
- end
- end
- local function genundergroundwater(start, stop)
- local y = 1
- for x = start, stop do
- for y = 50, 175 do
- map[x] = map[x] or {}
- if math.random(1,70) == 1 and map[x][y - 1].isopac == false and map[x][y + 1].isopac == true then map[x][y] = block_water map[x - 1][y] = block_water end
- end
- end
- end
- local function genorepatch(x, y, size, block_type)
- local x,y,i,rnd1,rnd2,size = x,y,0,0,0,size
- if map[x][y] == block_grass or map[x][y] == block_dirt then
- map[x][y] = block_type
- for i = 0, size do
- rnd1 = rnd1 + math.random(-1,1)
- rnd2 = rnd2 + math.random(-1,1)
- if map[x + rnd1][y + rnd2] == block_dirt or map[x + rnd1][y + rnd2] == block_grass then map[x + rnd1][y + rnd2] = block_type end
- end
- end
- end
- --[[
- b_stone = "3"
- b_iron = "4"
- b_coal = "5"
- b_gold = "6"
- b_diamond = "7"
- b_redstone = "8"
- ]]
- local function genores(start, stop)
- for y = -50, 200 do
- for x = start, stop do
- if y < 0 and math.random(1,100) == 1 then genorepatch(x,y,math.random(15,20),block_stone) end
- if y < 0 and math.random(1,200) == 2 then genorepatch(x,y,math.random(3,7),block_coal) end
- if y > 100 and math.random(1,2000) == 3 then genorepatch(x,y,math.random(1,3),block_diamond) end
- if y > 175 and math.random(1,1500) == 4 then genorepatch(x,y,math.random(1,3),block_diamond) end
- if y > 50 and math.random(1,1500) == 5 then genorepatch(x,y,math.random(2,5),block_gold) end
- if y > 75 and math.random(1,1200) == 55 then genorepatch(x,y,math.random(2,5),block_gold) end
- if y > 125 and math.random(1,1000) == 123 then genorepatch(x,y,math.random(2,5),block_gold) end
- if y > 0 and math.random(1,1000) == 7 then genorepatch(x,y,math.random(3,6),block_iron) end
- if y > 10 and math.random(1,600) == 8 then genorepatch(x,y,math.random(3,6),block_iron) end
- if y > 10 and math.random(1,400) == 9 then genorepatch(x,y,math.random(3,7),block_coal) end
- if y > 20 and math.random(1,500) == 10 then genorepatch(x,y,math.random(1,7),block_redstone) end
- if y > 0 and math.random(1,75) == 11 then genorepatch(x,y,math.random(1,15),block_stone) end
- end
- if slowcomp == true then sleep(.000001) end
- end
- end
- local function createnewchunk(startchunkx, endchunkx)
- print "genlevel"
- genlevel(startchunkx, endchunkx)
- sleep(.0001)
- print "make hills"
- makehill(startchunkx, endchunkx, block_dirt)
- sleep(.0001)
- print "generating grass"
- gengrass(startchunkx, endchunkx)
- sleep(.0001)
- print "generating underground"
- genunderground(startchunkx, endchunkx)
- sleep(.0001)
- print "generating water"
- makehill(startchunkx, endchunkx, block_water)
- sleep(.0001)
- print "generating trees"
- gentrees(startchunkx, endchunkx)
- sleep(.0001)
- print "generating caves"
- makehill(startchunkx, endchunkx, block_dark)
- sleep(.0001)
- print "lining with bedrock"
- genbedrock(startchunkx,endchunkx)
- sleep(.0001)
- print "genunderwater"
- genundergroundwater(startchunkx,endchunkx)
- sleep(.0001)
- print "genores"
- genores(startchunkx,endchunkx)
- sleep(.0001)
- print "final touchups"
- addlighting(startchunkx,endchunkx)
- sleep(.0001)
- end
- function addlighting(start, stop)
- print "start lightning"
- for y = -200, 0 do
- for x = start, stop do
- map[x] = map[x] or {}
- lightmap[x] = lightmap[x] or {}
- if map[x][y] == nil then map[x][y] = block_air end
- if map[x][y] == block_air then lightmap[x][y] = 15 end
- end
- if slowcomp == true then sleep(.000001) end
- end
- print "end lighting"
- end
- local function updatelight(x,y)
- local x,y = x,y
- local i,ii = 0,0
- local update = false
- local oldlightmap = -100
- for ii = -1, 1 do
- for i = -1, 1 do
- map[x + i] = map[x + i] or {}
- lightmap[x + i] = lightmap[x + i] or {}
- lightmap[x + i][y + ii] = lightmap[x + i][y + ii] or 0
- if map[x + i][y + ii] == nil and y > 0 then map[x + i][y + ii] = block_dark end
- if map[x + i][y + ii] == nil and y <= 0 then map[x + i][y + ii] = block_air lightmap[x + i][y + ii] = 15 end
- oldlightmap = lightmap[x + i][y + ii]
- --if x + i ~= x and y + ii ~= y then
- if lightmap[x][y] > lightmap[x + i][y + ii] then
- if map[x + i][y + ii].isopac == true then
- lightmap[x + i][y + ii] = lightmap[x][y] - 1
- else
- lightmap[x + i][y + ii] = 1
- end
- end
- --end
- if oldlightmap ~= lightmap[x + i][y + ii] then update = true end
- end
- end
- return update
- end
- function simulate(force)
- local update = false
- local update1 = false
- if force == true then update = true end
- for y = Player.y - math.ceil(ScreenY / 2) - 15, Player.y + math.ceil(ScreenY / 2) + 15 do
- for x = Player.x - math.ceil(ScreenX / 2) - 15, Player.x + math.ceil(ScreenX / 2) - 3 + 15 do
- if map[x][y] == nil and y > 0 then map[x][y] = block_dark end
- if map[x][y] == nil and y <= 0 then map[x][y] = block_air end
- lightmap[x] = lightmap[x] or {}
- lightmap[x][y] = lightmap[x][y] or 0
- if lightmap[x][y] < 0 then lightmap[x][y] = 0 end
- if map[x][y] == block_torch then lightmap[x][y] = 15 end
- if map[x][y].isattached == true then
- if map[x][y] == block_torch or map[x][y] == block_ladder then
- if (map[x - 1][y].isopac == true and map[x + 1][y].isopac == true and map[x][y + 1].isopac == true and map[x][y - 1].isopac == true) or (map[x + 1][y] == block_water or map[x - 1][y] == block_water or map[x][y + 1] == block_water or map[x][y - 1] == block_water) then
- destroyblock(x,y,true)
- end
- end
- end
- if lightmap[x][y] > 1 then if updatelight(x,y) == true then update = true end end
- if map[x][y].gravity == true then
- if map[x][y + 1] ~= nil and map[x][y + 1] == block_air or map[x][y + 1] == block_dark or map[x][y + 1] == block_water then
- map[x][y + 1] = map[x][y]
- if y > 0 and map[x][y] ~= block_water then map[x][y] = block_dark update = true end
- if y <= 0 and map[x][y] ~= block_water then map[x][y] = block_air update = true end
- end
- end
- if math.random(1,15) == 1 then
- if map[x][y] == block_water and map[x][y - 1] == block_water then
- if map[x][y + 1].isopac == false and map[x - 1][y].isopac == true and map[x - 1][y] ~= block_water then map[x - 1][y] = block_water update1 = true end
- if map[x][y + 1].isopac == false and map[x + 1][y].isopac == true and map[x + 1][y] ~= block_water then map[x + 1][y] = block_water update1 = true end
- if map[x][y + 1].isopac == false and map[x][y + 1].isopac == true and map[x][y + 1] ~= block_water then map[x][y + 1] = block_water update1 = true end
- if update1 == true and math.random(1,10) == 1 then map[x][y] = block_dark end
- if update1 == true then update = true end
- end
- end
- end
- end
- if Player.canmove == false then update = true end
- Player.canmove = true
- if update == true then printplay() end
- simtimer = os.startTimer(.075)
- end
- function updategrav()
- local update = false
- if map[Player.x][Player.y + 1] == nil or map[Player.x][Player.y + 1].isopac == true then
- if map[Player.x][Player.y + 1] ~= block_ladder then
- Player.y = Player.y + 1
- update = true
- end
- end
- if update == true then printplay() end
- gravtimer = os.startTimer(.15)
- end
- local function updateleaf()
- local update = false
- for y = Player.y - math.ceil(ScreenY / 2), Player.y + math.ceil(ScreenY / 2) do
- for x = Player.x - math.ceil(ScreenX / 2), Player.x + math.ceil(ScreenX / 2) - 3 do
- if map[x][y] ~= nil then
- if map[x][y] == block_leaf and map[x - 1][y] ~= block_tree and map[x + 1][y] ~= block_tree and map[x][y + 1] ~= block_tree and math.random(1,5) == 1 then map[x][y] = block_air update = true end
- end
- end
- end
- if update == true then printplay() end
- leaftimer = os.startTimer(5)
- end
- createnewchunk(startchunkx, endchunkx)
- map[Player.x][0] = block_wood
- Player.y = findhighest(Player.x) --Place Player In A Good Spot
- simloop = 0
- -- cheats
- noclip = false
- flying = false
- creative = false
- lighting = false
- blockdestroy = true
- local function maximum (a)
- local mi = 1 -- maximum index
- local m = a[mi] -- maximum value
- for i,val in ipairs(a) do
- if val > m then
- mi = i
- m = val
- end
- end
- return m, mi
- end
- function destroyblock(x,y,sim)
- local x,y = x,y
- if map[x][y] ~= nil and map[x][y].isbreakable == true then
- if map[x][y] == block_torch then
- lightmap[x][y] = 0
- for tx = -15, 15 do
- for ty = -15, 15 do
- if lightmap[x + tx][y + ty] ~= 15 then lightmap[x + tx][y + ty] = 0 end
- end
- end
- if sim ~= true then simulate(true) end
- else
- -- calc lighting
- local l = {}
- l[1] = lightmap[x][y - 1]
- l[2] = lightmap[x - 1][y]
- l[3] = lightmap[x + 1][y]
- l[4] = lightmap[x][y + 1]
- lightmap[x][y] = maximum(l) - 1
- ----
- end
- if y > 0 then map[x][y] = block_dark end
- if y <= 0 then map[x][y] = block_air end
- if sim ~= true then simulate(true) end
- end
- end
- local function placeblock(x,y, block_type)
- local x,y = x,y
- if block_type ~= nil then
- if (map[x][y] == nil or map[x][y].isopac == true) and map[x][y] ~= block_tree then
- map[x][y] = block_type
- -- calc lighting
- lightmap[x][y] = 1
- if block_type == block_torch then
- lightmap[x][y] = 15
- end
- --------
- simulate(true)
- end
- end
- end
- -- Print Playing Field
- function printplay()
- --term.clear()
- yy = 1
- for y = Player.y - math.ceil(ScreenY / 2), Player.y + math.ceil(ScreenY / 2) do
- term.setCursorPos(1,yy)
- for x = Player.x - math.ceil(ScreenX / 2), Player.x + math.ceil(ScreenX / 2) - 3 do
- map[x] = map[x] or {}
- if x < startchunkx then
- -- load a chunk to the left
- startchunkx = startchunkx - 200
- createnewchunk(startchunkx, startchunkx + 199)
- end
- if x > endchunkx then
- -- load a chunk to the right
- endchunkx = endchunkx + 200
- createnewchunk(endchunkx - 199, endchunkx)
- end
- if map[x][y] ~= nil and (lightmap[x][y] ~= nil and lightmap[x][y] >= 1 or lighting == true) then
- write(map[x][y].block)
- else
- write(" ")
- end
- end
- yy = yy + 1
- end
- term.setCursorPos(math.ceil(ScreenX / 2) + 1, math.ceil(ScreenY / 2) + 1)
- write (p_bottom)
- term.setCursorPos(math.ceil(ScreenX / 2) + 1, math.ceil(ScreenY / 2))
- write (p_top)
- --debug
- term.setCursorPos(1,1)
- if blockdestroy == true then
- print "---DESTROY---"
- else
- print "----PLACE----"
- end
- print " "
- print "-------------"
- term.setCursorPos(1,2)
- lightmap[Player.x][Player.y] = lightmap[Player.x][Player.y] or 0
- --print ("X-"..Player.x.." Y-"..Player.y.." L-"..lightmap[Player.x][Player.y].." Destroy-"..tostring(blockdestroy).." Light-"..tostring(lighting).." Clip-"..tostring(noclip).." Block-"..map[Player.x][Player.y].name)
- inventory = block_dirt.block .. block_torch.block .. block_ladder.block
- if Player.block ~= nil then
- inventory = string.gsub(inventory, Player.block.block, "[".. Player.block.block .."]")
- end
- print (inventory)
- end
- simtimer = os.startTimer(.05)
- gravtimer = os.startTimer(.15)
- leaftimer = os.startTimer(5)
- printplay()
- simulate(true)
- simulate(true)
- while true do
- event, param1 = os.pullEvent()
- if event == "timer" and param1 == simtimer then simulate() end
- if event == "timer" and param1 == gravtimer then updategrav() end
- if event == "timer" and param1 == leaftimer then updateleaf() end
- if event == "key" and param1 == 203 and Player.canmove == true then Player.x = Player.x - 1 Player.dir = "left" checkmove() end
- if event == "key" and param1 == 205 and Player.canmove == true then Player.x = Player.x + 1 Player.dir = "right" checkmove() end
- if event == "key" and param1 == 200 and Player.canmove == true and map[Player.x][Player.y + 1] ~= nil and (map[Player.x][Player.y + 1].isopac == false or map[Player.x][Player.y + 1] == block_water or map[Player.x][Player.y + 1] == block_ladder) then Player.y = Player.y - 2 Player.dir = "up" checkmove() gravtimer = os.startTimer(.25) end
- if event == "key" and param1 == 208 and Player.canmove == true then Player.y = Player.y + 1 Player.dir = "down" checkmove() end
- if event == "key" and param1 == 1 then break end
- if event == "char" and param1 == "1" then Player.block = block_dirt printplay() end
- if event == "char" and param1 == "2" then Player.block = block_torch printplay() end
- if event == "char" and param1 == "3" then Player.block = block_ladder printplay() end
- if event == "char" and param1 == "w" then
- if blockdestroy == true then destroyblock(Player.x, Player.y - 2) else placeblock(Player.x, Player.y - 2, Player.block) end
- end
- if event == "char" and param1 == "x" then
- if blockdestroy == true then destroyblock(Player.x, Player.y + 1) else placeblock(Player.x, Player.y + 1, Player.block) end
- end
- if event == "char" and param1 == "c" then
- if blockdestroy == true then destroyblock(Player.x + 1, Player.y + 1) else placeblock(Player.x + 1, Player.y + 1, Player.block) end
- end
- if event == "char" and param1 == "z" then
- if blockdestroy == true then destroyblock(Player.x - 1, Player.y + 1) else placeblock(Player.x - 1, Player.y + 1, Player.block) end
- end
- if event == "char" and param1 == "a" then
- if blockdestroy == true then destroyblock(Player.x - 1, Player.y) else placeblock(Player.x - 1, Player.y, Player.block) end
- end
- if event == "char" and param1 == "d" then
- if blockdestroy == true then destroyblock(Player.x + 1, Player.y) else placeblock(Player.x + 1, Player.y, Player.block) end
- end
- if event == "char" and param1 == "q" then
- if blockdestroy == true then destroyblock(Player.x - 1, Player.y - 1) else placeblock(Player.x - 1, Player.y - 1, Player.block) end
- end
- if event == "char" and param1 == "e" then
- if blockdestroy == true then destroyblock(Player.x + 1, Player.y - 1) else placeblock(Player.x + 1, Player.y - 1, Player.block) end
- end
- if event == "char" and param1 == "s" then
- if blockdestroy == true then blockdestroy = false else blockdestroy = true end
- printplay()
- end
- if event == "char" and param1 == "l" then
- if lighting == true then lighting = false else lighting = true end
- printplay()
- end
- if event == "char" and param1 == "n" then
- if noclip == true then noclip = false else noclip = true end
- printplay()
- end
- end
- term.clear()
- term.setCursorPos(1,1)
- print "Thanks for Playing MiM by Casper7526"
Add Comment
Please, Sign In to add comment