예제 #1
0
        public void FireBullet(GameTime gameTime)
        {
            Bullet b = new Bullet();

            b.Position = p.playerSprite.position;
            b.Velocity = LinePrimatives.AngleToV2(MathHelper.ToDegrees(p.playerSprite.rotation), b.moveSpeed);
        }
        public void ShootTorpedo()
        {
            Torpedo T = new Torpedo();

            T.Position = sprite.position;
            T.Rotation = sprite.rotation;
            T.Velocity = LinePrimatives.AngleToV2(MathHelper.ToDegrees(sprite.rotation), T.MovementSpeed);
            T.owner    = this;
        }
        public override void InitalizeObject()
        {
            sprite          = new Sprite("Torp");
            sprite.scale    = .15f;
            sprite.origin.X = sprite.texture.Width / 2;
            sprite.origin.Y = sprite.texture.Height / 2;

            MovementSpeed = 70f;

            Velocity = LinePrimatives.AngleToV2(Rotation, MovementSpeed);

            Collison = new Rectangle(0, 0, (int)(sprite.texture.Width * sprite.scale), (int)(sprite.texture.Height * sprite.scale));
        }
예제 #4
0
        public override void InitalizeObject()
        {
            playerSprite          = new Sprite("Cursor");
            playerSprite.scale    = .025f;
            playerSprite.position = (ScreenSize / 2);
            playerSprite.origin.X = playerSprite.texture.Width / 2;
            playerSprite.origin.Y = playerSprite.texture.Height / 2;

            // Set this a object creation
            //Position = center;

            moveSpeed = 50;

            Velocity = LinePrimatives.AngleToV2(Rotation, moveSpeed);

            //Velocity.X = moveSpeed;
            //Velocity.Y = moveSpeed;


            Collision = new Rectangle(0, 0, (int)(playerSprite.texture.Width * playerSprite.scale), (int)(playerSprite.texture.Height * playerSprite.scale));
        }
예제 #5
0
        public override void InitalizeObject()
        {
            // set these in child classes...
            bulletSprite          = new Sprite("heart");
            bulletSprite.scale    = .025f;
            bulletSprite.origin.X = bulletSprite.texture.Width / 2;
            bulletSprite.origin.Y = bulletSprite.texture.Height / 2;

            // Set this a object creation
            //Position = center;

            moveSpeed = 50;

            Velocity = LinePrimatives.AngleToV2(Rotation, moveSpeed);

            //Velocity.X = moveSpeed;
            //Velocity.Y = moveSpeed;


            Collision = new Rectangle(0, 0, (int)(bulletSprite.texture.Width * bulletSprite.scale), (int)(bulletSprite.texture.Height * bulletSprite.scale));
        }
예제 #6
0
        public virtual void Thrust()
        {
            Vector2 newThrust = LinePrimatives.AngleToV2(RotationInDegrees, ThrustValue);

            Velocity += newThrust;
        }