Esempio n. 1
0
 public BarComponent(GameObject parentObject, Vector2 position, string propertyToTrack, float maxValue, string emptyTexturePath,string fullTexturePath)
     : base(parentObject,position,propertyToTrack)
 {
     _maxValue = maxValue;
     _emptyTexturePath = emptyTexturePath;
     _fullTexturePath = fullTexturePath;
 }
Esempio n. 2
0
        public TimerComponent(GameObject parentObject, TimeSpan interval, bool repeat)
            : base(parentObject)
        {
            _interval = interval;
            _repeat = repeat;

            _lastIntervalStart = TimeSpan.Zero;
            Active = false;
        }
Esempio n. 3
0
        public PhysicsComponent(GameObject gameObject)
            : base(gameObject)
        {
            Name = "Physics";
            HasGravity = false;
            HasDrag = true;
            _gravity = new Vector2(0, 600);
            MaxVelocity = 5000;

            ParentObject.Properties.UpdateProperty("IsPhysicsActive", true);
        }
Esempio n. 4
0
        public AnimationComponent(GameObject parentObject)
            : base(parentObject)
        {
            Animations = new Dictionary<String, SpriteAnimation>();
            SpriteSheets = new Dictionary<String, Texture2D>();
            Name = "Animation";
            Scale = 1.0f;
            _rotation = 0.0f;
            Facing = EFacingDirection.Left;
            _spriteEffect = SpriteEffects.None;

            ParentObject.Properties.UpdateProperty("BoundingBox", BoundingRect.Empty);
            ParentObject.Properties.UpdateProperty("IsPhysicsActive", true);
        }
 public DrawableGameObjectComponent(GameObject parentObject)
     : base(parentObject)
 {
 }
Esempio n. 6
0
 public WorldCollisionComponent(MinerGame game,GameObject parentObject)
     : base(parentObject)
 {
     _game = game;
     CollidingTiles = new List<Tile>();
 }
 public SimpleEnemyWorldCollisionComponent(MinerGame game, GameObject parentObject)
     : base(game, parentObject)
 {
 }
Esempio n. 8
0
 public GameObjectComponent(GameObject parentObject)
 {
     ParentObject = parentObject;
     Name = "NONAME";
     Active = true;
 }
Esempio n. 9
0
 public ItemRepeatComponent(GameObject parentObject, Vector2 position, string propertyToTrack, string texturePath)
     : base(parentObject,position,propertyToTrack)
 {
     _texturePath = texturePath;
 }
Esempio n. 10
0
 /// <summary>
 /// Konstruktor tworzący element HUD.
 /// </summary>
 /// <param name="parentObject">Obiekt do śledzenia</param>
 /// <param name="position">Pozycja na ekranie</param>
 /// <param name="propertyToTrack">Właściwość obiektu, której będzie odpowiadał ten element</param>
 public HudComponent(GameObject parentObject,Vector2 position, string propertyToTrack)
     : base(parentObject)
 {
     Position = position;
     PropertyToTrack = propertyToTrack;
 }
Esempio n. 11
0
 /// <summary>
 /// Sprawdza, czy obiekt koliduje z innym
 /// </summary>
 /// <param name="gameObject">Drugi obiekt</param>
 /// <returns></returns>
 public bool IsCollidingWith(GameObject gameObject)
 {
     return BoundingBox.Intersects(gameObject.BoundingBox);
 }