Example #1
0
 private static void LoadChicken(ContentManager contentManager)
 {
     GameTextures.Add("whiteChickenRightWalk", contentManager.Load <Texture2D>("AnimalMovements/Chicken/whiteChickenRightWalk"));
     GameTextures.Add("whiteChickenLeftWalk", contentManager.Load <Texture2D>("AnimalMovements/Chicken/whiteChickenLeftWalk"));
     GameTextures.Add("whiteChickenUpWalk", contentManager.Load <Texture2D>("AnimalMovements/Chicken/whiteChickenUpWalk"));
     GameTextures.Add("whiteChickenDownWalk", contentManager.Load <Texture2D>("AnimalMovements/Chicken/whiteChickenDownWalk"));
 }
Example #2
0
 private static void LoadCat(ContentManager contentManager)
 {
     GameTextures.Add("catRightWalk", contentManager.Load <Texture2D>("AnimalMovements/Cat/catRightWalk"));
     GameTextures.Add("catLeftWalk", contentManager.Load <Texture2D>("AnimalMovements/Cat/catLeftWalk"));
     GameTextures.Add("catUpWalk", contentManager.Load <Texture2D>("AnimalMovements/Cat/catUpWalk"));
     GameTextures.Add("catDownWalk", contentManager.Load <Texture2D>("AnimalMovements/Cat/catDownWalk"));
 }
Example #3
0
 private static void LoadButtons(ContentManager contentManager)
 {
     GameTextures.Add("eButtonMovement", contentManager.Load <Texture2D>("eButtonMovement"));
     GameTextures.Add("restartButton", contentManager.Load <Texture2D>("AlertWindows/Buttons/restartButton"));
     GameTextures.Add("mainMenuButton", contentManager.Load <Texture2D>("AlertWindows/Buttons/mainMenuButton"));
     GameTextures.Add("resumeButton", contentManager.Load <Texture2D>("AlertWindows/Buttons/resumeButton"));
 }
Example #4
0
 private static void LoadCow(ContentManager contentManager)
 {
     GameTextures.Add("cowRightWalk", contentManager.Load <Texture2D>("AnimalMovements/Cow/cowRightWalk"));
     GameTextures.Add("cowLeftWalk", contentManager.Load <Texture2D>("AnimalMovements/Cow/cowLeftWalk"));
     GameTextures.Add("cowUpWalk", contentManager.Load <Texture2D>("AnimalMovements/Cow/cowUpWalk"));
     GameTextures.Add("cowDownWalk", contentManager.Load <Texture2D>("AnimalMovements/Cow/cowDownWalk"));
 }
Example #5
0
 private static void LoadItems(ContentManager contentManager)
 {
     GameTextures.Add("rocksMovement", contentManager.Load <Texture2D>("Items/rocksMovement"));
     GameTextures.Add("cutGrassMovement", contentManager.Load <Texture2D>("Items/cutGrassMovement"));
     GameTextures.Add("ropeMovement", contentManager.Load <Texture2D>("Items/ropeMovement"));
     GameTextures.Add("logMovement", contentManager.Load <Texture2D>("Items/logMovement"));
 }
Example #6
0
 public Game()
 {
     //camera = new Camera(0, 0);
     //level = new Level();
     //level.LoadLevel();
     gameTextures     = new GameTextures();
     level            = new Level();
     entityController = EntityController.GetInstance();
 }
Example #7
0
        public static void LoadClean(GraphicsDevice graphicsDevice)
        {
            Texture2D selectionTexture = new Texture2D(graphicsDevice, 1, 1);

            Color[] color = new Color[1];
            selectionTexture.GetData(color);
            color[0] = Color.White;
            selectionTexture.SetData(color);
            GameTextures.Add("cleanTexture", selectionTexture);
        }
