Exemple #1
0
 public void drawHUD(GameTime gameTime, SpriteBatch spriteBatch, Texture2D spriteSheet, CircleOfLifeGame.GameFonts gameFonts)
 {
     //only draws the background - nuclex handles the buttons
     spriteBatch.Draw(spriteSheet, hudDestination, hudBackground, Color.White, 0.0f, new Vector2(0), SpriteEffects.None, 0.0f);
     effects.draw(gameTime, spriteBatch, spriteSheet, gameFonts);
     spriteBatch.DrawString(gameFonts.Header, "Score: 1337", new Vector2(viewport.Width * 0.9f, 25), Color.Magenta);
 }
Exemple #2
0
 public Ecosystem(Game game, int width, int height)
 {
     //assign references
     this.game = game;
     this.baseGame = (CircleOfLifeGame)game;
     map = new Map();
     map.intialize(width, height);
 }
Exemple #3
0
        public void draw(GameTime gameTime, SpriteBatch spriteBatch, Texture2D spriteSheet, CircleOfLifeGame.GameFonts gameFonts)
        {
            for (int i = 0; i < effects.Count; i++)
            {
                if (effects[i].Finished)
                {
                    effects.RemoveAt(i);
                    i--;
                }
                else
                    effects[i].draw(gameTime, spriteBatch, spriteSheet, gameFonts);

            }
        }
Exemple #4
0
        public User(Game game, Ecosystem ecosystem)
        {
            this.ecosystem = ecosystem;
            this.game = game;
            this.baseGame = (CircleOfLifeGame)game;

            //Initialize Nuclex Managers
            state = new Nuclex.Game.States.GameStateManager(game.Services);
            input = new InputManager(game.Services);
            gui = new GuiManager(game.Services);

            //Add nuclex managers to game components
            game.Components.Add(state);
            game.Components.Add(input);
            game.Components.Add(gui);

            //initialize input device objects
            keyboard = input.GetKeyboard();
            mouse = input.GetMouse();

            hudDestination = new Rectangle(0, (int)(baseGame.graphics.PreferredBackBufferHeight * 0.9f), baseGame.graphics.PreferredBackBufferWidth, (int)(baseGame.graphics.PreferredBackBufferHeight * 0.1f));
            //meh
            Initialize();
        }
Exemple #5
0
 public void drawStart(GameTime gameTime, SpriteBatch spriteBatch, Texture2D spriteSheet, CircleOfLifeGame.GameFonts gameFonts)
 {
     spriteBatch.Draw(spriteSheet, new Rectangle((int)(viewport.Width * 0.25f), (int)(viewport.Height * 0.25f), (int)(viewport.Width * 0.5f), (int)(viewport.Height * 0.4f)), Sprites.title, Color.White, 0.0f, Vector2.Zero, SpriteEffects.None, 0.1f);
     //Draw menu Title
     spriteBatch.DrawString(gameFonts.Title, "Press Anything to Start", new Vector2(viewport.Width * 0.35f, viewport.Height * 0.75f), new Color(255, 0, 0, 50));
 }
Exemple #6
0
        public void drawMenu(GameTime gameTime, SpriteBatch spriteBatch, Texture2D spriteSheet, CircleOfLifeGame.GameFonts gameFonts)
        {
            //Draw menu background
            spriteBatch.Draw(spriteSheet, new Rectangle(0, 0, viewport.Width, viewport.Height), new Rectangle(0, 1050, 1, 1), Color.White, 0.0f, Vector2.Zero, SpriteEffects.None, 1.0f);
            spriteBatch.Draw(spriteSheet, new Rectangle(0, 0, viewport.Width, viewport.Height), new Rectangle(100, 100, 800, 800), Color.White, 0.0f, Vector2.Zero, SpriteEffects.None, 0.5f);
            //Draw menu Title
            spriteBatch.DrawString(gameFonts.Title, "Upgrade Menu", new Vector2(viewport.Width * 0.45f, viewport.Height * 0.05f), Color.Black);
            perkTree.draw(gameTime, spriteBatch, spriteSheet, gameFonts);

            spriteBatch.DrawString(gameFonts.Header, "Order Points: " + baseGame.oPoints.ToString() + "      Evolution Points: " + baseGame.ePoints.ToString(), new Vector2(50, 650), Color.Black);
            drawPreview(new Rectangle(200, 575, 150, 150), gameTime, spriteBatch, spriteSheet);
            //drawMouse(spriteBatch, spriteSheet);
        }
