Exemple #1
0
 public Model(Game game,
              Pointf position,
              Size size,
              Velocity velocity)
     : this(game, position, size, velocity, 0)
 {
 }
Exemple #2
0
        public Character(Game game,
                            Pointf position,
                            Size size,
                            Velocity velocity,
                            PlayerIndex index
                        )
            : base(game, position, size, velocity)
        {
            EnableFreeFall();

            currentPlayer = index;
            if (currentPlayer == PlayerIndex.One)
            {
                mPlayerIndex = 0;
            }
            else if (currentPlayer == PlayerIndex.Two)
            {
                mPlayerIndex = 1;
            }
            else
            {
                mPlayerIndex = 2;
            }

            mSongJump = game.Content.Load<SoundEffect>("jump4");
        }
 public Displayable(Pointf position,
                    Size size,
                    Velocity velocity)
 {
     Position = new Pointf(position);
     Size = new Size(size);
     mVelocity = new Velocity(velocity);
 }
 public ExampleModel(Game game,
                     Pointf position,
                     Size size,
                     Velocity velocity)
     : base(game, position, size, velocity, 0)
 {
     //  how you would move
     mPosition.X = 40;
     Velocity.Speed = new Vector2(1,1);
     Velocity.Direction = new Vector2(2, 0);
 }
Exemple #5
0
        public Model(Game game,
                     Pointf position,
                     Size size,
                     Velocity velocity,
                     int parameterized)
            : base(game,
                 new Displayable(position, size, velocity), parameterized)
        {
            mDestroy = false;
            mId = idCntr++;
            mIsFreeFall = false;
            mFrames = new List<Frame>();
            GenerateFrames();

            mPosition.X += size.Width / 2;
            mPosition.Y += size.Height / 2;
        }
Exemple #6
0
 public Velocity(Velocity other)
 {
     mSpeed = new Vector2(other.Speed.X, other.Speed.Y);
     mDirection = new Vector2(other.Direction.X, other.Direction.Y);
 }