Example #8
0
        private static void PlantLoad(ContentManager contentManager)
        {
            GameTextures.Add("grassMovement", contentManager.Load <Texture2D>("Plants/grassMovement"));

            GameTextures.Add("greenTreeMovement", contentManager.Load <Texture2D>("Plants/greenTreeMovement"));
            GameTextures.Add("orangeTreeMovement", contentManager.Load <Texture2D>("Plants/orangeTreeMovement"));

            GameTextures.Add("eatenGrassMovement", contentManager.Load <Texture2D>("Plants/eatenGrassMovement"));

            GameTextures.Add("bushMovement", contentManager.Load <Texture2D>("Plants/bushMovement"));
            GameTextures.Add("berryBushMovement", contentManager.Load <Texture2D>("Plants/berryBushMovement"));
        }
Example #9
0
        private static void LoadMisc(ContentManager contentManager, GraphicsDevice graphicsDevice)
        {
            GameTextures.Add("timerTexture", contentManager.Load <Texture2D>("timerTexture"));
            GameTextures.Add("inventoryPanel", contentManager.Load <Texture2D>("Miscs/inventoryPanel"));
            GameTextures.Add("craftPanel", contentManager.Load <Texture2D>("Miscs/craftPanel"));

            GameTextures.Add("sprintBorder", contentManager.Load <Texture2D>("sprintBorder"));

            var sprintTexture = new Texture2D(graphicsDevice, 1, 1);

            sprintTexture.SetData(new Color[] { new Color(52, 101, 181) });
            GameTextures.Add("sprintTexture", sprintTexture);
        }
Example #10
0
        /// <summary>
        /// Инициализация объектов отрисовки, сетки с объектами, текстур и времени
        /// </summary>
        public Form1()
        {
            InitializeComponent();
            Scene.InitializeContexts();
            Il.ilInit();
            Il.ilEnable(Il.IL_ORIGIN_SET);

            Gl.glClearColor(255, 255, 255, 1);
            Gl.glClear(Gl.GL_COLOR_BUFFER_BIT | Gl.GL_DEPTH_BUFFER_BIT);

            Gl.glViewport(0, 0, Scene.Width, Scene.Height);

            Gl.glMatrixMode(Gl.GL_PROJECTION);
            Gl.glLoadIdentity();

            Glu.gluOrtho2D(0.0, Scene.Width, 0.0, Scene.Height);

            Gl.glMatrixMode(Gl.GL_MODELVIEW);

            Gl.glEnable(Gl.GL_BLEND);
            Gl.glBlendFunc(Gl.GL_SRC_ALPHA, Gl.GL_ONE_MINUS_SRC_ALPHA);


            GameRendering.mGlTextureObject0 = GameTextures.loadImage("..\\..\\Pictures\\pr0.bmp");
            GameRendering.mGlTextureObject1 = GameTextures.loadImage("..\\..\\Pictures\\pers0.bmp");
            GameRendering.mGlTextureObject2 = GameTextures.loadImage("..\\..\\Pictures\\pers.bmp");
            GameRendering.mGlTextureObject3 = GameTextures.loadImage("..\\..\\Pictures\\fac.bmp");
            GameRendering.mGlTextureObject4 = GameTextures.loadImage("..\\..\\Pictures\\grassDay.png");
            GameRendering.mGlTextureObject5 = GameTextures.loadImage("..\\..\\Pictures\\grassNight.png");

            g = ArrowBox.CreateGraphics();

            net = new Net();

            Time.Text = "07:00";
            dayTime = DateTime.Parse("07:00");

            // если день = 9, то время вышло
            // на все 1 день 23 часа
            gameTime = new DateTime(2, 1, 11, 23, 0, 0);
            GameTime.Text = gameTime.ToString("yyyy-MM-dd HH':'mm':'ss");

            GameRendering.RenderNet(net, beginRenderNet, Scene, scale, false);
            lastClickNet.X = 1;
            lastClickNet.Y = 1;
            GameRendering.RenderMouseClickAlgorithmPoint(lastClickNet.X, lastClickNet.Y, Textures.CurrentCharactert);
            timer.Start();
        }
