Esempio n. 1
0
        public LevelInfo(XElement levelInfo, ContentManager content, IControlScheme controls, GraphicsDeviceManager graphics)
        {
            foreach (var element in levelInfo.Elements())
            {
                if (element.Name == XmlKeys.LevelName)
                    Level = new Level(WorldSelect.LevelDirectory + element.Value + ".xml",
                        controls, graphics.GraphicsDevice.Viewport);
                if (element.Name == XmlKeys.Timerstar)
                    TimerStar = Level.TimerStar = Convert.ToInt32(element.Value);

                if (element.Name == XmlKeys.Collectionstar)
                    CollectStar = Level.CollectionStar = Convert.ToInt32(element.Value);

                if (element.Name == XmlKeys.Deathstar)
                    DeathStar = Level.DeathStar = Convert.ToInt32(element.Value);

                if (element.Name == XmlKeys.Goaltime)
                    _mGoalTime = Convert.ToInt32(element.Value);

                if (element.Name == XmlKeys.Goalcollectable)
                    _mGoalCollectable = Convert.ToInt32(element.Value);

                if (element.Name == XmlKeys.Unlocked)
                    Unlocked = element.Value == XmlKeys.True;
            }
            _mContent = content;
            _mGraphics = graphics;
            _mControls = controls;
        }
Esempio n. 2
0
        public LevelInfo(XElement levelInfo, ContentManager content, IControlScheme controls, GraphicsDeviceManager graphics)
        {
            foreach (XElement element in levelInfo.Elements())
            {
                if (element.Name == XmlKeys.LEVEL_NAME)
                    mLevel = new Level(WorldSelect.LEVEL_DIRECTORY + element.Value.ToString() + ".xml",
                        controls, graphics.GraphicsDevice.Viewport);
                if (element.Name == XmlKeys.TIMERSTAR)
                    mTimeStars = mLevel.TimerStar = Convert.ToInt32(element.Value);

                if (element.Name == XmlKeys.COLLECTIONSTAR)
                    mCollectableStars = mLevel.CollectionStar = Convert.ToInt32(element.Value);

                if (element.Name == XmlKeys.DEATHSTAR)
                    mDeathStars = mLevel.DeathStar = Convert.ToInt32(element.Value);

                if (element.Name == XmlKeys.GOALTIME)
                    mGoalTime = Convert.ToInt32(element.Value);

                if (element.Name == XmlKeys.GOALCOLLECTABLE)
                    mGoalCollectable = Convert.ToInt32(element.Value);

                if (element.Name == XmlKeys.UNLOCKED)
                    mUnlocked = element.Value == XmlKeys.TRUE;
            }
            mContent = content;
            mGraphics = graphics;
            mControls = controls;
        }
Esempio n. 3
0
 /// <summary>
 /// Construcs a player object, that can live in a physical realm
 /// </summary>
 /// <param name="content">Content manager for the game</param>
 /// <param name="name">Name of the image resource for the player</param>
 /// <param name="initialPosition">Initial posisition in the level</param>
 /// <param name="scalingFactors">Factor for the image resource(i.e. half the size would be (.5,.5))</param>
 /// <param name="controlScheme">Controller scheme for the player(Controller or keyboard)</param>
 public Player(ContentManager content, String name, Vector2 scalingFactors, 
     Vector2 initialPosition,ref PhysicsEnvironment environment, IControlScheme controlScheme)
     : base(content, name, scalingFactors, initialPosition,ref environment)
 {
     mControls = controlScheme;
     mSpawnPoint = initialPosition;
 }
Esempio n. 4
0
        /// <summary>
        /// Constructor for SoundOptions screen
        /// </summary>
        /// <param name="controlScheme">Players method of control</param>
        /// <param name="graphics">Graphics manager for the game</param>
        public SoundOptions(IControlScheme controlScheme, GraphicsDeviceManager graphics)
        {
            _mControls = controlScheme;
            _mGraphics = graphics;

            _mUnselected = new Dictionary<MenuChoices, Texture2D>();
            _mSelected = new Dictionary<MenuChoices, Texture2D>();
        }
        public override void Initialize()
        {
            _controls = new KeyboardControl();

#if WINDOWS

            _mouseInput = new MouseControl();

#endif

            base.Initialize();
        }
        public override void Initialize()
        {
            _controls = new KeyboardControl();

            #if WINDOWS

            _mouseInput = new MouseControl();

            #endif

            base.Initialize();
        }
