예제 #1
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()
        {
            inputManager = new InputManager();

            player = new Player();

            score = 0;

            background = new ParallaxBackground();

            enemies           = new List <Enemy>();
            previousSpawnTime = TimeSpan.Zero;
            enemySpawnTime    = TimeSpan.FromSeconds(1f);

            random = new Random();

            projectiles = new List <Projectile>();
            fireTime    = TimeSpan.FromSeconds(.25f);

            explosions = new List <Animation>();

            base.Initialize();
        }
예제 #2
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()
        {
            nivelTiro = 1;
            posicaoCursor = 0;
            // TODO: Add your initialization logic here
            player = new Player();
            // Set a constant player move speed
            playerMoveSpeed = 8.0f;

            bgLayer1 = new ParallaxBackground();
            bgLayer2 = new ParallaxBackground();
            // Initialize the enemies list
            enemies = new List<Enemy>();

            // Set the time keepers to zero
            previousSpawnTime = TimeSpan.Zero;

            // Used to determine how fast enemy respawns
            enemySpawnTime = TimeSpan.FromSeconds(1.0f);

            // Initialize our random number generator
            random = new Random();
            //Enable the FreeDrag gesture.
            //TouchPanel.EnabledGestures = GestureType.FreeDrag;

            projectiles = new List<Projectile>();
            explosions = new List<Animation>();
            // Set the laser to fire every quarter second
            fireTime = TimeSpan.FromSeconds(.15f);
            //Set player's score to zero
            score = 0;
            estado = EstadoJogo.Menu;

            base.Initialize();
        }
예제 #3
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()
        {
            inputManager = new InputManager();

            player = new Player();

            score = 0;

            background = new ParallaxBackground();

            enemies = new List<Enemy>();
            previousSpawnTime = TimeSpan.Zero;
            enemySpawnTime = TimeSpan.FromSeconds(1f);

            random = new Random();

            projectiles = new List<Projectile>();
            fireTime = TimeSpan.FromSeconds(.25f);

            explosions = new List<Animation>();

            base.Initialize();
        }