public BarComponent(GameObject parentObject, Vector2 position, string propertyToTrack, float maxValue, string emptyTexturePath,string fullTexturePath) : base(parentObject,position,propertyToTrack) { _maxValue = maxValue; _emptyTexturePath = emptyTexturePath; _fullTexturePath = fullTexturePath; }
public TimerComponent(GameObject parentObject, TimeSpan interval, bool repeat) : base(parentObject) { _interval = interval; _repeat = repeat; _lastIntervalStart = TimeSpan.Zero; Active = false; }
public PhysicsComponent(GameObject gameObject) : base(gameObject) { Name = "Physics"; HasGravity = false; HasDrag = true; _gravity = new Vector2(0, 600); MaxVelocity = 5000; ParentObject.Properties.UpdateProperty("IsPhysicsActive", true); }
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) { }
public GameObjectComponent(GameObject parentObject) { ParentObject = parentObject; Name = "NONAME"; Active = true; }
public ItemRepeatComponent(GameObject parentObject, Vector2 position, string propertyToTrack, string texturePath) : base(parentObject,position,propertyToTrack) { _texturePath = texturePath; }
/// <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; }
/// <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); }