Example #11
0
        private static void LoadIcons(ContentManager contentManager)
        {
            GameTextures.Add("appleIcon", contentManager.Load <Texture2D>("ItemIcons/appleIcon"));
            GameTextures.Add("rocksIcon", contentManager.Load <Texture2D>("ItemIcons/rocksIcon"));
            GameTextures.Add("cutGrassIcon", contentManager.Load <Texture2D>("ItemIcons/cutGrassIcon"));
            GameTextures.Add("ropeIcon", contentManager.Load <Texture2D>("ItemIcons/ropeIcon"));
            GameTextures.Add("logIcon", contentManager.Load <Texture2D>("ItemIcons/logIcon"));

            GameTextures.Add("fullHearthIcon", contentManager.Load <Texture2D>("MiscsIcons/fullHearthIcon"));
            GameTextures.Add("halfHearthIcon", contentManager.Load <Texture2D>("MiscsIcons/halfHearthIcon"));
            GameTextures.Add("emptyHearthIcon", contentManager.Load <Texture2D>("MiscsIcons/emptyHearthIcon"));

            GameTextures.Add("fullFoodIcon", contentManager.Load <Texture2D>("MiscsIcons/fullFoodIcon"));
            GameTextures.Add("halfFoodIcon", contentManager.Load <Texture2D>("MiscsIcons/halfFoodIcon"));
            GameTextures.Add("emptyFoodIcon", contentManager.Load <Texture2D>("MiscsIcons/emptyFoodIcon"));
        }
Example #12
0
        public static void LoadSelectionTexture(GraphicsDevice graphicsDevice, ContentManager contentManager, int textureWidth, int textureHeight)
        {
            Texture2D selectionTexture = new Texture2D(graphicsDevice, textureWidth, textureHeight);

            Color[] color = new Color[textureWidth * textureHeight];
            selectionTexture.GetData(color);
            for (int i = 0; i < textureWidth; i++)
            {
                for (int j = 0; j < textureHeight; j++)
                {
                    if (i < 4 || i > textureWidth - 5)
                    {
                        color[i * textureWidth + j] = Color.Black;
                    }
                    if (j < 4 || j > textureHeight - 5)
                    {
                        color[i * textureWidth + j] = Color.Black;
                    }
                }
            }
            selectionTexture.SetData(color);
            GameTextures.Add("selectionTexture", selectionTexture);
        }
 public static Texture2D GetTexture(GameTextures desiredTexture)
 {
     return gameTextures[(int)desiredTexture];
 }
Example #14
0
 private static void LoadAlertWindows(ContentManager contentManager)
 {
     GameTextures.Add("endGameAlertWindow", contentManager.Load <Texture2D>("AlertWindows/endGameAlertWindow"));
     GameTextures.Add("menuAlertWindow", contentManager.Load <Texture2D>("AlertWindows/menuAlertWindow"));
 }
Example #15
0
        protected override void LoadContent()
        {
            spriteBatch = new SpriteBatch(GraphicsDevice);

            laserManager = new LaserbeamManager(Content);
            textures = new GameTextures(Content);
            if (Environment.GetCommandLineArgs().Length == 3)
            {
                LoadLevel(Environment.GetCommandLineArgs()[1]);
                outSolution = Environment.GetCommandLineArgs()[2];
                outS = new CreateSolution();
            }
            else if (Environment.GetCommandLineArgs().Length == 2)
                LoadLevel(Environment.GetCommandLineArgs()[1]);
            else
                LoadNextLevel();
            Font = Content.Load<SpriteFont>("Font");

            base.LoadContent();
        }
Example #16
0
 private static void LoadFood(ContentManager contentManager)
 {
     GameTextures.Add("appleMovement", contentManager.Load <Texture2D>("Food/appleMovement"));
     GameTextures.Add("eatenAppleMovement", contentManager.Load <Texture2D>("Food/eatenAppleMovement"));
 }
Example #17
0
 private static void RockLoad(ContentManager contentManager)
 {
     GameTextures.Add("rockMovement", contentManager.Load <Texture2D>("DecorationMovements/rockMovement"));
     GameTextures.Add("boulderRockMovement", contentManager.Load <Texture2D>("DecorationMovements/boulderRockMovement"));
 }