Пример #1
0
        public Food(GameManager gameManager, Screen screen, Vector2 position, float radius)
            : base(gameManager, screen)
        {
            _gameManager    = gameManager;
            _texture        = _gameManager.Content.Load<Texture2D>("Textures/food_160");
            _isBeingConsumed   = false;
            _energyAmount = (int)Config.settings["Food.Normal.EnergyAmount"];

            setPosition(position);
            setRadius((float)radius);
        }
Пример #2
0
        public DrawableEntity(GameManager gameManager, Screen screen, String texture)
        {
            doDraw              = true;

            _gameManager        = gameManager;
            _screen             = screen;
            _texture            = gameManager.Content.Load<Texture2D>(texture);
            _position           = Vector2.Zero;
            _drawColor          = Color.White;
            _drawScale          = 1;
            _rotation           = 0;
            _alive              = true;
        }
Пример #3
0
        public DrawableEntity(GameManager gameManager, Screen screen)
        {
            doDraw              = true;

            _gameManager        = gameManager;
            _screen             = screen;
            _texture            = null;
            _position           = Vector2.Zero;
            _drawColor          = Color.White;
            _drawScale          = 1;
            _rotation           = 0;
            _alive              = true;
        }
Пример #4
0
        public Heart(GameManager gameManager, Screen screen)
            : base(gameManager, screen)
        {
            _drawColor              = Color.IndianRed;
            _connectedFoodLeaves    = new List<Leaf>();
            _pulseStrength          = (int)Config.settings["Heart.InitialPulseStrength"];
            _pulseSmallRadius       = Config.settings["Heart.PulseSmallRadius"];
            _pulseLargeRadius       = Config.settings["Heart.PulseLargeRadius"];
            _pulseSmallOutDuration  = Config.settings["Heart.PulseSmallOutDuration"];
            _pulseSmallInDuration   = Config.settings["Heart.PulseSmallInDuration"];
            _pulseLargeOutDuration  = Config.settings["Heart.PulseLargeOutDuration"];
            _pulseLargeInDuration   = Config.settings["Heart.PulseLargeInDuration"];
            _pulsePassOnTime        = Config.settings["Heart.PulsePassOnTime"];
            _lifeLossPerSecond      = 0;

            setRadius(Config.settings["Heart.Radius"]);
            updateDistToColor((int)GameManager.LeafColorIndex.NORMAL, -1);
            updateDistToColor((int)GameManager.LeafColorIndex.HEART, 0);
            setColor(GameManager.LEAFCOLORS[(int)GameManager.LeafColorIndex.HEART]);
        }
Пример #5
0
        public Leaf(GameManager gameManager, Screen screen)
            : base(gameManager, screen)
        {
            _gameScreen             = (GameScreen)screen;
            _texture                = gameManager.Content.Load<Texture2D>("Textures/circle_white_320");
            _selectedTexture        = gameManager.Content.Load<Texture2D>("Textures/circle_edge_white_320");
            _radius                 = Config.settings["Leaf.Radius"];
            _normalRadius           = _radius;
            _drawRadius             = _radius;
            _parents                = new List<Leaf>();
            _children               = new List<Leaf>();
            _pulseDrain             = 1;
            _pulseStrength          = 0;
            _pulseStage             = PulseStage.Done;
            _radiusScaleVelocity    = 0;
            _doingRadiusAnimation   = false;
            _targetRadius           = 1;
            _drawScale              = _radius/_texture.Width * 2;
            _selectedTextureScale   = _normalRadius/_selectedTexture.Width * 2;
            _pulseSmallRadius       = Config.settings["Leaf.PulseSmallRadius"];
            _pulseLargeRadius       = Config.settings["Leaf.PulseLargeRadius"];
            _pulseSmallOutDuration  = Config.settings["Leaf.PulseSmallOutDuration"];
            _pulseSmallInDuration   = Config.settings["Leaf.PulseSmallInDuration"];
            _pulseLargeOutDuration  = Config.settings["Leaf.PulseLargeOutDuration"];
            _pulseLargeInDuration   = Config.settings["Leaf.PulseLargeInDuration"];
            _lifeLossPerSecond      = Config.settings["Leaf.LifeLossPerSecond"];
            _maxLife                = Config.settings["Leaf.MaxLife"];
            _pulsePassOnTime        = Config.settings["Leaf.PulsePassOnTime"];
            _lastPulseTime          = 0;
            _life                   = _maxLife;
            _doPulsePassOn          = false;
            isSelected              = false;
            _distToColors           = new float[GameManager.NUM_COLORS];
            _isEating               = false;

            for (int i = 0; i < GameManager.NUM_COLORS; i++)
                _distToColors[i] = -1;
        }
Пример #6
0
 public void setScreen(Screen a)
 {
     _screen = a;
 }
Пример #7
0
 public MovableEntity(GameManager gameManager, Screen screen)
     : base(gameManager, screen)
 {
 }
Пример #8
0
 public Pickup(GameManager gameManager, Screen screen)
     : base(gameManager, screen)
 {
 }
Пример #9
0
 /// <summary>
 /// Remove screen from the manager.
 /// </summary>
 /// <param name="a"></param>
 public static void removeScreen(Screen a)
 {
     _screens.Remove(a.getName());
 }
Пример #10
0
 /// <summary>
 /// Adds the screen to the manager.
 /// </summary>
 /// <param name="a"></param>
 public static void addScreen(Screen a)
 {
     _screens.Add(a.getName(), a);
 }
Пример #11
0
        protected float _radius; //Radius in logic code, used for distance checking etc.

        #endregion Fields

        #region Constructors

        public SphereEntity(GameManager gameManager, Screen screen)
            : base(gameManager, screen)
        {
        }