Esempio n. 7
0
        private QuickMenu quickMenu;                    // Quick Menu object



        // ===================
        // * PRIVATE METHODS *
        // ===================

        // Initialize Control Values
        private void Awake()
        {
            controls = this;

            // get class instances
            buttons        = new ButtonPresses();
            normalMovement = GetComponent <NormalMovement>();
            pauseMenu      = GetComponent <PauseMenu>();
            quickMenu      = GetComponent <QuickMenu>();

            // initialize button presses and joysticks to false
            buttons.setPresses(false);
            buttons.setPersistent(false);

            // initialize controlScheme to default
            controlScheme = normalMovement;
        }
Esempio n. 8
0
        /// <summary>
        /// Constructor for the credits screen. Sets up the list of names and categories to scrolll up
        /// </summary>
        /// <param name="controlScheme">Player's method of control</param>
        /// <param name="graphics">Graphics Manager for the game</param>
        public Credits(IControlScheme controlScheme, GraphicsDeviceManager graphics)
        {
            mControls = controlScheme;
            mGraphics = graphics;
            mTopY = mGraphics.GraphicsDevice.Viewport.TitleSafeArea.Bottom;

            //Easily add names and titles here
            mTitles = new Dictionary<string, string[]>();
            mTitles.Add("Developed At", new string[] { "University Of Utah; Senior EAE Capstone Class" });
            mTitles.Add("Executive Producer", new string[]{"Roger Altizer", "Dr. Bob Kessler"});
            mTitles.Add("Scrum Master", new string[] { "Curtis Taylor" });
            mTitles.Add("Content Director", new string[] { "Steven Doxey" });
            mTitles.Add("Technical Director", new string[] { "Tyler Robinson" });
            mTitles.Add("Character & Environmental Artist", new string[] { "Lukas Black" });
            mTitles.Add("Music & Sound", new string[] { "Steven Doxey", "Cuyler Stuwe", "Michelle MacArt" });
            mTitles.Add("Graphics Team", new string[] { "Lukas Black", "Nate Bradford", "Jeremy Heintz", "Casey Spencer" });
            mTitles.Add("Technical Team", new string[] { "Morgan Reynolds", "Tyler Robinson", "Casey Spencer", "Curtis Taylor", "Kamron Egan", "Jeremy Heintz", "Nate Bradford" });
        }
Esempio n. 9
0
        /// <summary>
        /// Construcs a player object, that can live in a physical realm
        /// </summary>
        /// <param name="content">Content manager for the game</param>
        /// <param name="name">Name of the image resource for the player</param>
        /// <param name="initialPosition">Initial posisition in the level</param>
        /// <param name="controlScheme">Controller scheme for the player(Controller or keyboard)</param>
        public Player(ContentManager content, ref PhysicsEnvironment environment, IControlScheme controlScheme, float friction, EntityInfo entity)
            : base(content, ref environment,friction, entity)
        {
            mControls = controlScheme;
            mSpawnPoint = mPosition;
            mRotation = 0.0f;
            mGoalRotation = 0.0f;

            mFaceGoalRotation = 0.0f;
            mFaceRotation = 0.0f;

            ID = entity.mId;

            PlayerFaces.Load(content);

            mCurrentTexture = PlayerFaces.FromString("Smile");
            mSize = new Vector2(mCurrentTexture.Width, mCurrentTexture.Height);
            mPreviousDirection = GravityDirections.Down;
        }
 public InteractController()
 {
     camera = Camera.main;
     Camera uiCamera = null;
     for (int i = 0; i < Camera.allCameras.Length; i++)
     {
         if (Camera.allCameras[i].name == "UICamera")
         {
             uiCamera = Camera.allCameras[i];
             break;
         }
     }
     applyDamping = interacting = panning = zooming = false;
     #if UNITY_EDITOR
     controlScheme = new MouseScheme();
     #else
     controlScheme = new TouchScheme();
     #endif
     controlScheme.Init(camera, uiCamera, InteractionBegin, InteractionUpdate, InteractionEnd, Zoom);
 }
