Exemplo n.º 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()
        {
            oldKS = Keyboard.GetState();
            oldMS = Mouse.GetState();

            hiteffects  = new HitEffects();
            tickeffects = new TickEffects();

            boundbox = GraphicsDevice.Viewport.Bounds;
            boundbox.Inflate(-30, -30);

            cullbox = GraphicsDevice.Viewport.Bounds;
            cullbox.Inflate(100, 100);

            drawshots       = new List <DrawingObject>();
            particles       = new List <Projectile>();
            projectiles     = new List <Projectile>();
            projectilequeue = new List <Projectile>();
            enemies         = new List <Enemy>();
            collidables     = new List <Collidable>();

            blankattack = new Attack();

            testatk1            = new Attack();
            testatk1.cooldown   = 20;
            testatk1.speed      = 15;
            testatk1.drawshot   = 6;
            testatk1.inaccuracy = 0.05f;
            testatk1.duration   = 100;
            testatk1.projcount  = 1;
            testatk1.spread     = 1f;

            //testatk1.handletick += tickeffects.seek;
            //testatk1.handleexpire += hiteffects.burst;
            testatk1.handlecollide += hiteffects.bounce;
            testatk1.handlecollide += hiteffects.burst;

            testatk2            = new Attack();
            testatk2.drawshot   = 0;
            testatk2.cooldown   = 10;
            testatk2.projcount  = 3;
            testatk2.spread     = 0.2f;
            testatk2.speed      = 15;
            testatk2.inaccuracy = 0.2f;
            testatk2.duration   = 60;

            testatk2.handleexpire  += hiteffects.burst;
            testatk2.handletick    += tickeffects.slow;
            testatk2.handlecollide += hiteffects.fizzle;
            testatk2.handlecollide += hiteffects.burst;

            edgebounce = false;

            base.IsMouseVisible = true;
            base.Initialize();
        }
Exemplo n.º 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()
        {
            oldKS = Keyboard.GetState();
            oldMS = Mouse.GetState();

            hiteffects = new HitEffects();
            tickeffects = new TickEffects();

            boundbox = GraphicsDevice.Viewport.Bounds;
            boundbox.Inflate(-30, -30);

            cullbox = GraphicsDevice.Viewport.Bounds;
            cullbox.Inflate(100, 100);

            drawshots = new List<DrawingObject>();
            particles = new List<Projectile>();
            projectiles = new List<Projectile>();
            projectilequeue = new List<Projectile>();
            enemies = new List<Enemy>();
            collidables = new List<Collidable>();

            blankattack = new Attack();

            testatk1 = new Attack();
            testatk1.cooldown = 20;
            testatk1.speed = 15;
            testatk1.drawshot = 6;
            testatk1.inaccuracy = 0.05f;
            testatk1.duration = 100;
            testatk1.projcount = 1;
            testatk1.spread = 1f;

            //testatk1.handletick += tickeffects.seek;
            //testatk1.handleexpire += hiteffects.burst;
            testatk1.handlecollide += hiteffects.bounce;
            testatk1.handlecollide += hiteffects.burst;

            testatk2 = new Attack();
            testatk2.drawshot = 0;
            testatk2.cooldown = 10;
            testatk2.projcount = 3;
            testatk2.spread = 0.2f;
            testatk2.speed = 15;
            testatk2.inaccuracy = 0.2f;
            testatk2.duration = 60;

            testatk2.handleexpire += hiteffects.burst;
            testatk2.handletick += tickeffects.slow;
            testatk2.handlecollide += hiteffects.fizzle;
            testatk2.handlecollide += hiteffects.burst;

            edgebounce = false;

            base.IsMouseVisible = true;
            base.Initialize();
        }