コード例 #1
0
 public Upgrade(IGun upgradeTarget, UpgradeType type)
 {
     this.upgradeTarget = upgradeTarget;
     this.upgradeType   = type;
     playerId           = upgradeTarget.PlayerId;
     controller         = new UpgradeOption(this, playerId);
 }
コード例 #2
0
ファイル: AndroidInput.cs プロジェクト: Xtremrules/dot42
 public AndroidInput(Context context, View view, float scaleX, float scaleY)
 {
     if (int.Parse(Build.VERSION.SDK) < 5)
         touchHandler = new SingleTouchHandler(view, scaleX, scaleY);
     else
         touchHandler = new MultiTouchHandler(view, scaleX, scaleY);
 }
コード例 #3
0
ファイル: Tower.cs プロジェクト: Daniel-Nichol/ox-g1-surface
        /// <summary>
        /// The Tower is the central target for the enemies - if its health reaches zero the game is over.
        /// </summary>
        public Tower()
        {
            Viewport v = App.Instance.GraphicsDevice.Viewport;

            shape      = new Circle(Constants.MAIN_TURRET_RADIUS, new Vector2(v.Width / 2, v.Height / 2));
            health     = maxHealth;
            controller = new TowerTouch();
        }
コード例 #4
0
 void IStatus.Init(IActorController controller, StateHelper helper)
 {
     mController   = controller;
     mStateHelper  = helper;
     mTouchHandler = TouchHandler.GetInstance();
     fightTouch    = FightTouch._instance;
     AddCondition(IsUnderAttack, STATUS.HIT);
     AddCondition(IsControlPassive, STATUS.IDLE);//stop the state matchine update by using idle state anyway
     AddCondition(IsCanNotControl, STATUS.CANNOTCONTROL);
 }
コード例 #5
0
 public AndroidInput(Context context, View view, float scaleX, float scaleY)
 {
     if (int.Parse(Build.VERSION.SDK) < 5)
     {
         touchHandler = new SingleTouchHandler(view, scaleX, scaleY);
     }
     else
     {
         touchHandler = new MultiTouchHandler(view, scaleX, scaleY);
     }
 }
コード例 #6
0
        private void SetTouchHandler()
        {
            switch (touchScreenType)
            {
            case TouchScreenType.SingleTouch:
                this.iTouchHandler = new SingleTouchHandler();
                break;

            case TouchScreenType.MultiTouch:
                this.iTouchHandler = new MultiTouchHandler();
                break;
            }
        }
コード例 #7
0
ファイル: Turret.cs プロジェクト: Daniel-Nichol/ox-g1-surface
        public Turret(Vector2 location, int owner)
        {
            Vector2 size = new Vector2(Constants.TURRET_WIDTH, Constants.TURRET_HEIGHT);

            this.shape    = new SurfaceTower.Model.Shape.Rectangle(location - (size / 2), location + (size / 2));
            this.playerId = owner;
            Shots         = ShotPatterns.Simple;
            strength      = Constants.TURRET_DEFAULT_POWER;
            orientation   = (owner - 1) * (float)Math.PI / 2;
            controller    = new TurretMover(this);
            App.Instance.Controller.Touchables.Add(this);
            App.Instance.Model.Update += new EventHandler <UpdateArgs>(GhostUpdate);
        }
コード例 #8
0
ファイル: AndroidInput.cs プロジェクト: AlexxM/GLBasicStarter
 //модификация
 public AndroidInput(Context c, View v, float scaleX, float scaleY)
 {
     _accelHandler = new AccelerometerHandler(c);
     _kbHandler    = new KeyboardHandler(v);
     _touchHandler = new MultiTouchHandler(v, scaleX, scaleY);
 }
コード例 #9
0
 /// <summary>
 /// Sets the specified touch handler to handle user input.
 /// </summary>
 /// <param name="touch">The touch handler.</param>
 public void Set(ITouchHandler touch)
 {
     Touch = touch;
 }
コード例 #10
0
 public void Initialize(ITouchHandler touchHandler)
 {
     m_TouchHandler = touchHandler;
 }
コード例 #11
0
ファイル: Turret.cs プロジェクト: Daniel-Nichol/ox-g1-surface
 public Turret(Vector2 location, int owner)
 {
   Vector2 size = new Vector2(Constants.TURRET_WIDTH, Constants.TURRET_HEIGHT);
   this.shape = new SurfaceTower.Model.Shape.Rectangle(location - (size / 2), location + (size / 2));
   this.playerId = owner;
   Shots = ShotPatterns.Simple;
   strength = Constants.TURRET_DEFAULT_POWER;
   orientation = (owner - 1) * (float) Math.PI / 2;
   controller = new TurretMover(this);
   App.Instance.Controller.Touchables.Add(this);
   App.Instance.Model.Update += new EventHandler<UpdateArgs>(GhostUpdate);
 }
コード例 #12
0
ファイル: AndroidInput.cs プロジェクト: Paludan/BeerRun
 public AndroidInput(Context ctxt, View view, float scaleX, float scaleY)
 {
     touchHandler = new MultiTouchHandler (view, scaleX, scaleY);
 }
コード例 #13
0
 public AndroidInput(Context ctxt, View view, float scaleX, float scaleY)
 {
     touchHandler = new MultiTouchHandler(view, scaleX, scaleY);
 }
コード例 #14
0
 public void AddTouchHandler(ITouchHandler touchHandler)
 {
     touchHandlers.Add(touchHandler);
 }
コード例 #15
0
ファイル: Tower.cs プロジェクト: Daniel-Nichol/ox-g1-surface
 /// <summary>
 /// The Tower is the central target for the enemies - if its health reaches zero the game is over.
 /// </summary>
 public Tower()
 {
   Viewport v = App.Instance.GraphicsDevice.Viewport;
   shape = new Circle(Constants.MAIN_TURRET_RADIUS, new Vector2(v.Width / 2, v.Height / 2));
   health = maxHealth;
   controller = new TowerTouch();
 }