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"); }
public override void Start() { base.Start(); // Get a reference to the transform component this.physicsComponent = (BepuPhysicsComponent)Parent.GetComponent("BepuPhysicsComponent"); this.movementComponent = (MoveComponent)Parent.GetComponent("MoveComponent"); }
public FightingRobot(int lives, Vector3 spawnPosition, PlayerIndex controllingPlayer, int team, Environment environment, Color color) : base("FightingRobot", lives, new Box(spawnPosition, BEPU_PHYSICS_WIDTH, BEPU_PHYSICS_HEIGHT, BEPU_PHYSICS_DEPTH, MASS), controllingPlayer, team, environment, color) { grabbableComponent = new GrabbableComponent(this, THROW_MIN_FLINCH, THROW_MAX_FLINCH); this.AttachComponent(grabbableComponent); BasicModelComponent drawComponent = new RobotRenderComponent(this, BEPU_PHYSICS_HEIGHT, SCALE, color); this.AttachComponent(drawComponent); //BasicModelComponent drawComponent2 = new CubeRenderComponent(this, Matrix.CreateScale(BEPU_PHYSICS_WIDTH, BEPU_PHYSICS_HEIGHT, BEPU_PHYSICS_WIDTH)); //this.AttachComponent(drawComponent2); JumpComponent jumpComponent = new JumpComponent(this, JUMP_HEIGHT, MAX_JUMPS, environment); this.AttachComponent(jumpComponent); MoveComponent moveComponent = new MoveComponent(this, SPEED); this.AttachComponent(moveComponent); grabComponent = new GrabComponent(this, environment, THROW_BASE_DAMAGE, THROW_MAX_DAMAGE); this.AttachComponent(grabComponent); punchComponent = new PunchComponent(this, environment, PUNCH_SPEED, PUNCH_BASE_DAMAGE, PUNCH_MAX_DAMAGE, PUNCH_MIN_FLINCH, PUNCH_MAX_FLINCH); this.AttachComponent(punchComponent); FireProjectileComponent fireProjectileComponent = new FireProjectileComponent(this, FIRE_SPEED, FIRE_VELOCITY, environment, FIRE_BASE_DAMAGE, FIRE_MAX_DAMAGE, FIRE_MIN_FLINCH, FIRE_MAX_FLINCH); this.AttachComponent(fireProjectileComponent); }