Exemple #7
0
        public void drawHUD(GameTime gameTime, SpriteBatch spriteBatch, Texture2D spriteSheet, CircleOfLifeGame.GameFonts gameFonts)
        {
            //only draws the background - nuclex handles the buttons
            //spriteBatch.Draw(spriteSheet, hudDestination, hudBackground, Color.White, 0.0f, new Vector2(0), SpriteEffects.None, 0.0f);
            effects.draw(gameTime, spriteBatch, spriteSheet, gameFonts);
            spriteBatch.DrawString(gameFonts.Header, "Order: " + baseGame.oPoints.ToString() + "\nEvolution: " + baseGame.ePoints.ToString(), new Vector2(viewport.Width * 0.9f, 25), Color.Magenta);

            //drawMouse(spriteBatch, spriteSheet);
        }
Exemple #8
0
 public void drawCreate(GameTime gameTime, SpriteBatch spriteBatch, Texture2D spriteSheet, CircleOfLifeGame.GameFonts gameFonts)
 {
     //Draw menu background
     spriteBatch.Draw(spriteSheet, new Rectangle(0, 0, viewport.Width, viewport.Height), new Rectangle(0, 1050, 1, 1), Color.White, 0.0f, Vector2.Zero, SpriteEffects.None, 1.0f);
     spriteBatch.Draw(spriteSheet, new Rectangle(0, 0, viewport.Width, viewport.Height), new Rectangle(100, 100, 800, 800), Color.White, 0.0f, Vector2.Zero, SpriteEffects.None, 0.1f);
     spriteBatch.DrawString(gameFonts.Title, "Species Creator", new Vector2(viewport.Width * 0.4f, viewport.Height * 0.1f), Color.Black);
     spriteBatch.DrawString(gameFonts.Header, "Order Points: " + baseGame.oPoints.ToString() + "      Evolution Points: " + baseGame.ePoints.ToString(), new Vector2(viewport.Width * 0.4f, viewport.Height * 0.8f), Color.Black);
     createTree.draw(gameTime, spriteBatch, spriteSheet, gameFonts);
     drawPreview(new Rectangle(1250,400,200,200),gameTime, spriteBatch, spriteSheet);
     //drawMouse(spriteBatch, spriteSheet);
 }
Exemple #9
0
 public void drawMenu(GameTime gameTime, SpriteBatch spriteBatch, Texture2D spriteSheet, CircleOfLifeGame.GameFonts gameFonts)
 {
     //Draw menu background
     spriteBatch.Draw(spriteSheet, new Rectangle(0, 0, viewport.Width, viewport.Height), new Rectangle(0, 1050, 1, 1), Color.White, 0.0f, Vector2.Zero, SpriteEffects.None, 1.0f);
     spriteBatch.Draw(spriteSheet, new Rectangle(0, 0, viewport.Width, viewport.Height), new Rectangle(100, 100, 800, 800), Color.White, 0.0f, Vector2.Zero, SpriteEffects.None, 0.1f);
     //Draw menu Title
     spriteBatch.DrawString(gameFonts.Title, "Game Menu", new Vector2(viewport.Width * 0.45f, viewport.Height * 0.05f), new Color(255,0,0,128));
     perkTree.draw(gameTime, spriteBatch, spriteSheet, gameFonts);
 }
