A downloadable game for Windows

Controls:

Mooving: Arrows

Plant Trap: Spacebar

Sorce Code!

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.InteropServices;
using System.Drawing;
namespace murderdbyletters
{
    public static class wariabless{
        public static int score;
        public static int food = 45;
    }
    public static class tree{
        public static int[] posx = new int[8];
        public static int[] posy = new int[8];
    }
     public static class zombie{
        public static int[] posx = new int[8];
        public static int[] posy = new int[8];
        public static void move(){
            
            
            Random randd  = new Random();
            
            for (int i = 0; i < wariabless.score; i++) {
            int rand = randd.Next(0, 3);
            if(rand != 2){
                if(posx[i] > Program.posx){
                //upper
                if(posy[i] > Program.posy){
                    if(rand == 0){
                        posx[i] -= 1;
                    }
                    if(rand == 1){
                        posy[i] -= 1;
                    }
                }else if(posy[i] < Program.posy){
                    if(rand == 0){
                        posx[i] -= 1;
                    }
                    if(rand == 1){
                        posy[i] += 1;
                    }
                    //down
                
                }else{
                    posx[i] -= 1;
                }
                
                
            }
            
            //stuff
            if(posx[i] < Program.posx){
                //upper
                if(posy[i] > Program.posy){
                    if(rand == 0){
                        posx[i] += 1;
                    }
                    if(rand == 1){
                        posy[i] -= 1;
                    }
                }else if(posy[i] < Program.posy){
                    if(rand == 0){
                        posx[i] += 1;
                    }
                    if(rand == 1){
                        posy[i] += 1;
                    }
                    //down
                
                }else{
                    posx[i] += 1;
                }
                
                
            }
            //stuff
            if(posx[i] > 27){
                posx[i] = 27;
            }
            if(posx[i] < 0){
                posx[i] = 0;
            }
            if(posy[i] < 0){
                posy[i] = 0;
            }
            if(posy[i] > 9){
                posy[i] = 9;
            }
            }
            //stuff
            
            }
            }
           
            
            
            
        }
    
    class Program
    {
        public static int reset = 0;
        public static class arena{
            public static string[] line1;
            public static string[] line2;
            public static string[] line3;
            public static string[] line4;
            public static string[] line5;
            public static string[] line6;
            public static string[] line7;
            public static string[] line8;
            public static string[] line9;
            public static string[] line10;
        }
        
        public static int tonight = 10;
        public static bool night = false;
        public static int posx = 0;
        public static int posy = 0;
        public static int endposx = 0;
        public static int endposy = 0;
        public static int traposx = 0;
        public static int traposy = 0;
        
