예제 #1
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()
 {
     characterInformationComponent = (CharacterInformationComponent) Parent.GetComponent("CharacterInformationComponent");
 }