Beispiel #1
0
 public BeerController(Game1 game, GameEntity entity)
     : base(game, entity)
 {
     physicalData = entity.GetSharedData(typeof(Entity)) as Entity;
     physicalData.IsAffectedByGravity = false;
     physicalData.CollisionInformation.Events.DetectingInitialCollision += HandleCollision;
 }
Beispiel #2
0
 /// <summary>
 /// The main entry point for the application.
 /// </summary>
 static void Main(string[] args)
 {
     using (Game1 game = new Game1())
     {
         game.Run();
     }
 }
Beispiel #3
0
 public RioterController(Game1 game, GameEntity entity)
     : base(game, entity)
 {
     physicalData = entity.GetSharedData(typeof(Entity)) as Entity;
     anims = entity.GetSharedData(typeof(AnimationPlayer)) as AnimationPlayer;
     playerData = game.GetPlayerEntity();
     runSpeed = game.rand.Next(15, 28);
 }
Beispiel #4
0
 public CameraComponent(Game1 game)
     : base(game)
 {
     this.UpdateOrder = 2;
     for (int i = 0; i < NUM_LIGHTS; ++i)
     {
         lightPositions[i] = inactiveLightPos;
     }
 }
        public AnimatedModelComponent(Game1 game, GameEntity entity, Model model, float drawScale, Vector3 drawOffset)
            : base(game, entity)
        {
            this.model = model;
            this.localOffset = drawOffset;
            this.syncedModels = entity.GetSharedData(typeof(Dictionary<string, Model>)) as Dictionary<string, Model>;
            this.animationPlayer = entity.GetSharedData(typeof(AnimationPlayer)) as AnimationPlayer;

            animationPlayer.StartClip(animationPlayer.skinningDataValue.AnimationClips.Keys.First(), MixType.None);

            modelParams = new SharedGraphicsParams();
            modelParams.size = new Vector3(drawScale);
            entity.AddSharedData(typeof(SharedGraphicsParams), modelParams);
        }
        /// <summary>
        /// constructs a new model component for rendering models without animations
        /// </summary>
        public UnanimatedModelComponent(Game1 game, GameEntity entity, Model model, Vector3 drawScale, Vector3 localOffset, float yaw, float pitch, float roll)
            : base(game, entity)
        {
            this.model = model;
            this.localOffset = localOffset;

            modelParams = new SharedGraphicsParams();
            modelParams.size = drawScale;
            entity.AddSharedData(typeof(SharedGraphicsParams), modelParams);

            this.yaw = yaw;
            this.pitch = pitch;
            this.roll = roll;

            Matrix3X3 bepurot = physicalData.OrientationMatrix;
            rotation = new Matrix(bepurot.M11, bepurot.M12, bepurot.M13, 0, bepurot.M21, bepurot.M22, bepurot.M23, 0, bepurot.M31, bepurot.M32, bepurot.M33, 0, 0, 0, 0, 1);
        }
Beispiel #7
0
 public CarController(Game1 game, GameEntity entity)
     : base(game, entity)
 {
     stupid = 35;
 }
Beispiel #8
0
 public StaticMeshComponent(Game1 game, GameEntity entity)
     : base(game, entity)
 {
     this.collidable = Entity.GetSharedData(typeof(StaticMesh)) as StaticMesh;
 }
Beispiel #9
0
 public PlayerController(Game1 game, GameEntity entity)
     : base(game, entity)
 {
     physicalData = entity.GetSharedData(typeof(Entity)) as Entity;
     anims = entity.GetSharedData(typeof(AnimationPlayer)) as AnimationPlayer;
 }
Beispiel #10
0
 public Component(Game1 game, GameEntity entity)
 {
     this.Game = game;
     this.Entity = entity;
     Remove = false;
 }
Beispiel #11
0
 public DrawableComponent3D(Game1 game, GameEntity entity)
     : base(game, entity)
 {
     this.physicalData = entity.GetSharedData(typeof(Entity)) as Entity;
 }
Beispiel #12
0
 public ModelManager(Game1 game)
     : base(game)
 {
     camera = game.Services.GetService(typeof(CameraComponent)) as CameraComponent;
     this.UpdateOrder = 3;
 }
Beispiel #13
0
 public PhysicsComponent(Game1 game, GameEntity entity)
     : base(game, entity)
 {
     this.collidable = entity.GetSharedData(typeof(Entity)) as Entity;
 }
Beispiel #14
0
 public LightPoleController(Game1 game, GameEntity entity)
     : base(game, entity)
 {
     stupid = 25;
 }
Beispiel #15
0
 public DestructibleProp(Game1 game, GameEntity entity)
     : base(game, entity)
 {
     physicalData = entity.GetSharedData(typeof(Entity)) as Entity;
     physicalData.CollisionInformation.Events.DetectingInitialCollision += HandleCollision;
 }
 public GeneralComponentManager(Game1 game)
     : base(game)
 {
 }
Beispiel #17
0
 public EntityManager(Game1 game)
     : base(game)
 {
     this.mainGame = game;
     camera = game.Services.GetService(typeof(CameraComponent)) as CameraComponent;
 }
Beispiel #18
0
 public MailboxController(Game1 game, GameEntity entity)
     : base(game, entity)
 {
     stupid = 10;
 }