Esempio n. 11
0
        /// <summary>
        /// Constructor for the credits screen. Sets up the list of names and categories to scrolll up
        /// </summary>
        /// <param name="controlScheme">Player's method of control</param>
        /// <param name="graphics">Graphics Manager for the game</param>
        public Credits(IControlScheme controlScheme, GraphicsDeviceManager graphics)
        {
            mControls = controlScheme;
            mGraphics = graphics;
            mTopY = mGraphics.GraphicsDevice.Viewport.TitleSafeArea.Bottom;

            mBackgroundLevel = Level.MainMenuLevel("Content\\Levels\\MainMenu.xml", mControls, mGraphics.GraphicsDevice.Viewport, mGraphics.GraphicsDevice.Viewport.Bounds);
            mBackgroundLevel.StartingPoint = new Vector2(mGraphics.GraphicsDevice.Viewport.Bounds.Center.X + mGraphics.GraphicsDevice.Viewport.Bounds.Center.X * .2f,
                                                        mGraphics.GraphicsDevice.Viewport.Bounds.Center.Y + mGraphics.GraphicsDevice.Viewport.Bounds.Center.Y * .1f);

            //Easily add names and titles here
            mTitles = new Dictionary<string, string[]>();
            mTitles.Add("Angry Newton Production", new string[] { "", "Angry" });
            mTitles.Add("Developed At", new string[] { "University Of Utah; Senior EAE Capstone Class" });
            mTitles.Add("Executive Producer", new string[]{"Roger Altizer", "Dr. Bob Kessler"});
            mTitles.Add("Original Concept & Design", new string[] { "Tyler Robinson" });
            mTitles.Add("Team Lead", new string[] { "Curtis Taylor" });
            mTitles.Add("-Programming-", new string[]{ "", "Surprise"});
            mTitles.Add("Lead Programmer", new string[] { "Tyler Robinson" });
            mTitles.Add("Programmers", new string[] { "Curtis Taylor", "Nate Bradford", "Jeremy Heintz", "Casey Spencer", "Kamron Egan", "Morgan Reynolds" });
            mTitles.Add("Xbox Tech", new string[] { "Kamron Egan" });
            mTitles.Add("-Art-", new string[] { "", "Laugh" });
            mTitles.Add("Lead Artist", new string[] { "Lukas Black" });
            mTitles.Add("Artists", new string[] { "Nate Bradford", "Jeremy Heintz", "Casey Spencer" });
            mTitles.Add("Animations", new string[] { "Lukas Black", "Nate Bradford", "Jeremy Heintz", "Kamron Egan" });
            mTitles.Add("-Design & Development-", new string[] { "", "Bored" } );
            mTitles.Add("Character Design", new string[] { "Lukas Black" });
            mTitles.Add("Level Design", new string[]{"Nate Bradford", "Curtis Taylor", "Jeremy Heintz", "Morgan Reynolds", "Steven Doxey", "Casey Spencer"});
            mTitles.Add("Game Mechanics", new string[] { "Tyler Robinson", "Curtis Taylor", "Morgan Reynolds" });
            mTitles.Add("-Music & Sound-", new string[] { "", "Worry" });
            mTitles.Add("Music Lead", new string[] { "Steven Doxey" });
            mTitles.Add("Music", new string[] { "Michelle MacArt", "Cuyler Stuwe" });
            mTitles.Add("Sound FX Lead", new string[] { "Steven Doxey" });
            mTitles.Add("Sound FX", new string[] { "Michelle MacArt", "Tyler Robinson", "Morgan Reynolds" });
            mTitles.Add("Find Us", new string[] { "", "Laugh2" });
            mTitles.Add("Our Official Website", new string[] { "TBD" });
            mTitles.Add("EAE Website", new string[] { "http://eae.utah.edu" });
            mTitles.Add("Like us on Facebook", new string[] { "http://www.facebook.com/", "Search Mr. Gravity" });
            mTitles.Add("Follow us on Twitter", new string[] { "http://www.twitter.com/AngryNewton", "Or @AngryNewton"});
        }
Esempio n. 12
0
        /// <summary>
        /// 
        /// </summary>
        /// <param name="levelInfo"></param>
        /// <param name="controls"></param>
        /// <param name="graphics"></param>
        public LevelChoice(XElement levelInfo, IControlScheme controls, ContentManager content, GraphicsDevice graphics)
        {
            foreach(var element in levelInfo.Elements())
            {
                if (element.Name == XmlKeys.LevelName)
                {
                    Level = new Level(LevelSelect.LevelDirectory + element.Value + ".xml", controls, graphics.Viewport);

            #if XBOX360
                    mThumbnail = content.Load<Texture2D>("Levels\\Thumbnail\\" + element.Value.ToString());
            #else
                    FileStream filestream;
                    try
                    {
                        filestream = new FileStream(LevelSelect.LevelThumbsDirectory + element.Value + ".png", FileMode.Open);
                    }
                    catch (IOException e)
                    {
                        var err = e.ToString();
                        filestream = new FileStream(LevelSelect.LevelThumbsDirectory + "..\\..\\..\\Content\\Images\\Error.png", FileMode.Open);
                    }
                    Thumbnail = Texture2D.FromStream(graphics, filestream);
                    filestream.Close();
            #endif
                }
                if (element.Name == XmlKeys.Unlocked)
                    Unlocked = element.Value == XmlKeys.True;

                if (element.Name == XmlKeys.Timerstar)
                    TimerStar = Level.TimerStar = Convert.ToInt32(element.Value);

                if (element.Name == XmlKeys.Collectionstar)
                    CollectionStar = Level.CollectionStar = Convert.ToInt32(element.Value);

                if (element.Name == XmlKeys.Deathstar)
                    DeathStar = Level.DeathStar = Convert.ToInt32(element.Value);
            }
        }
