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

            _lastIntervalStart = TimeSpan.Zero;
            Active = false;
        }
Beispiel #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);
        }
Beispiel #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)
 {
 }
 public WorldCollisionComponent(MinerGame game,GameObject parentObject)
     : base(parentObject)
 {
     _game = game;
     CollidingTiles = new List<Tile>();
 }
 public SimpleEnemyWorldCollisionComponent(MinerGame game, GameObject parentObject)
     : base(game, parentObject)
 {
 }
Beispiel #8
0
 public GameObjectComponent(GameObject parentObject)
 {
     ParentObject = parentObject;
     Name = "NONAME";
     Active = true;
 }
Beispiel #9
0
 public ItemRepeatComponent(GameObject parentObject, Vector2 position, string propertyToTrack, string texturePath)
     : base(parentObject,position,propertyToTrack)
 {
     _texturePath = texturePath;
 }
Beispiel #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;
 }
Beispiel #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);
 }