        public static void Main()
        {
            zombie.posx = new int[wariabless.score];
            zombie.posy = new int[wariabless.score];
            tree.posx = new int[wariabless.score];
            tree.posy = new int[wariabless.score];
            posx = 0;
            posy = 0;
            Random randd  = new Random();
            int randx = randd.Next(25, 27);
            endposx = randx;
            int randy = randd.Next(0, 9);
            endposy = randy;
            for (int i = 0; i < wariabless.score; i++) {
                randx = randd.Next(15, 27);
                zombie.posx[i] = randx;
                randy = randd.Next(0, 9);
                zombie.posy[i] = randy;
                
            }
            for (int i = 0; i < wariabless.score; i++) {
                randx = randd.Next(5, 27);
                tree.posx[i] = randx;
                randy = randd.Next(0, 9);
                tree.posy[i] = randy;
                
            }
            Console.BackgroundColor = ConsoleColor.Black;
            Console.ForegroundColor = ConsoleColor.DarkGreen;
            Console.Clear();
            Console.BackgroundColor = ConsoleColor.Black;
            Console.ForegroundColor = ConsoleColor.DarkGreen;
            arena.line1 = new string[28];
            arena.line2 = new string[28];
            arena.line3 = new string[28];
            arena.line4 = new string[28];
            arena.line5 = new string[28];
            arena.line6 = new string[28];
            arena.line7 = new string[28];
            arena.line8 = new string[28];
            arena.line9 = new string[28];
            arena.line10 = new string[28];
            for (int i = 0; i < 28; i++) {
                arena.line1[i] = "O";
                arena.line2[i] = "O";
                arena.line3[i] = "O";
                arena.line4[i] = "O";
                arena.line5[i] = "O";
                arena.line6[i] = "O";
                arena.line7[i] = "O";
                arena.line8[i] = "O";
                arena.line9[i] = "O";
                arena.line10[i] = "O";
            }
            Console.WriteLine("");
            Console.WriteLine("Murderd by Words");
            
            // TODO: Implement Functionality Here
            Console.WriteLine("     _____       ");
            Console.WriteLine("    _XXXXX_      ");
            Console.WriteLine("    XXXXXXX      ");
            Console.WriteLine("    X0XXX0X      ");
            Console.WriteLine("    XXX XXX      ");
            Console.WriteLine("    XXXXXXX      ");
            Console.WriteLine("     X___X       ");
            Console.WriteLine("      XXX        ");
            Console.WriteLine("  XXXXXXXXXXX    ");
            Console.WriteLine("  X XXXXXXX X    ");
            Console.WriteLine("  X XXXXXXX X    ");
            //stuff
            Console.Write("Press any key to Start!");
            Console.ReadKey(true);
            Console.Clear();
            Console.WriteLine("Secret Tehnologis INC");
            Console.WriteLine("Secret Book");
            Console.WriteLine("Day: 20 XX 20XX. Log 1:");
            Console.WriteLine("");
            Console.Write("If you are reading this righ now, that means someone stayed alive. I heard there is a vault fev kilometers avay. If any hope left, this is it. Find it, if you want to stay alive.");
            Console.WriteLine("");
            Console.WriteLine("");
            Console.WriteLine("Press any key to Begin");
            System.Threading.Thread.Sleep(1300);
            Console.ReadKey(true);
            Playgame();
        }
        public static void NextLevel(){
            traposx = 0;
            traposy = 0;
            zombie.posx = new int[wariabless.score];
            zombie.posy = new int[wariabless.score];
             tree.posx = new int[wariabless.score];
            tree.posy = new int[wariabless.score];
            posx = 0;
            posy = 0;
            Random randd  = new Random();
            int randx = randd.Next(25, 27);
            endposx = randx;
            int randy = randd.Next(0, 7);
            endposy = randy;
            for (int i = 0; i < wariabless.score; i++) {
                randx = randd.Next(15, 27);
                zombie.posx[i] = randx;
                randy = randd.Next(0, 9);
                zombie.posy[i] = randy;
                
            }
            for (int i = 0; i < wariabless.score; i++) {
                randx = randd.Next(5, 27);
                tree.posx[i] = randx;
                randy = randd.Next(0, 9);
                tree.posy[i] = randy;
                
            }
        
            
            arena.line1 = new string[28];
            arena.line2 = new string[28];
            arena.line3 = new string[28];
            arena.line4 = new string[28];
            arena.line5 = new string[28];
            arena.line6 = new string[28];
            arena.line7 = new string[28];
            arena.line8 = new string[28];
            arena.line9 = new string[28];
            arena.line10 = new string[28];
            for (int i = 0; i < 28; i++) {
                arena.line1[i] = "O";
                arena.line2[i] = "O";
                arena.line3[i] = "O";
                arena.line4[i] = "O";
                arena.line5[i] = "O";
                arena.line6[i] = "O";
                arena.line7[i] = "O";
                arena.line8[i] = "O";
                arena.line9[i] = "O";
                arena.line10[i] = "O";
            }
            Console.WriteLine("");
            Console.WriteLine("You Escaped! Log:" + wariabless.score);
            
            // TODO: Implement Functionality Here
            Console.WriteLine("     _____       ");
            Console.WriteLine("    _XXXXX_      ");
            Console.WriteLine("    XXXXXXX      ");
            Console.WriteLine("    X0XXX0X      ");
            Console.WriteLine("    XXX XXX      ");
            Console.WriteLine("    XXXXXXX      ");
            Console.WriteLine("     X___X       ");
            Console.WriteLine("      XXX        ");
            Console.WriteLine("  XXXXXXXXXXX    ");
            Console.WriteLine("  X XXXXXXX X    ");
            Console.WriteLine("  X XXXXXXX X    ");
            //stuff
            Console.Write("Press any key to Start . . . ");
            Console.ReadKey(true);
            Console.Clear();
            Console.WriteLine("Secret Tehnologis INC");
            Console.WriteLine("Secret Book");
            Console.WriteLine("Day: 2" + wariabless.score + "XX 20XX. Log " + wariabless.score + ":");
            Console.WriteLine("");
            Console.Write("");
            Console.WriteLine("");
            Console.WriteLine("Press any key to continue");
            System.Threading.Thread.Sleep(1300);
            Console.ReadKey(true);
            Playgame();
        }
        public static void Playgame(){
            if(night == false){
                Console.BackgroundColor = ConsoleColor.Black;
            Console.ForegroundColor = ConsoleColor.DarkGreen;
            Console.Clear();
            Console.BackgroundColor = ConsoleColor.Black;
            Console.ForegroundColor = ConsoleColor.DarkGreen;
            }else{
                Console.BackgroundColor = ConsoleColor.DarkGreen;
            Console.ForegroundColor = ConsoleColor.Black;
             Console.Clear();
             Console.BackgroundColor = ConsoleColor.DarkGreen;
            Console.ForegroundColor = ConsoleColor.Black;
            }
            
            //checktheposition
            //PLAYER
            if(posx > 27){
                posx = 27;
            }
            if(posx < 0){
                posx = 0;
            }
            if(posy < 0){
                posy = 0;
            }
            if(posy > 9){
                posy = 9;
            }
            for (int i = 0; i < 28; i++) {
                arena.line1[i] = "_";
                arena.line2[i] = "-";
                arena.line3[i] = "_";
                arena.line4[i] = "-";
                arena.line5[i] = "_";
                arena.line6[i] = "-";
                arena.line7[i] = "_";
                arena.line8[i] = "-";
                arena.line9[i] = "_";
                arena.line10[i] = "-";
            
                for (int y = 0; y < wariabless.score; y++) {
                    if(zombie.posy[y] == 0){
                    if(zombie.posx[y] == i){
                        arena.line1[i] = "Z";
                    }
                }
                if(zombie.posy[y] == 1){
                    if(zombie.posx[y] == i){
                        arena.line2[i] = "Z";
                    }
                }
                if(zombie.posy[y] == 2){
                    if(zombie.posx[y] == i){
                        arena.line3[i] = "Z";
                    }
                }
                if(zombie.posy[y] == 3){
                    if(zombie.posx[y] == i){
                        arena.line4[i] = "Z";
                    }
                }
                if(zombie.posy[y] == 4){
                    if(zombie.posx[y] == i){
                        arena.line5[i] = "Z";
                    }
                }
                if(zombie.posy[y] == 5){
                    if(zombie.posx[y] == i){
                        arena.line6[i] = "Z";
                    }
                }
                 if(zombie.posy[y] == 6){
                    if(zombie.posx[y] == i){
                        arena.line7[i] = "Z";
                    }
                }
                 if(zombie.posy[y] == 7){
                    if(zombie.posx[y] == i){
                        arena.line8[i] = "Z";
                    }
                }
                 if(zombie.posy[y] == 8){
                    if(zombie.posx[y] == i){
                        arena.line9[i] = "Z";
                    }
                }
                 if(zombie.posy[y] == 9){
                    if(zombie.posx[y] == i){
                        arena.line10[i] = "Z";
                    }
                }
                }
                if(endposy == 0){
                    if(endposx == i){
                        arena.line1[i] = "E";
                    }
                }
                 if(endposy == 1){
                    if(endposx == i){
                        arena.line2[i] = "E";
                    }
                }
                 if(endposy == 2){
                    if(endposx == i){
                        arena.line3[i] = "E";
                    }
                }
                 if(endposy == 3){
                    if(endposx == i){
                        arena.line4[i] = "E";
                    }
                }
                 if(endposy == 4){
                    if(endposx == i){
                        arena.line5[i] = "E";
                    }
                }
                 if(endposy == 5){
                    if(endposx == i){
                        arena.line6[i] = "E";
                    }
                }
                 if(endposy == 6){
                    if(endposx == i){
                        arena.line7[i] = "E";
                    }
                }
                 if(endposy == 7){
                    if(endposx == i){
                        arena.line8[i] = "E";
                    }
                }
                 if(endposy == 8){
                    if(endposx == i){
                        arena.line9[i] = "E";
                    }
                }
                //stuffs
                for (int y = 0; y < wariabless.score; y++) {
                    if(tree.posy[y] == 0){
                    if(tree.posx[y] == i){
                        arena.line1[i] = "T";
                    }
                }
                if(tree.posy[y] == 1){
                    if(tree.posx[y] == i){
                        arena.line2[i] = "T";
                    }
                }
                if(tree.posy[y] == 2){
                    if(tree.posx[y] == i){
                        arena.line3[i] = "T";
                    }
                }
                if(tree.posy[y] == 3){
                    if(tree.posx[y] == i){
                        arena.line4[i] = "T";
                    }
                }
                if(tree.posy[y] == 4){
                    if(tree.posx[y] == i){
                        arena.line5[i] = "T";
                    }
                }
                if(tree.posy[y] == 5){
                    if(tree.posx[y] == i){
                        arena.line6[i] = "T";
                    }
                }
                 if(tree.posy[y] == 6){
                    if(tree.posx[y] == i){
                        arena.line7[i] = "T";
                    }
                }
                 if(tree.posy[y] == 7){
                    if(tree.posx[y] == i){
                        arena.line8[i] = "T";
                    }
                }
                 if(tree.posy[y] == 8){
                    if(tree.posx[y] == i){
                        arena.line9[i] = "T";
                    }
                }
                 if(tree.posy[y] == 9){
                    if(tree.posx[y] == i){
                        arena.line10[i] = "T";
                    }
                }
                }
                if(traposy == 0){
                    if(traposx == i){
                        arena.line1[i] = "X";
                    }
                }
                 if(traposy == 1){
                    if(traposx == i){
                        arena.line2[i] = "X";
                    }
                }
                 if(traposy == 2){
                    if(traposx == i){
                        arena.line3[i] = "X";
                    }
                }
                 if(traposy == 3){
                    if(traposx == i){
                        arena.line4[i] = "X";
                    }
                }
                 if(traposy == 4){
                    if(traposx == i){
                        arena.line5[i] = "X";
                    }
                }
                 if(traposy == 5){
                    if(traposx == i){
                        arena.line6[i] = "X";
                    }
                }
                 if(traposy == 6){
                    if(traposx == i){
                        arena.line7[i] = "X";
                    }
                }
                 if(traposy == 7){
                    if(traposx == i){
                        arena.line8[i] = "X";
                    }
                }
                 if(traposy == 8){
                    if(traposx == i){
                        
                        arena.line9[i] = "X";
                    }
                }
                    if(posy == 0){
                    if(posx == i){
                        arena.line1[i] = "P";
                    }
                }
                if(posy == 1){
                    if(posx == i){
                        arena.line2[i] = "P";
                    }
                }
                if(posy == 2){
                    if(posx == i){
                        arena.line3[i] = "P";
                    }
                }
                if(posy == 3){
                    if(posx == i){
                        arena.line4[i] = "P";
                    }
                }
                if(posy == 4){
                    if(posx == i){
                        arena.line5[i] = "P";
                    }
                }
                if(posy == 5){
                    if(posx == i){
                        arena.line6[i] = "P";
                    }
                }
                 if(posy == 6){
                    if(posx == i){
                        arena.line7[i] = "P";
                    }
                }
                 if(posy == 7){
                    if(posx == i){
                        arena.line8[i] = "P";
                    }
                }
                 if(posy == 8){
                    if(posx == i){
                        arena.line9[i] = "P";
                    }
                }
                 if(posy == 9){
                    if(posx == i){
                        arena.line10[i] = "P";
                    }
                }
                
                
            }
            //PLAYER
            //checktheposition
            //print
            Console.Clear();
            
            
            for (int i = 0; i < 28; i++) {
                Console.Write(arena.line1[i]);
            }
            Console.WriteLine("");
            for (int i = 0; i < 28; i++) {
                Console.Write(arena.line2[i]);
            }
            Console.WriteLine("");
            for (int i = 0; i < 28; i++) {
                Console.Write(arena.line3[i]);
            }
            Console.WriteLine("");
            for (int i = 0; i < 28; i++) {
                Console.Write(arena.line4[i]);
            }
            Console.WriteLine("");
            for (int i = 0; i < 28; i++) {
                Console.Write(arena.line5[i]);
            }
            Console.WriteLine("");
            for (int i = 0; i < 28; i++) {
                Console.Write(arena.line6[i]);
            }
            Console.WriteLine("");
            for (int i = 0; i < 28; i++) {
                Console.Write(arena.line7[i]);
            }
            Console.WriteLine("");
            for (int i = 0; i < 28; i++) {
                Console.Write(arena.line8[i]);
            }
            Console.WriteLine("");
            for (int i = 0; i < 28; i++) {
                Console.Write(arena.line9[i]);
            }
            Console.WriteLine("");
            for (int i = 0; i < 28; i++) {
                Console.Write(arena.line10[i]);
            }
            Console.WriteLine(""); 
            Console.WriteLine("Day:" + night + " Food:" + wariabless.food + " Log:" + wariabless.score);
            //print
            System.Threading.Thread.Sleep(0);
            bool isdead;
            isdead = false;
            for (int i = 0; i < wariabless.score; i++) {
                if(zombie.posx[i] == posx && zombie.posy[i] == posy){
                    isdead = true;
                    
                }
                if(zombie.posx[i] == traposx && zombie.posy[i] == traposy){
                    zombie.posx[i] = 0;
                    zombie.posy[i] = 0;
                    traposx = 1;
                    traposy = 1;
                    wariabless.food += 3;
                        Playgame();
                }
           
            }
            if(wariabless.food <= 0){
                wariabless.food = 45;
                Main();
            }
            if(tonight <= 0){
                night = !night;
                tonight = 10;
            }
            if(isdead == true){
                Console.Clear();
                wariabless.score = 0;
                Main();
            }else{
                if(endposy == posy && endposx == posx){
                    Console.Clear();
                    wariabless.score += 2;
                    wariabless.food += 30;
                    NextLevel();
                }else{
                    contorls();
                Playgame();
                }
                
                
            }
        }
        public static void contorls(){
            ConsoleKey key;
            key = Console.ReadKey(true).Key;
            if (key == ConsoleKey.RightArrow)
            {
                 posx += 1;
                 zombie.move();
                 tonight -= 1;
                 wariabless.food -= 1;
            }
            if (key == ConsoleKey.LeftArrow)
            {
                 posx -= 1;
                 zombie.move();
                 tonight -= 1;
                 wariabless.food -= 1;
            }
            if (key == ConsoleKey.UpArrow)
            {
                 posy -= 1;
                 zombie.move();
                 tonight -= 1;
                 wariabless.food -= 1;
            }
            if (key == ConsoleKey.DownArrow)
            {
                 posy += 1;
                 zombie.move();
                 tonight -= 1;
                 wariabless.food -= 1;
            }
            if (key == ConsoleKey.Spacebar)
            {
                 zombie.move();
                 tonight -= 2;
                 traposx = posx;
                 traposy = posy;
                 
            }
            if(key == ConsoleKey.Backspace){
                wariabless.score += 1;
                zombie.move();
                 tonight -= 2;
            }
            
        }
    }
}

Download

Download
Murderd By Words.zip 35 kB

Leave a comment

Log in with itch.io to leave a comment.