Esempio n. 13
0
 public Pause(IControlScheme controlScheme)
 {
     _mControls = controlScheme;
 }
Esempio n. 14
0
        /// <summary>
        ///     Constructs a new game.
        /// </summary>
        public MrGravityMain()
        {
            Components.Add(new GamerServicesComponent(this));
            Graphics = new GraphicsDeviceManager(this);
            Content.RootDirectory = "Content";

            if (GamePad.GetState(PlayerIndex.One).IsConnected || GamePad.GetState(PlayerIndex.Two).IsConnected ||
                GamePad.GetState(PlayerIndex.Three).IsConnected || GamePad.GetState(PlayerIndex.Four).IsConnected)
                _mControls = new ControllerControl();
            else
                _mControls = new KeyboardControl();

            Graphics.GraphicsProfile = GraphicsProfile.HiDef;
            LevelLocation = "DefaultLevel.xml";
        }
Esempio n. 15
0
        /// <summary>
        /// Constructs the menu screen that allows the player to select a level
        /// </summary>
        /// <param name="controlScheme">Controls that the player are using</param>
        public LevelSelect(IControlScheme controlScheme)
        {
            _mControls = controlScheme;
            _mLevels = new List<LevelChoice>();
            #if XBOX360
            LEVEL_LIST = LEVEL_LIST.Remove(0, 8);
            #endif

            _mLevelInfo = XElement.Load(LevelList);

            TrialMode = Guide.IsTrialMode;

            DeviceSelected = false;
        }
 protected void OnDestroy()
 {
     controlScheme.Destroy();
     controlScheme = null;
 }
Esempio n. 17
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Level"/> class.
        /// </summary>
        /// <param name="name">The name of the level</param>
        /// <param name="controls">The controls scheme</param>
        /// <param name="viewport">The viewport for the cameras</param>
        public Level(String filepath, IControlScheme controls, Viewport viewport)
        {
            Filepath = filepath;
            mControls = controls;

            mCam = new Camera(viewport);

            mScreenRect = viewport.TitleSafeArea;

            mRails = new List<EntityInfo>();

            mObjects = new List<GameObject>();
            mCollected = new List<GameObject>();
            mRemoveCollected = new List<GameObject>();
            mActiveAnimations = new Dictionary<Vector2, AnimatedSprite>();
            mTrigger = new List<Trigger>();
            mPhysicsEnvironment = new PhysicsEnvironment();

            mTimerStar = mDeathStar = mTimerStar = 0;
        }
Esempio n. 18
0
 public AfterScore(IControlScheme controls)
 {
     _mControls = controls;
 }
Esempio n. 19
0
 /// <summary>
 /// Constructor for controller screen
 /// </summary>
 /// <param name="controlScheme">Player's method of control</param>
 /// <param name="graphics">Graphics manager for the game</param>
 public Controller(IControlScheme controlScheme, GraphicsDeviceManager graphics)
 {
     _mControls = controlScheme;
     _mGraphics = graphics;
 }
Esempio n. 20
0
 public Scoring(IControlScheme controls)
 {
     mControls = controls;
 }
Esempio n. 21
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Level"/> class.
        /// </summary>
        /// <param name="name">The name of the level</param>
        /// <param name="controls">The controls scheme</param>
        /// <param name="viewport">The viewport for the cameras</param>
        public Level(String filepath, IControlScheme controls, Viewport viewport)
        {
            Filepath = filepath;
            mControls = controls;

            mCam = new Camera(viewport);

            mBounds = viewport.Bounds;
            mScreenRect = viewport.TitleSafeArea;

            mRails = new List<EntityInfo>();

            mObjects = new List<GameObject>();
            mCollected = new List<GameObject>();
            mRemoveCollected = new List<GameObject>();
            mActiveAnimations = new Dictionary<Vector2, AnimatedSprite>();
            mTrigger = new List<Trigger>();
            mPhysicsEnvironment = new PhysicsEnvironment();

            mTimerStar = mDeathStar = mTimerStar = 0;

            bw = new BackgroundWorker { WorkerReportsProgress = false, WorkerSupportsCancellation = false };
            bw.DoWork += UpdateParticles;
        }
