public Upgrade(IGun upgradeTarget, UpgradeType type) { this.upgradeTarget = upgradeTarget; this.upgradeType = type; playerId = upgradeTarget.PlayerId; controller = new UpgradeOption(this, playerId); }
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); }
/// <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(); }
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); }
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); } }
private void SetTouchHandler() { switch (touchScreenType) { case TouchScreenType.SingleTouch: this.iTouchHandler = new SingleTouchHandler(); break; case TouchScreenType.MultiTouch: this.iTouchHandler = new MultiTouchHandler(); break; } }
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); }
//модификация public AndroidInput(Context c, View v, float scaleX, float scaleY) { _accelHandler = new AccelerometerHandler(c); _kbHandler = new KeyboardHandler(v); _touchHandler = new MultiTouchHandler(v, scaleX, scaleY); }
/// <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; }
public void Initialize(ITouchHandler touchHandler) { m_TouchHandler = touchHandler; }
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); }
public AndroidInput(Context ctxt, View view, float scaleX, float scaleY) { touchHandler = new MultiTouchHandler (view, scaleX, scaleY); }
public AndroidInput(Context ctxt, View view, float scaleX, float scaleY) { touchHandler = new MultiTouchHandler(view, scaleX, scaleY); }
public void AddTouchHandler(ITouchHandler touchHandler) { touchHandlers.Add(touchHandler); }