public TimedEventComponent(EasyTopDownGame game, double interval, Action callback, int maxCount) : base(game) { this.interval = interval; this.callback = callback; this.maxCount = maxCount; }
public static void AttachOnCollisionHandlers(Body body, EasyTopDownGame game) { foreach (Fixture fixture in body.FixtureList) { fixture.OnCollision += game.OnFixtureCollision; } }
public ProjectileComponent(EasyTopDownGame game, EasyGameComponent originatingComponent, string sheetName, Vector2 direction, float velocity) : base(game, sheetName) { SetStartPosition(originatingComponent, direction); SetInMotion(direction, velocity); this.Body.IsBullet = true; }
public InputHandlerComponent(EasyTopDownGame game, Action callback, PlayerIndex playerIndex, params object[] inputs) : base(game) { this.game = game; this.callback = callback; this.playerIndex = playerIndex; this.InitializeInputs(inputs); }
/// <summary> /// Can be called by implementers who do not want default values for imageName, Category, Texture or Physics /// </summary> /// <param name="game"></param> public EasyGameComponent(EasyTopDownGame game) : base(game) { this.game = game; initialize(); }
public PlayerScoreDisplay(EasyTopDownGame game, PlayerIndex playerIndex, string fontName) : base(game, fontName) { Name = "Player " + playerIndex.ToString(); Score = 0; Scale = 1.0f; SecondsToLive = -1; LayerDepth = LayerDepths.Front; }
public WanderingEnemyGameComponent(EasyTopDownGame easyGame, String imageName) : base(easyGame, imageName) { DecisionCycleMinLength = 0; DecisionCycleMaxLength = 5; Acceleration = 2; currentDirection = Vector2.Zero; Body.FixedRotation = true; }
public RotatingPlayerComponent(EasyTopDownGame game, String sheetName, PlayerIndex playerIndex) : base(game, sheetName) { this.playerIndex = playerIndex; base.Acceleration = 6; base.MaxVelocity = PlayerGameComponent.DEFAULT_PLAYER_MAX_VELOCITY; base.InputChecker = new DirectionInputChecker(playerIndex); base.currentAnimationFrame = 0; }
public BackgroundGameComponent(EasyTopDownGame game, string imageName, Rectangle tileArea) : base(game) { this.game = game; this.imageName = imageName; this.tileArea = tileArea; this.LayerDepth = LayerDepths.Background; texture = game.Content.Load <Texture2D>(imageName); CalculateScalingFactor(); }
/// <summary> /// Creates a new EasyGameComponent /// </summary> /// <param name="game">The EasyTopDownGame instance that this component will be attached to.</param> /// <param name="imageName">Sets ImageName()</param> public EasyGameComponent(EasyTopDownGame game, String imageName) : base(game) { this.game = game; this.imageName = imageName; this.Category = imageName; this.texture = this.game.Content.Load<Texture2D>(imageName); initialize(); InitializePhysics(); }
/// <summary> /// Creates a new EasyGameComponent /// </summary> /// <param name="game">The EasyTopDownGame instance that this component will be attached to.</param> /// <param name="imageName">Sets ImageName()</param> public EasyGameComponent(EasyTopDownGame game, String imageName) : base(game) { this.game = game; this.imageName = imageName; this.Category = imageName; this.texture = this.game.Content.Load <Texture2D>(imageName); initialize(); InitializePhysics(); }
public BackgroundGameComponent(EasyTopDownGame game, string imageName, Rectangle tileArea) : base(game) { this.game = game; this.imageName = imageName; this.tileArea = tileArea; this.LayerDepth = LayerDepths.Background; texture = game.Content.Load<Texture2D>(imageName); CalculateScalingFactor(); }
public TextEffect(EasyTopDownGame game, string fontName, string message) : base(game) { this.game = game; FontColor = Color.White; this.FontName = fontName; this.Scale = 1; this.Message = message; this.SecondsToLive = -1; FlashColor = FontColor; FlashInterval = -1; }
public AnimatedGameComponent(EasyTopDownGame game, string sheetName) : base(game) { base.imageName = sheetName; this.Category = sheetName; LayerDepth = LayerDepths.Middle; this.SecondsPerFrame = .2; spriteSheet = game.Content.Load <SpriteSheet>(sheetName); Initialize(); InitializePhysics(); Scale = 1; }
public FourDirectionPlayerComponent(EasyTopDownGame easyGame, String imageName, PlayerIndex playerIndex) : base(easyGame, imageName) { this.playerIndex = playerIndex; Acceleration = 20f; base.MaxVelocity = 2f; base.InputChecker = new DirectionInputChecker(playerIndex); base.currentAnimationFrame = 0; Body.LinearDamping = 30; Body.Mass = 3; Body.Restitution = 0f; }
public AnimatedGameComponent(EasyTopDownGame game, string sheetName) : base(game) { base.imageName = sheetName; this.Category = sheetName; LayerDepth = LayerDepths.Middle; this.SecondsPerFrame = .2; spriteSheet = game.Content.Load<SpriteSheet>(sheetName); Initialize(); InitializePhysics(); Scale = 1; }
public PlayerGameComponent(EasyTopDownGame easyGame, String imageName, PlayerIndex playerIndex) : base(easyGame, imageName) { this.playerIndex = playerIndex; base.Acceleration = DEFAULT_PLAYER_ACCELERATION; base.MaxVelocity = DEFAULT_PLAYER_MAX_VELOCITY; base.InputChecker = new DirectionInputChecker(playerIndex); base.Body.FixedRotation = true; base.Body.IsStatic = false; Body.LinearDamping = 30; Body.Mass = 3; Body.Restitution = 0f; }
public EffectGameComponent(EasyTopDownGame game, String sheetName) : base(game) { SpriteSheet = game.Content.Load<SpriteSheet>(sheetName); this.game = game; ImagePrefix = sheetName; CurrentFrame = 0; SecondsPerFrame = 0.1; MaxLoops = 1; Position = new Vector2(0, 0); OverlayColor = Color.White; Rotation = 0; Scale = 1; LayerDepth = LayerDepths.Front; }
public EffectGameComponent(EasyTopDownGame game, String sheetName) : base(game) { SpriteSheet = game.Content.Load <SpriteSheet>(sheetName); this.game = game; ImagePrefix = sheetName; CurrentFrame = 0; SecondsPerFrame = 0.1; MaxLoops = 1; Position = new Vector2(0, 0); OverlayColor = Color.White; Rotation = 0; Scale = 1; LayerDepth = LayerDepths.Front; }
public Room(EasyTopDownGame game) { this.game = game; this.functionMap = new Dictionary <char, Func <EasyGameComponent> >(); this.nameMap = new Dictionary <char, string>(); }
public RotatingWanderingComponent(EasyTopDownGame game, string sheetName) : base(game, sheetName) { this.Acceleration = 4; }
public ConsumableGameComponent(EasyTopDownGame game, String imageName) : base(game, imageName) { }
public Room(EasyTopDownGame game) { this.game = game; this.functionMap = new Dictionary<char, Func<EasyGameComponent>>(); this.nameMap = new Dictionary<char, string>(); }
public AnimatedRotatingGameComponent(EasyTopDownGame game, string sheetName) : base(game, sheetName) { }