Esempio n. 22
0
 /// <summary>
 /// 
 /// </summary>
 public PurchaseScreenSplash(IControlScheme controls, GraphicsDeviceManager graphics)
 {
     _mControls = controls;
     _mGraphics = graphics;
 }
Esempio n. 23
0
 public static Level MainMenuLevel(string filepath, IControlScheme controls, Viewport viewport, Rectangle region)
 {
     Level main = new Level(filepath, controls, viewport);
     main.isCameraFixed = true;
     main.shouldAnimate = false;
     main.Size = new Vector2(region.Width * 4 / 3, region.Height * 4 / 3);
     main.mStartingPoint = new Vector2(region.Width * 11 / 18, region.Height / 4);
     return main;
 }
Esempio n. 24
0
 public PreScore(IControlScheme controls)
 {
     _mControls = controls;
 }
Esempio n. 25
0
 public StartLevelSplash(IControlScheme controls)
 {
     mControls = controls;
 }
Esempio n. 26
0
        /// <summary>
        /// Constructs the menu screen that allows the player to select a level
        /// </summary>
        /// <param name="controlScheme">Controls that the player are using</param>
        public WorldSelect(IControlScheme controlScheme, GraphicsDeviceManager graphics)
        {
            _mControls = controlScheme;
            _mGraphics = graphics;

            CreateRegions();

            _mIcons = new Texture2D[6];

            _mLevels = new List<LevelInfo>();

            var levelList = "..\\..\\..\\Content\\Levels\\Info\\LevelList.xml";
            #if XBOX360
            mLevelInfo = XElement.Load(LEVEL_LIST.Remove(0,8));
            #else
            _mLevelInfo = XElement.Load(levelList);
            #endif
            DeviceSelected = false;

            _rand = new Random();
            _number = _rand.Next(4);

            _device = null;
            _loaded = false;
        }
        public GravityShiftMain()
        {
            Components.Add(new GamerServicesComponent(this));
            mGraphics = new GraphicsDeviceManager(this);
            Content.RootDirectory = "Content";
            mShowedSignIn = false;

            #if XBOX360
            mControls = new ControllerControl();
            #else
            if (GamePad.GetState(PlayerIndex.One).IsConnected || GamePad.GetState(PlayerIndex.Two).IsConnected ||
                GamePad.GetState(PlayerIndex.Three).IsConnected || GamePad.GetState(PlayerIndex.Four).IsConnected)
                mControls = new ControllerControl();
            else
                mControls = new KeyboardControl();

            mGraphics.GraphicsProfile = GraphicsProfile.Reach;

            mCheckedForSave = false;

            #endif
        }
Esempio n. 28
0
 /*
  * Menu Contructor
  *
  * Currently does not do anything
  */
 public Menu(IControlScheme controls, GraphicsDeviceManager graphics)
 {
     _mGraphics = graphics;
     _mControls = controls;
 }
Esempio n. 29
0
        /// <summary>
        /// Constructs the menu screen that allows the player to select a level
        /// </summary>
        /// <param name="controlScheme">Controls that the player are using</param>
        public WorldSelect(IControlScheme controlScheme, GraphicsDeviceManager graphics)
        {
            mControls = controlScheme;
            mGraphics = graphics;

            CreateRegions();

            mIcons = new Texture2D[6];

            mLevels = new List<LevelInfo>();

            string LEVEL_LIST = "..\\..\\..\\Content\\Levels\\Info\\LevelList.xml";
            #if XBOX360
            mLevelInfo = XElement.Load(LEVEL_LIST.Remove(0,8));
            #else
            mLevelInfo = XElement.Load(LEVEL_LIST);
            #endif
            mDeviceSelected = false;

            rand = new Random();
            number = rand.Next(4);

            device = null;
        }
    void Start()
    {
        _currentlyActiveControlScheme = ControlSchemeBuilder.BuildDefaultControlSheme();

        _currentlyActiveControlScheme.StartupActions()();
    }
Esempio n. 31
0
 public ResetConfirm(IControlScheme controlScheme)
 {
     mControls = controlScheme;
 }
Esempio n. 32
0
 /// <summary>
 /// 
 /// </summary>
 public Title(IControlScheme controls, GraphicsDeviceManager graphics)
 {
     mControls = controls;
     mGraphics = graphics;
 }