示例#1
0
 public void Initialize(World world, Texture2D texture, Vector2 position)
 {
     this.world = world;
     this.position = position;
     Active = true;
     powerUptexture = texture;
     Width = texture.Width;
     Height = texture.Height;
 }
示例#2
0
        public void Initialize(World world, Texture2D texture, Vector2 position)
        {
            this.world = world;
            shipPosition = position;
            ship = texture;

            health = 5;

            side = true;
            top = true;
        }
示例#3
0
 //Constructor
 public Player(World game)
 {
     mWorld = game;
     shotCooldown = 0.0f;
     shipPosition = new Vector2(270, 600);
     armor = 3;
     alive = true;
     score = 0;
     powerUp = false;
     oneUp = 0;
     keyboard = Keyboard.GetState();
     gunPosition = new Vector2(22.0f, 25.0f);
 }
示例#4
0
        public void Initialize(World world, Texture2D texture, Vector2 position, int speed, Boolean proj)
        {
            this.world = world;
            shipPosition = position;
            hit = false;
            ship = texture;
            this.speed = speed;
            projectile = proj;
            r = new Random();

            if (r.Next(0, 100) > 50)
            {
                side = true;
            }
            else
            {
                side = false;
            }
        }
示例#5
0
        /// <summary>
        /// Allows the game to perform any initialization it needs to before starting to run.
        /// This is where it can query for any required services and load any non-graphic
        /// related content.  Calling base.Initialize will enumerate through any components
        /// and initialize them as well.
        /// </summary>
        protected override void Initialize()
        {
            mWorld = new World(this, Width, Height);

            base.Initialize();
        }