Exemple #1
0
        public Logic()
        {
            testint = 0;

            graphics = new GraphicsDeviceManager(this);
            this.graphics.PreferredBackBufferWidth = 903;
            this.graphics.PreferredBackBufferHeight = 900;
            //at the moment, the screen is 903x900 resolution, this is for a 150x150 grid of 6x6 squares. it would be 900x900, but the lines are staggered so we needed 3 extra wide
            //when we are done, we can add extra stuff on one side of the screen and make it 1200x900 (4:3) or something sensible
            texAntsOnHillRed = new Texture2D[6];
            texAntsOnHillBlack = new Texture2D[6];
            texAntsOnFoodRed = new Texture2D[6];
            texAntsOnFoodBlack = new Texture2D[6];
            texAntsBlankRed = new Texture2D[6];
            texAntsBlankBlack = new Texture2D[6];

            oldkbstate = new KeyboardState();
            newkbstate = new KeyboardState();

            redAnts = new Ant[127];
            blackAnts = new Ant[127];

            Content.RootDirectory = "Content";
            tiles = new Tile[150, 150];
            WG = new WorldGeneration(this, this);
            WW = new WorldWriter(this);
            //setWorldChecker(@"C:\Users\Max\TestWorld.txt");
            //redBrain = new AntBrain(@"C:\Users\Max\sampleant.txt", redAnts, this);
            //blackBrain = new AntBrain(@"C:\Users\Max\sampleant.txt", blackAnts, this);
            gameState = "intro";
            loadMapSTR = "";
            loadBrainRed = "";
            loadBrainBlack = "";
            saveMapSTR = "";
            menuState = 0;
            redScore = 0;
            blackScore = 0;
            kbreader = new KeyboardReader(this);
            blackLoaded = false;
        }
 public void Save(string filename, WorldWriter wf)
 {
     wf.Save(this, filename);
 }