Beispiel #1
0
        public Player(Texture2D image, float x, float y, int frame, Weapon weapon, Fire fire, KeyboardState oldState,
                      GamePadState oldPadStatePlayer, SpriteFont theFont, Asteroid asteroid)
        {
            this.fire                = fire;
            speedIncrement           = 0.004f;
            speedDecrement           = 0.96f;
            angularVelocityIncrement = .001111111f;
            AngularVelocityDecrement = 0.96f;
            velocityDecrement        = 0.995f;
            angleIncrement           = 0.1f;
            this.asteroid            = asteroid;
            this.weapon              = weapon;
            this.theFont             = theFont;
            this.oldPadStatePlayer   = oldPadStatePlayer;
            this.oldState            = oldState;
            theColor               = Color.White;
            this.image             = image;
            this.x                 = x;
            this.y                 = y;
            this.frame             = frame;
            healthPoints           = 150;
            currentAngularVelocity = 0;

            timeSinceLastCollision  = 0;
            timeSinceLastCollision2 = 0;
            timeSinceLastFlash      = 0;
            chosenColor             = Color.White;
            fireTime = 0;
            hit      = false;
            //timeSinceLastFrame = weapon.Timer.ElapsedGameTime;
            position        = new Vector2(x, y);
            velocity        = new Vector2(0f, 0f);
            angle           = (float)((3 * Math.PI) / 2);
            angularVelocity = 0;
            time            = 0;
        }
Beispiel #2
0
 public InputController(Ship ship, Fire fire)
 {
     _ship = ship;
     _fire = fire;
 }