Example #1
0
 public Level1Environment(Controller ctrl)
     : base(ctrl)
 {
     LoadMap("Level_1.tmx");
     Sound.StopAll(true);
     Sound.PlayCue("bg_music");
 }
Example #2
0
        public GymEnvironment(Controller ctrl)
            : base(ctrl)
        {
            //Dont do this anymore, we use the testLevel more anyways
            /*for (int i = 0; i < 20; i++)
            {
                Ship s = new CircloidShip(
                    this, randomPosition(), randomPosition(), randomPosition()
                );

                AddChild(s);
            }
            */
            Entity e = new SaphereBoss(this);
            AddChild(e);

            LoadMap("gym.tmx");

            Sound.PlayCue("bg_music");
        }
Example #3
0
        public GymEnvironment(Controller ctrl)
            : base(ctrl)
        {
            SpecialAbility special = new SpecialAbility();
            special.LoadTexture(contentManager, "bullet");
            special.Position = new Vector2(300.0f, 100.0f);
            special.DesiredVelocity = new Vector2(0.0f, 0.0f);
            AddChild(special);

            //	emit = new BulletEmitter(this, BulletEmitter.BulletStrength.Weak, true);
            //	emit = new BulletEmitter(this, BulletEmitter.BulletStrength.Medium, true);
            emit = new BulletEmitter(this, BulletEmitter.BulletStrength.Strong, true);

            emit.Position = new Vector2(210.0f, 300.0f);
            emit.Rotation = (float)3.14 * 3 / 2;
            AddChild(emit);

            for (int i = 0; i < 20; i++)
            {
                /*AddChild(new TestShip((float)r.NextDouble() * ctrl.Graphics.GraphicsDevice.Viewport.Width, (float)r.NextDouble() * ctrl.Graphics.GraphicsDevice.Viewport.Height,
                    0, 0,
                    (float)r.NextDouble() * ctrl.Graphics.GraphicsDevice.Viewport.Width, (float)r.NextDouble() * ctrl.Graphics.GraphicsDevice.Viewport.Height,
                    (float)r.NextDouble() * ctrl.Graphics.GraphicsDevice.Viewport.Width, (float)r.NextDouble() * ctrl.Graphics.GraphicsDevice.Viewport.Height,
                    this));*/

                Ship s = new Ship(null, this);
                s.TestShip((float)r.NextDouble() * ctrl.Graphics.GraphicsDevice.Viewport.Width, (float)r.NextDouble() * ctrl.Graphics.GraphicsDevice.Viewport.Height,
                    0, 0,
                    (float)r.NextDouble() * ctrl.Graphics.GraphicsDevice.Viewport.Width, (float)r.NextDouble() * ctrl.Graphics.GraphicsDevice.Viewport.Height,
                    (float)r.NextDouble() * ctrl.Graphics.GraphicsDevice.Viewport.Width, (float)r.NextDouble() * ctrl.Graphics.GraphicsDevice.Viewport.Height,
                    this);
                AddChild(s);
            }
            Ship s2 = new Ship(null, this);
            s2.TestShip(150, 150, 0, 0, this);
            AddChild(s2);
            //AddChild(new TestShip(150, 150, 0, 0, this));
            AddChild(new Crosshair(this));

            LoadMap("gym.tmx");
        }
Example #4
0
        public GameEnvironment(Controller ctrl)
            : base(ctrl)
        {
            //Frame rate variables initialize
            frameTime = 0;
            fps = 30;
            frameCounter = 0;

            // Create a new SpriteBatch, which can be used to draw textures.
            m_spriteBatch = new SpriteBatch(ctrl.GraphicsDevice);

            CollisionWorld = new Physics.Dynamics.World(Vector2.Zero);

            m_debugView = new Physics.DebugViewXNA(CollisionWorld);
            m_debugView.AppendFlags(Physics.DebugViewFlags.DebugPanel);

            // Create collision notification callbacks.
            CollisionWorld.ContactManager.PreSolve += PreSolve;

            // TODO: Scale to physics world.
            m_debugPhysicsMatrix = Matrix.CreateOrthographicOffCenter(0.0f, m_controller.GraphicsDevice.Viewport.Width * k_physicsScale, m_controller.GraphicsDevice.Viewport.Height * k_physicsScale, 0.0f, -1.0f, 1.0f);
        }
Example #5
0
 public Environment(Controller ctrl)
 {
     m_controller = ctrl;
 }
Example #6
0
 public TestLevelEnvironment(Controller ctrl)
     : base(ctrl)
 {
     LoadMap("testlevel.tmx");
     Sound.PlayCue("bg_music");
 }