public override void Start()
 {
     this.controllingPlayer = ((CharacterInformationComponent)Parent.GetComponent("CharacterInformationComponent")).PlayerIndex;
     this.movementComponent = (MoveComponent)Parent.GetComponent("MoveComponent");
     this.bepuPhysicsComponent = (BepuPhysicsComponent)Parent.GetComponent("BepuPhysicsComponent");
     this.health = (VitalityComponent)Parent.GetComponent("VitalityComponent");
 }
Esempio n. 2
0
        public Character(string id, int lives, Box box, PlayerIndex controllingPlayer, int team, Environment environment, Color color)
        {
            // Create the vitality component to track the character's health.
            vitalityComponent = new VitalityComponent(this, lives);
            this.AttachComponent(vitalityComponent);

            // Create the info component to track the character information.
            characterInformationComponent = new CharacterInformationComponent(this, controllingPlayer, team, color);
            this.AttachComponent(characterInformationComponent);

            // Create the physics Component.
            // This will actually probably just translate into one box for jumps/gravity/trajectories
            // and collision between characters.
            bepuPhysicsComponent = new BepuPhysicsComponent(this, box);
            this.AttachComponent(bepuPhysicsComponent);

            // Create the Respawnable Component
            respawnableComponent = new RespawnableComponent(this, environment.Arena);
            this.AttachComponent(respawnableComponent);
        }
 public override void Start()
 {
     vitalityComponent = (VitalityComponent) Parent.GetComponent("VitalityComponent");
 }
 public override void Start()
 {
     vitalityComponent = (VitalityComponent)Parent.GetComponent("VitalityComponent");
     bepuPhysicsComponent = (BepuPhysicsComponent)Parent.GetComponent("BepuPhysicsComponent");
     cubeRenderComponent = (BasicModelComponent)Parent.GetComponent("BasicModelComponent");
 }