Exemple #10
0
        public void draw(GameTime gameTime, SpriteBatch spriteBatch, Texture2D spriteSheet, CircleOfLifeGame.GameFonts gameFonts)
        {
            //TODO integrate game time into frame calculation

            pos.Y = pos.Y -1; //guessed effect
            color.A = (byte)(255 - 8 *frame );
            spriteBatch.DrawString(gameFonts.Header, text, pos, color,0.0f,Vector2.Zero,1.0f,SpriteEffects.None,0.1f);

            frame++;
            if (frame == frames)
                finished = true;
        }
Exemple #11
0
 public void draw(GameTime gameTime, SpriteBatch spriteBatch, Texture2D spriteSheet, CircleOfLifeGame.GameFonts gameFonts)
 {
     for (int i = 0; i < perks.Count; i++)
     {
         perks[i].draw(gameTime, spriteBatch, spriteSheet, gameFonts,offset);
     }
 }
Exemple #12
0
        public void draw(GameTime gameTime, SpriteBatch spriteBatch, Texture2D spriteSheet, CircleOfLifeGame.GameFonts gameFonts,int offset)
        {
            Color bgColor;
            if (bought)
                bgColor = Color.Red;
            else if (blocked)
                bgColor = Color.Gray;
            else if (selected)
                bgColor = Color.Blue;
            else if (hover)
                bgColor = Color.Green;
            else
                bgColor = Color.White;

            spriteBatch.Draw(spriteSheet, new Rectangle(X + offset, Y, 5, 27), topLeft, bgColor, 0.0f, new Vector2(0, 0), SpriteEffects.None, 0.1f);
            spriteBatch.Draw(spriteSheet, new Rectangle(X + 5 + offset, Y, width - 10, 27), top, bgColor, 0.0f, new Vector2(0, 0), SpriteEffects.None, 0.1f);
            spriteBatch.Draw(spriteSheet, new Rectangle(X + width - 5 + offset, Y, 5, 27), topRight, bgColor, 0.0f, new Vector2(0, 0), SpriteEffects.None, 0.1f);
            spriteBatch.Draw(spriteSheet, new Rectangle(X + offset, Y + 27, 5, height - 27), left, bgColor, 0.0f, new Vector2(0, 0), SpriteEffects.None, 0.1f);
            spriteBatch.Draw(spriteSheet, new Rectangle(X + width - 5 + offset, Y + 27, 5, height - 27), right, bgColor, 0.0f, new Vector2(0, 0), SpriteEffects.None, 0.1f);
            spriteBatch.Draw(spriteSheet, new Rectangle(X + offset, Y + height, 5, 4), bottomLeft, bgColor, 0.0f, new Vector2(0, 0), SpriteEffects.None, 0.1f);
            spriteBatch.Draw(spriteSheet, new Rectangle(X + 5 + offset, Y + height, width - 10, 4), bottom, bgColor, 0.0f, new Vector2(0, 0), SpriteEffects.None, 0.1f);
            spriteBatch.Draw(spriteSheet, new Rectangle(X + width - 5 + offset, Y + height, 5, 4), bottomRight, bgColor, 0.0f, new Vector2(0, 0), SpriteEffects.None, 0.1f);
            spriteBatch.Draw(spriteSheet, new Rectangle(X + offset, Y + 50, width, 4), bottom, bgColor, 0.0f, new Vector2(0, 0), SpriteEffects.None, 0.1f);

            spriteBatch.DrawString(gameFonts.Header, name, new Vector2(X + 15 + offset, Y), Color.White, 0.0f, new Vector2(0.0f, 0.0f), 1.0f, SpriteEffects.None, 0.0f);
            spriteBatch.DrawString(gameFonts.Header, cost, new Vector2(X + 15 + offset, Y + 27), Color.Red, 0.0f, new Vector2(0.0f, 0.0f), 1.0f, SpriteEffects.None, 0.0f);
            spriteBatch.DrawString(gameFonts.Header, effects, new Vector2(X + 15 + offset, Y + 50), Color.Black, 0.0f, new Vector2(0.0f, 0.0f), 1.0f, SpriteEffects.None, 0.0f);
            //spriteBatch.Draw(spriteSheet, new Rectangle(X, Y + 25, width, 50), bodyRectangle, Color.White);
            //spriteBatch.Draw(spriteSheet, new Rectangle(X, Y + 74, width, 50), bodyRectangle, Color.White);
        }
