예제 #1
0
        private int doubleTapCountdown = 0; // number of ticks remaining to tap again for a "double-tap".

        #endregion Fields

        #region Constructors

        // default constructor.
        public ComponentManager(int screenWidth, int screenHeight)
        {
            // these are flipped because screen is in landscape.
            _screenWidth = screenHeight;
            _screenHeight = screenWidth;

            // set initial state
            this.currentState = ComponentManagerState.noMenu;

            // create component list
            componentList = new LinkedList<Component>();

            Component copperCoin = new Component(new Vector2(XNACS1Base.RandomFloat(0, XNACS1Base.World.WorldDimension.X), XNACS1Base.RandomFloat(0, XNACS1Base.World.WorldDimension.Y)));
            copperCoin.Texture = "coppercoin";
            copperCoin.RotateAngle = XNACS1Base.RandomFloat(0, 360);
            componentList.AddLast(copperCoin);

            Component goldCoin = new Component(new Vector2(XNACS1Base.RandomFloat(0, XNACS1Base.World.WorldDimension.X), XNACS1Base.RandomFloat(0, XNACS1Base.World.WorldDimension.Y)));
            goldCoin.Texture = "goldCoin";
            goldCoin.RotateAngle = XNACS1Base.RandomFloat(0, 360);
            componentList.AddLast(goldCoin);

            Component piggybank = new Component(new Vector2(XNACS1Base.RandomFloat(0, XNACS1Base.World.WorldDimension.X), XNACS1Base.RandomFloat(0, XNACS1Base.World.WorldDimension.Y)));
            piggybank.Texture = "piggybank";
            piggybank.RotateAngle = XNACS1Base.RandomFloat(0, 360);
            componentList.AddLast(piggybank);

            Component silvercoin = new Component(new Vector2(XNACS1Base.RandomFloat(0, XNACS1Base.World.WorldDimension.X), XNACS1Base.RandomFloat(0, XNACS1Base.World.WorldDimension.Y)));
            silvercoin.Texture = "silvercoin";
            silvercoin.RotateAngle = XNACS1Base.RandomFloat(0, 360);
            componentList.AddLast(silvercoin);

            // create a RemoveComponentMenu
            // removeMenu = new RemoveComponentMenu();
        }
예제 #2
0
        // default constructor.
        public ComponentManager(int screenWidth, int screenHeight)
        {
            // these are flipped because screen is in landscape.
            _screenWidth = screenHeight;
            _screenHeight = screenWidth;

            // set initial state
            this.currentState = ComponentManagerState.noMenu;

            // create component list
            componentList = new LinkedList<Component>();

            // create a RemoveComponentMenu
            removeMenu = new RemoveComponentMenu();

            // create an AddComponentMenu
            addMenu = new AddComponentMenu();
        }
예제 #3
0
 private void showRemoveComponentMenu(Component current)
 {
     //this.currentSelected = null;
     this.doubleTapCountdown = 0;
     this.currentState = ComponentManagerState.removeComponentMenu;
     //this.removeMenu.Show();
 }
예제 #4
0
 private void hideRemoveComponentMenu()
 {
     this.doubleTapCountdown = 0;
     this.currentState = ComponentManagerState.noMenu;
     //this.removeMenu.Hide();
 }
예제 #5
0
 private void showAddComponentMenu()
 {
     this.doubleTapCountdown = 0;
     this.currentState = ComponentManagerState.addComponentMenu;
     this.addMenu.Show();
 }
예제 #6
0
 private void hideAddComponentMenu()
 {
     this.doubleTapCountdown = 0;
     this.currentState = ComponentManagerState.noMenu;
     this.addMenu.Hide();
 }