public void EnemyShipDestroyed(GameObject gameObject) { var items = new[] { new { Texture = SpaceGraphics.EnemyShipChunkAssets[0], Direction = new Vector2(-1, -1) }, new { Texture = SpaceGraphics.EnemyShipChunkAssets[1], Direction = new Vector2(1, -1) }, new { Texture = SpaceGraphics.EnemyShipChunkAssets[2], Direction = new Vector2(-1, 0) }, new { Texture = SpaceGraphics.EnemyShipChunkAssets[3], Direction = new Vector2(1, 0) } }; foreach (var item in items) { var centre = gameObject.CentreLocal; var direction = item.Direction + gameObject.Velocity; var chunk = new GameObject("EnemyChunk", gameObject.Centre + (centre * item.Direction)); var sprite = new SpriteComponent(item.Texture, color: Color.White); var instance = new InstanceComponent(); var outOfBounds = new OutOfBoundsComponent(ObjectEvent.RemoveEntity); var movement = new MovementComponent(gameObject.Velocity.Y, FaceDirection.Down, direction); chunk.AddComponent(outOfBounds); chunk.AddComponent(sprite); chunk.AddComponent(instance); chunk.AddComponent(movement); gameObject.GameLayer.AddGameObject(chunk); } }
private void CreateBossOne(int enemyBulletDelay, int scale = 1) { var xPosition = GameHelper.GetRelativeScaleX(0.5f); var enemy = new GameObject("Boss", new Vector2(xPosition, 0)) { Scale = scale }; var shipTexture = SpaceGraphics.BossAAsset.First(); var enemySprite = new SpriteComponent(shipTexture); var enemyMovement = new MovementComponent(0.1f, FaceDirection.Down, new Vector2(0, 1)); var enemyBullet = new BulletComponent(TopDown.EnemyBulletName, SpaceGraphics.BulletAsset[0], enemyMovement); var enemyBoundary = new BoundaryComponent(SpaceGraphics.BoundaryAsset.First(), shipTexture.Width, shipTexture.Height); var enemyTimed = new TimedActionComponent(ObjectEvent.Fire, enemyBulletDelay); var enemyOutOfBounds = new OutOfBoundsComponent(ObjectEvent.RemoveEntity); var healthCounterComponent = new CounterIncrementComponent(ObjectEvent.CollisionEnter, ObjectEvent.HealthRemoved, ObjectEvent.HealthEmpty, ObjectEvent.HealthReset, 5, 0); var healthBarComponent = new SpriteRepeaterComponent(SpaceGraphics.HealthBarAsset[1], new Vector2(0, 25), false, ObjectEvent.HealthRemoved, healthCounterComponent); var deathAction = new ObjectEventComponent(ObjectEvent.HealthEmpty, BossDeath); enemy.AddComponent(enemySprite); enemy.AddComponent(enemyMovement); enemy.AddComponent(enemyBullet); enemy.AddComponent(enemyBoundary); enemy.AddComponent(enemyOutOfBounds); enemy.AddComponent(enemyTimed); enemy.AddComponent(healthCounterComponent); enemy.AddComponent(healthBarComponent); enemy.AddComponent(deathAction); ForegroundLayer.AddGameObject(enemy); }
protected override void OnDelayedAttachAsMain(Character target) { this.character = target; Character casterCharacter = caster.GetComponent <SkillComponent>().Character; Direction casterFacingDirection = casterCharacter.FacingDirection(); targetMovementComponent = targetEntity.GetComponent <MovementComponent>(); targetMovementComponent.WallCollisionHandler += OnWallCollision; Direction movementDirection = StaggerModifier.CalculateMovementDirection( casterMovementComponent, targetMovementComponent, collidedProjectilePosition, info.MovementBehavior ); Direction facingDirection = StaggerModifier.CalculateFacingDirection( casterMovementComponent, targetMovementComponent, collidedProjectilePosition, info.FacingBehavior, movementDirection ); targetMovementComponent.MovingDirection = movementDirection.ToNormalizedVector2(); targetMovementComponent.FacingDirection = facingDirection; target.InterruptChannelingSkill(); target.PlayAnimation(animProfile.Upper()); target.JumpToFrame(4); //DLog.LogError("Jump on knockdown"); blastRequest = (BlastRequest)DoBlast(target); stageFromPreviousCheck = blastRequest.ShowStage(); state = State.Peaking; }
protected override void OnInitialize() { base.OnInitialize(); AttributesComponent = this.GetDependency <AttributesComponent>(); CombatComponent = Parent.GetComponent <CombatComponent>(); MovementComponent = this.GetDependency <MovementComponent>(); FloatingTextComponent = this.GetDependency <FloatingTextComponent>(); }
public void InternalDestroyTest() { MovementComponent c = new MovementComponent(2, 3); c.InternalDestroy(); Assert.AreEqual(0, c.X, "X value incorrect"); Assert.AreEqual(0, c.Y, "Y value incorrect"); }
// Use this for initialization void Start() { m_PlayerRigid = GameObject.Find("Player").GetComponent <Rigidbody2D>(); m_PlayerMoveComp = GameObject.Find("Player").GetComponent <MovementComponent>(); m_PlayerTransform = GameObject.Find("Player").GetComponent <Transform>(); animator = GameObject.Find("Animations").GetComponent <Animator>(); }
private void Start() { _gameObject = GameObject.FindGameObjectWithTag("Player"); _health = _gameObject.GetComponent <HealthComponent>(); //_transform = _gameObject.transform; _body = _gameObject.GetComponent <Rigidbody2D>(); _movement = _gameObject.GetComponent <MovementComponent>(); }
public Creature(Species.Type inSpeciesType, Tile inSpawnTile) { guid = Guid.NewGuid(); species = SpeciesManager.GetSpecies(inSpeciesType); healthComponent = new HealthComponent(this); movementComponent = new MovementComponent(this, inSpawnTile); }
private void AddPlayer() { playerID = Game.EntityManager.CreateEntity(); var inputBlock = new ActionComponent(); inputBlock.InitComponent(null); Game.EntityManager.AddComponent(playerID, inputBlock); var form = new FormComponent(); form.InitComponent(playerID, new Vector3(0, 50, 0), "Player", ""); Game.EntityManager.AddComponent(playerID, form); var animComp = new AnimationComponent(); animComp.InitComponent(null); Game.EntityManager.AddComponent(playerID, animComp); var move = new MovementComponent(); move.InitComponent(null); Game.EntityManager.AddComponent(playerID, move); var crouch = new CrouchComponent(); crouch.InitComponent(null); Game.EntityManager.AddComponent(playerID, crouch); var run = new RunComponent(); run.InitComponent(null); Game.EntityManager.AddComponent(playerID, run); var jump = new JumpComponent(); jump.InitComponent(null); Game.EntityManager.AddComponent(playerID, jump); var skill = new SkillComponent(); skill.InitComponent(null); Game.EntityManager.AddComponent(playerID, skill); var health = new HealthComponent() { Damage = 0, DeathType = HealthComponent.DeathTypes.LifeEnded, HP_Max = 50 }; health.InitComponent(null); Game.EntityManager.AddComponent(playerID, health); var menuOptions = new MenuComponent(); menuOptions.InitComponent(null); menuOptions.InitComponent(playerID, "Menu"); Game.EntityManager.AddComponent(playerID, menuOptions); }
public void Initialize( HealthComponent healthComponent, DataComponent data, MovementComponent movement) { _data = data; _unit = movement; _healthComponent = healthComponent; }
public void Convert(Entity entity, EntityManager dstManager, GameObjectConversionSystem conversionSystem) { // Call methods on 'dstManager' to create runtime components on 'entity' here. Remember that: var data = new MovementComponent { startPos = startPos, speed = speed, targetPos = targetPos }; dstManager.AddComponentData(entity, data); }
private Vector3 TweenComponent(MovementComponent comp, float t) { var targetOffset = Mathf.Sin(t * Mathf.PI * 2f) * comp.delta; var delta = targetOffset - comp.prevOffset; // _transform.localPosition += delta; comp.prevOffset = targetOffset; return(delta); }
public WindModifier(ModifierInfo info, Entity casterEntity, Entity targetEntity, Environment environment, CollectionOfInteractions modifierInteractionCollection) : base(info, casterEntity, targetEntity, environment, modifierInteractionCollection) { this.info = (WindInfo)info; targetMovementComponent = targetEntity.GetComponent <MovementComponent>(); casterMovementComponent = casterEntity.GetComponent <MovementComponent>(); duration = this.info.Wmc.ShowDurationInSeconds(); }
private void Awake() { Random.InitState((int)System.DateTime.Now.Ticks); base.Awake(); movComp = GetComponent <MovementComponent>(); audioSource = GetComponent <AudioSource>(); shootTime = fireRate; jumpTime = Random.Range(minJumpRate, maxJumpRate); }
public MoveSpeedModifier(ModifierInfo info, Entity casterEntity, Entity targetEntity, Environment environment, CollectionOfInteractions modifierInteractionCollection) : base(info, casterEntity, targetEntity, environment, modifierInteractionCollection) { this.info = (MoveSpeedInfo)info; this.targetEntity = targetEntity; targetMovementComponent = targetEntity.GetComponent <MovementComponent>(); }
private void StunWalking(MovementComponent move) { if (move == null) { return; } move.SlowDown = 0.1f; }
void Awake() { _equipment = GetComponent<EquipmentComponent>(); _movement = GetComponent<MovementComponent>(); _health = GetComponent<HealthComponent>(); _skelAnim = GetComponent<SkeletonAnimation>(); _health.armorValue = _equipment.GetArmor(); }
private void Rotate(InputComponent ic, MovementComponent mc) { if (ic.GetInputDirection().magnitude > 0) { Vector3 flatRot = new Vector3(mc.velocity.x, 0f, mc.velocity.z); float dot = Vector3.Dot(flatRot, mc.gameObject.transform.right); mc.GetOwnerGO().transform.Rotate(Vector3.up, dot * mc.turnSpeed); } }
private void OnTriggerEnter2D(Collider2D other) { MovementComponent moveable = other.GetComponent <MovementComponent>(); if (moveable) { moveable.StopMovement(); } }
private void Awake() { direction = 1; input = GetComponent <InputComponent>(); movement = GetComponent <MovementComponent> (); input.OnDodge += Dodge; // subscribe to Dodge delegate rb = GetComponent <Rigidbody2D>(); player = GetComponent <Player>(); }
public static bool CanAttack( AttackComponent unitAttackComponent, MovementComponent unitMovementComponent, MovementComponent targetMovementComponent) { return(unitAttackComponent.LastAttackTime + unitAttackComponent.AttackDelay <= DateTime.Now && Vector3.Distance( unitMovementComponent.CurrentPosition, targetMovementComponent.CurrentPosition) <= unitAttackComponent.AttackRange); }
public Unit(HealthComponent health, AttackComponent attack, MovementComponent movement, TargetComponent target, AiComponent ai, StatsComponent stats) { this.health = health; this.attack = attack; this.movement = movement; this.target = target; this.ai = ai; this.stats = stats; }
internal static unsafe Vector Invoke(IntPtr obj, MovementComponent MovementComp) { long *p = stackalloc long[] { 0L, 0L, 0L, 0L }; byte *b = (byte *)p; *((IntPtr *)(b + 0)) = MovementComp; Main.GetProcessEvent(obj, GetAvoidanceVelocityForComponent_ptr, new IntPtr(p));; return(*((Vector *)(b + 8))); } }
public static bool CanBuildingAttack(AttackComponent unitAttackComponent, MovementComponent unitMovementComponent, MovementComponent targetMovementComponent, int buildScale) { return(unitAttackComponent.LastAttackTime + unitAttackComponent.AttackDelay <= DateTime.Now && Vector3.Distance( unitMovementComponent.CurrentPosition, targetMovementComponent.CurrentPosition) <= buildScale); }
public void OnEndDrag(PointerEventData eventData) { if (m_DraggingIcon != null) { Destroy(m_DraggingIcon); } MovementComponent.MouseToCellPos(Input.mousePosition); // Debug.Log(Input.mousePosition+ " " + MovementComponent.MouseToCellPos(Input.mousePosition)); }
private void ProcessDestinationMode(float progress) { if (isFirstUpdate) { originalOrientation = movementComponent.Orientation; Vector3 desired = Vector3.right; switch (destinationRotationMode.ShowFacingDirection()) { case FacingDirection.Enemy: Character enemy = FindEnemy(); MovementComponent enemyMovementComponent = enemy.GameObject().GetComponent <EntityReference>().Entity .GetComponent <MovementComponent>(); Vector3 clampedEnemyPos = enemyMovementComponent.PositionV3.CloneWithNewY(movementComponent.Position.y); desired = clampedEnemyPos - movementComponent.PositionV3; break; case FacingDirection.Left: desired = Vector3.left; break; case FacingDirection.Right: desired = Vector3.right; break; } Vector3 facing = movementComponent.Orientation * Vector3.right; deltaQuaternion = Quaternion.FromToRotation(facing, desired); destinationQuaternion = originalOrientation * deltaQuaternion; float deltaAngle = Vector3.Angle(facing, desired); float dotProduct = Quaternion.Dot(originalOrientation, destinationQuaternion); if (dotProduct < 0) //longer rotation path detected, switch to shorter path { originalOrientation = originalOrientation.ScalarMultiply(-1); deltaQuaternion = deltaQuaternion.ScalarMultiply(-1); } if (deltaAngle > destinationRotationMode.maxAngle) { deltaAngle = destinationRotationMode.maxAngle; Vector3 axis = Vector3.up; float outAngle = 0; deltaQuaternion.ToAngleAxis(out outAngle, out axis); deltaQuaternion = Quaternion.AngleAxis(deltaAngle, axis); destinationQuaternion = originalOrientation * deltaQuaternion; } } movementComponent.SetOrientation( QuaternionExtension.Interpolate( originalOrientation, destinationQuaternion, interpolator, progress, true ) ); if (progress >= 1) { movementComponent.SetOrientation(destinationQuaternion); } }
public static void Update(EntityComponentStorage ecs, KeyboardState keyState) { // "Keys" is a monogame enum Keys[] pressedKeys = keyState.GetPressedKeys(); // grab first entity with input component. // input component contains no data, just indicates which Entity should be acted // upon by InputSystem Eid inputEid = ecs.componentEids[ ecs.ComponentCids[typeof(InputComponent)]][0]; // this entity must have a movement component MovementComponent movementComponent = ((MovementComponent)ecs.Entities[inputEid]. Components[ecs.ComponentCids[typeof(MovementComponent)]]); if (movementComponent != null) { // reset velocity of current entity movementComponent.Velocity = Vector2.Zero; // delegate modifies position component of the entity with input component Action <Vector2> addToInputEntVelocity; addToInputEntVelocity = value => ((MovementComponent)ecs.Entities[inputEid]. Components[ecs.ComponentCids[typeof(MovementComponent)]]).Velocity += value; // appropriately modify position component of input entity foreach (Keys pressedKey in pressedKeys) { switch (pressedKey) { case Keys.W: addToInputEntVelocity(MovementSystem.MoveVectors.UP * movementComponent.MoveSpeed); break; case Keys.A: addToInputEntVelocity(MovementSystem.MoveVectors.LEFT * movementComponent.MoveSpeed); break; case Keys.S: addToInputEntVelocity(MovementSystem.MoveVectors.DOWN * movementComponent.MoveSpeed); break; case Keys.D: addToInputEntVelocity(MovementSystem.MoveVectors.RIGHT * movementComponent.MoveSpeed); break; } } } }
void Start() { moveComp = gameObject.GetComponent <MovementComponent>(); if (moveComp == null) { return; } moveComp.Stoped += Stop; moveComp.NewMove += Move; }
internal static unsafe bool Invoke(IntPtr obj, MovementComponent MovementComp, float AvoidanceWeight) { long *p = stackalloc long[] { 0L, 0L, 0L }; byte *b = (byte *)p; *((IntPtr *)(b + 0)) = MovementComp; *((float *)(b + 8)) = AvoidanceWeight; Main.GetProcessEvent(obj, RegisterMovementComponent_ptr, new IntPtr(p));; return(*((bool *)(b + 12))); } }
private void Start() { // Get components for moving and teleporting PMC = PlayerGameObject.GetComponent <MovementComponent>(); PTC = PlayerGameObject.GetComponent <TeleportComponent>(); // bind Command to Class buttonW = new MoveForward(PMC); buttonS = new MoveBackwards(PMC); buttonShift = new Teleport(PTC); nothing = new DoNothing(PMC); }
void UnPossess() { possessedItem.onBreak.RemoveListener(UnPossess); ghostObject.transform.position = possessedItem.transform.position; possessedItem = null; targetObject = null; moveComponent = ghostObject.GetComponent <MovementComponent>(); canPickupNewTarget = combo; EnableCollisionAndRender(true); }
public void Initialize() { _entityMock = new Mock<IEntity>(); _movement = new MovementComponent(); _movement.Parent = _entityMock.Object; _container = new FakeGameplayContainer(); _screen = new Mock<ITiledScreen>(); _entityMock.SetupGet(e => e.Screen).Returns(_screen.Object); _entityMock.SetupGet(e => e.Container).Returns(_container); _position = new PositionComponent(); _movement.RegisterDependencies(_position); }
public override void Initialize() { base.Initialize(); _collision = new CollisionComponent(); _collision.Parent = EntityMock.Object; _movement = new MovementComponent(); _movement.Parent = EntityMock.Object; _position = new PositionComponent(); _position.Parent = EntityMock.Object; _movement.RegisterDependencies(_position); _movement.RegisterDependencies(_collision); _collision.RegisterDependencies(_position); _collision.RegisterDependencies(_movement); _position.Start(Container); _movement.Start(Container); _collision.Start(Container); }
void Awake() { _healthcomponent = GetComponent<HealthComponent>(); _movement = GetComponent<MovementComponent>(); _animComponent = GetComponent<AnimationComponent>(); float random = Random.Range ( -25f, 25f ); _movement.BASESPEED += random; }
/// <summary> /// Allows the game to perform any initialization it needs to before starting to run. /// This is where it can query for any required services and load any non-graphic /// related content. Calling base.Initialize will enumerate through any components /// and initialize them as well. /// </summary> protected override void Initialize() { AggregateFactory = new AggregateFactory(this); WeaponFactory = new WeaponFactory(this); DoorFactory = new DoorFactory(this); RoomFactory = new RoomFactory(this); CollectableFactory = new CollectibleFactory(this); WallFactory = new WallFactory(this); EnemyFactory = new EnemyFactory(this); SkillEntityFactory = new SkillEntityFactory(this); NPCFactory = new NPCFactory(this); // Initialize Components PlayerComponent = new PlayerComponent(); LocalComponent = new LocalComponent(); RemoteComponent = new RemoteComponent(); PositionComponent = new PositionComponent(); MovementComponent = new MovementComponent(); MovementSpriteComponent = new MovementSpriteComponent(); SpriteComponent = new SpriteComponent(); DoorComponent = new DoorComponent(); RoomComponent = new RoomComponent(); HUDSpriteComponent = new HUDSpriteComponent(); HUDComponent = new HUDComponent(); InventoryComponent = new InventoryComponent(); InventorySpriteComponent = new InventorySpriteComponent(); ContinueNewGameScreen = new ContinueNewGameScreen(graphics, this); EquipmentComponent = new EquipmentComponent(); WeaponComponent = new WeaponComponent(); BulletComponent = new BulletComponent(); PlayerInfoComponent = new PlayerInfoComponent(); WeaponSpriteComponent = new WeaponSpriteComponent(); StatsComponent = new StatsComponent(); EnemyAIComponent = new EnemyAIComponent(); NpcAIComponent = new NpcAIComponent(); CollectibleComponent = new CollectibleComponent(); CollisionComponent = new CollisionComponent(); TriggerComponent = new TriggerComponent(); EnemyComponent = new EnemyComponent(); NPCComponent = new NPCComponent(); //QuestComponent = new QuestComponent(); LevelManager = new LevelManager(this); SpriteAnimationComponent = new SpriteAnimationComponent(); SkillProjectileComponent = new SkillProjectileComponent(); SkillAoEComponent = new SkillAoEComponent(); SkillDeployableComponent = new SkillDeployableComponent(); SoundComponent = new SoundComponent(); ActorTextComponent = new ActorTextComponent(); TurretComponent = new TurretComponent(); TrapComponent = new TrapComponent(); ExplodingDroidComponent = new ExplodingDroidComponent(); HealingStationComponent = new HealingStationComponent(); PortableShieldComponent = new PortableShieldComponent(); PortableStoreComponent = new PortableStoreComponent(); ActiveSkillComponent = new ActiveSkillComponent(); PlayerSkillInfoComponent = new PlayerSkillInfoComponent(); Quests = new List<Quest>(); #region Initialize Effect Components AgroDropComponent = new AgroDropComponent(); AgroGainComponent = new AgroGainComponent(); BuffComponent = new BuffComponent(); ChanceToSucceedComponent = new ChanceToSucceedComponent(); ChangeVisibilityComponent = new ChangeVisibilityComponent(); CoolDownComponent = new CoolDownComponent(); DamageOverTimeComponent = new DamageOverTimeComponent(); DirectDamageComponent = new DirectDamageComponent(); DirectHealComponent = new DirectHealComponent(); FearComponent = new FearComponent(); HealOverTimeComponent = new HealOverTimeComponent(); InstantEffectComponent = new InstantEffectComponent(); KnockBackComponent = new KnockBackComponent(); TargetedKnockBackComponent = new TargetedKnockBackComponent(); ReduceAgroRangeComponent = new ReduceAgroRangeComponent(); ResurrectComponent = new ResurrectComponent(); StunComponent = new StunComponent(); TimedEffectComponent = new TimedEffectComponent(); EnslaveComponent = new EnslaveComponent(); CloakComponent = new CloakComponent(); #endregion base.Initialize(); }
/// <summary> /// Allows the game to perform any initialization it needs to before starting to run. /// This is where it can query for any required services and load any non-graphic /// related content. Calling base.Initialize will enumerate through any components /// and initialize them as well. /// </summary> protected override void Initialize() { AggregateFactory = new AggregateFactory(this); WeaponFactory = new WeaponFactory(this); DoorFactory = new DoorFactory(this); RoomFactory = new RoomFactory(this); CollectableFactory = new CollectibleFactory(this); WallFactory = new WallFactory(this); EnemyFactory = new EnemyFactory(this); // Initialize Components PlayerComponent = new PlayerComponent(); LocalComponent = new LocalComponent(); RemoteComponent = new RemoteComponent(); PositionComponent = new PositionComponent(); MovementComponent = new MovementComponent(); MovementSpriteComponent = new MovementSpriteComponent(); SpriteComponent = new SpriteComponent(); DoorComponent = new DoorComponent(); RoomComponent = new RoomComponent(); HUDSpriteComponent = new HUDSpriteComponent(); HUDComponent = new HUDComponent(); InventoryComponent = new InventoryComponent(); InventorySpriteComponent = new InventorySpriteComponent(); ContinueNewGameScreen = new ContinueNewGameScreen(graphics, this); EquipmentComponent = new EquipmentComponent(); WeaponComponent = new WeaponComponent(); BulletComponent = new BulletComponent(); PlayerInfoComponent = new PlayerInfoComponent(); WeaponSpriteComponent = new WeaponSpriteComponent(); StatsComponent = new StatsComponent(); EnemyAIComponent = new EnemyAIComponent(); CollectibleComponent = new CollectibleComponent(); CollisionComponent = new CollisionComponent(); TriggerComponent = new TriggerComponent(); EnemyComponent = new EnemyComponent(); QuestComponent = new QuestComponent(); LevelManager = new LevelManager(this); SpriteAnimationComponent = new SpriteAnimationComponent(); SkillProjectileComponent = new SkillProjectileComponent(); SkillAoEComponent = new SkillAoEComponent(); SkillDeployableComponent = new SkillDeployableComponent(); //TurretComponent = new TurretComponent(); //TrapComponent = new TrapComponent(); //PortableShopComponent = new PortableShopComponent(); //PortableShieldComponent = new PortableShieldComponent(); //MotivateComponent = new MotivateComponent(); //FallbackComponent = new FallbackComponent(); //ChargeComponent = new ChargeComponent(); //HealingStationComponent = new HealingStationComponent(); //ExplodingDroidComponent = new ExplodingDroidComponent(); base.Initialize(); }
private static void LoadMovementComponent(MovementComponentInfo info, GameEntity entity) { var moveComp = new MovementComponent(); entity.AddComponent(moveComp); moveComp.LoadInfo(info); }
/// <summary> /// Allows the game to perform any initialization it needs to before starting to run. /// This is where it can query for any required services and load any non-graphic /// related content. Calling base.Initialize will enumerate through any components /// and initialize them as well. /// </summary> protected override void Initialize() { AggregateFactory = new AggregateFactory(this); // Initialize Components PlayerComponent = new PlayerComponent(); LocalComponent = new LocalComponent(); RemoteComponent = new RemoteComponent(); PositionComponent = new PositionComponent(); MovementComponent = new MovementComponent(); MovementSpriteComponent = new MovementSpriteComponent(); SpriteComponent = new SpriteComponent(); DoorComponent = new DoorComponent(); RoomComponent = new RoomComponent(); HUDSpriteComponent = new HUDSpriteComponent(); HUDComponent = new HUDComponent(); CharacterSelectionScreen = new CharacterSelectionScreen(graphics, this); LevelManager = new LevelManager(this); base.Initialize(); }
/// <summary> /// Allows the game to perform any initialization it needs to before starting to run. /// This is where it can query for any required services and load any non-graphic /// related content. Calling base.Initialize will enumerate through any components /// and initialize them as well. /// </summary> protected override void Initialize() { AggregateFactory = new AggregateFactory(this); // Initialize Components PlayerComponent = new PlayerComponent(); LocalComponent = new LocalComponent(); RemoteComponent = new RemoteComponent(); PositionComponent = new PositionComponent(); MovementComponent = new MovementComponent(); MovementSpriteComponent = new MovementSpriteComponent(); SpriteComponent = new SpriteComponent(); base.Initialize(); }