Exemple #13
0
        public void draw(GameTime gameTime, SpriteBatch spriteBatch, Texture2D spriteSheet, CircleOfLifeGame.GameFonts gameFonts)
        {
            //TODO integrate game time into frame calculation

            spriteBatch.Draw(spriteSheet,pos,Sprites.leak,Color.White,6.2f*frame/frames,new Vector2(150,150),scale,SpriteEffects.None,0.1f);

            frame++;
            if (frame == frames)
                finished = true;
        }
Exemple #14
0
        public void draw(GameTime gameTime, SpriteBatch spriteBatch, Texture2D spriteSheet, CircleOfLifeGame.GameFonts gameFonts,int offset)
        {
            spriteBatch.Draw(spriteSheet, new Rectangle(X + offset, Y, 5, 27), topLeft, bgColor, 0.0f, new Vector2(0, 0), SpriteEffects.None, 0.1f);
            spriteBatch.Draw(spriteSheet, new Rectangle(X + 5 + offset, Y, width - 10, 27), top, bgColor, 0.0f, new Vector2(0, 0), SpriteEffects.None, 0.1f);
            spriteBatch.Draw(spriteSheet, new Rectangle(X + width - 5 + offset, Y, 5, 27), topRight, bgColor, 0.0f, new Vector2(0, 0), SpriteEffects.None, 0.1f);
            spriteBatch.Draw(spriteSheet, new Rectangle(X + offset, Y + 27, 5, height - 27), left, bgColor, 0.0f, new Vector2(0, 0), SpriteEffects.None, 0.1f);
            spriteBatch.Draw(spriteSheet, new Rectangle(X + width - 5 + offset, Y + 27, 5, height - 27), right, bgColor, 0.0f, new Vector2(0, 0), SpriteEffects.None, 0.1f);
            spriteBatch.Draw(spriteSheet, new Rectangle(X + offset, Y + height, 5, 4), bottomLeft, bgColor, 0.0f, new Vector2(0, 0), SpriteEffects.None, 0.1f);
            spriteBatch.Draw(spriteSheet, new Rectangle(X + 5 + offset, Y + height, width - 10, 4), bottom, bgColor, 0.0f, new Vector2(0, 0), SpriteEffects.None, 0.1f);
            spriteBatch.Draw(spriteSheet, new Rectangle(X + width - 5 + offset, Y + height, 5, 4), bottomRight, bgColor, 0.0f, new Vector2(0, 0), SpriteEffects.None, 0.1f);
            spriteBatch.Draw(spriteSheet, new Rectangle(X + offset, Y + 50, width, 4), bottom, bgColor, 0.0f, new Vector2(0, 0), SpriteEffects.None, 0.1f);

            spriteBatch.DrawString(gameFonts.Header, name, new Vector2(X + 15 + offset, Y), Color.White, 0.0f, new Vector2(0.0f, 0.0f), 1.0f, SpriteEffects.None, 0.0f);
            spriteBatch.DrawString(gameFonts.Header, "Cost", new Vector2(X + 15 + offset, Y + 27), Color.Red, 0.0f, new Vector2(0.0f, 0.0f), 1.0f, SpriteEffects.None, 0.0f);
            spriteBatch.DrawString(gameFonts.Header, "Effects\nMore Effects:)", new Vector2(X + 15 + offset, Y + 50), Color.Black, 0.0f, new Vector2(0.0f, 0.0f), 1.0f, SpriteEffects.None, 0.0f);
            //spriteBatch.Draw(spriteSheet, new Rectangle(X, Y + 25, width, 50), bodyRectangle, Color.White);
            //spriteBatch.Draw(spriteSheet, new Rectangle(X, Y + 74, width, 50), bodyRectangle, Color.White);
        }