Esempio n. 1
0
        /// <summary>
        /// Constructor for the GPE
        /// </summary>
        /// <param name="a_world">World for the GPE to exist in</param>
        /// <param name="a_gameState">gamestate to manage the gravity of</param>
        /// <param name="a_texture">texture for the gravity bar</param>
        /// <param name="a_camera">camera that provides the viewport to draw in</param>
        /// <param name="a_player">player that handles the gravity bar</param>
        public GPE(World a_world, GameState a_gameState, Texture2D a_texture, Camera a_camera, Player a_player)
        {
            m_camera = a_camera;
            m_gameState = a_gameState;
            m_bar = new Sprite(a_world, a_texture, new Vector2(450, 40), 0, m_camera.Position + new Vector2(0, 200));
            m_bar.m_body.BodyType = BodyType.Static;
            m_barBackground = new Sprite(a_world, a_texture, new Vector2(450, 40), 0, m_camera.Position + new Vector2(0, 200));
            m_barBackground.m_body.BodyType = BodyType.Static;
            m_bar.m_body.CollisionCategories = Category.None;
            m_barBackground.m_body.CollisionCategories = Category.None;

            m_player = a_player;
        }
Esempio n. 2
0
        /// <summary>
        /// Constructor for the Gamestate class
        /// </summary>
        /// <param name="a_gameStateManager">The manager for the gamestate</param>
        /// <param name="a_windowRes">the resolution for the screen</param>
        public GameState(GameStateManager a_gameStateManager, Rectangle a_windowRes)
        {
            m_platformList = new List<Platform>();
            m_particleList = new List<Particle>();

            //Set Resoultion
            m_windowRes = a_windowRes;

            //World
            m_world = new World(new Vector2(0, 0));

            //Gravity
            m_gravity = new Gravity(m_world, new Vector2(0, 1), 7.0f);

            m_gameStateManager = a_gameStateManager;
            m_game = m_gameStateManager.m_game;
            m_camera = new Camera(m_game.GraphicsDevice);

            m_playerSpawnLocation = new Vector2(0, 0);

            //Particle stuff
            m_particleSpawnPosition = new Vector2();
        }