Exemplo 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;
 }
Exemplo n.º 2
0
        public TimerComponent(GameObject parentObject, TimeSpan interval, bool repeat)
            : base(parentObject)
        {
            _interval = interval;
            _repeat = repeat;

            _lastIntervalStart = TimeSpan.Zero;
            Active = false;
        }
Exemplo 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);
        }
Exemplo 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);
        }
Exemplo n.º 5
0
 public DrawableGameObjectComponent(GameObject parentObject)
     : base(parentObject)
 {
 }
Exemplo 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)
 {
 }
Exemplo n.º 8
0
 public GameObjectComponent(GameObject parentObject)
 {
     ParentObject = parentObject;
     Name = "NONAME";
     Active = true;
 }
Exemplo n.º 9
0
 public ItemRepeatComponent(GameObject parentObject, Vector2 position, string propertyToTrack, string texturePath)
     : base(parentObject,position,propertyToTrack)
 {
     _texturePath = texturePath;
 }
Exemplo 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;
 }
Exemplo 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);
 }