/// <summary> /// 向指定方向以指定重力条件发射球类物体(触墙自动反弹) /// </summary> /// /// <param name="o"></param> /// <param name="vx"></param> /// <param name="vy"></param> /// <param name="g"></param> /// <returns></returns> public BallTo CallBallTo(Loon.Action.Event o, int r, int vx, int vy, double g) { if (isClose) { return(null); } BallTo ball = new BallTo(r, vx, vy, g); AddActionEvent(ball, o); return(ball); }
/// <summary> /// 让指定对象执行FadeTo事件 /// </summary> /// /// <param name="o"></param> /// <param name="type"></param> /// <param name="speed"></param> /// <returns></returns> public FadeTo CallFadeTo(Loon.Action.Event o, int type, int speed) { if (isClose) { return(null); } FadeTo fade = new FadeTo(type, speed); AddActionEvent(fade, o); return(fade); }
/// <summary> /// 向指定坐标以指定速度让指定角色做为子弹发射 /// </summary> /// /// <param name="o"></param> /// <param name="x"></param> /// <param name="y"></param> /// <param name="speed"></param> /// <returns></returns> public FireTo CallFireTo(Loon.Action.Event o, int x, int y, double speed) { if (isClose) { return(null); } FireTo fire = new FireTo(x, y, speed); AddActionEvent(fire, o); return(fire); }
/// <summary> /// 让指定对象执行JumpTo跳跃事件 /// </summary> /// /// <param name="o"></param> /// <param name="j"></param> /// <param name="g"></param> /// <returns></returns> public JumpTo CallJumpTo(Loon.Action.Event o, int j, float g) { if (isClose) { return(null); } JumpTo jump = new JumpTo(j, g); AddActionEvent(jump, o); return(jump); }
/// <summary> /// 让指定角色根据指定半径以指定速度循环转动 /// </summary> /// /// <param name="o"></param> /// <param name="radius"></param> /// <param name="velocity"></param> /// <returns></returns> public CircleTo CallCircleTo(Loon.Action.Event o, int radius, int velocity) { if (isClose) { return(null); } CircleTo circle = new CircleTo(radius, velocity); AddActionEvent(circle, o); return(circle); }
/// <summary> /// 让指定角色做箭状发射(抛物线) /// </summary> /// <param name="o"></param> /// <param name="tx"></param> /// <param name="ty"></param> /// <returns></returns> public ArrowTo CallArrowTo(Loon.Action.Event o, float tx, float ty) { if (isClose) { return(null); } ArrowTo arrow = new ArrowTo(tx, ty); AddActionEvent(arrow, o); return(arrow); }
/// <summary> /// 让指定对象执行RotateTo旋转事件 /// </summary> /// /// <param name="o"></param> /// <param name="angle"></param> /// <param name="speed"></param> /// <returns></returns> public RotateTo CallRotateTo(Loon.Action.Event o, float angle, float speed) { if (isClose) { return(null); } RotateTo rotate = new RotateTo(angle, speed); AddActionEvent(rotate, o); return(rotate); }
/// <summary> /// 让指定对象执行MoveTo事件 /// </summary> /// /// <param name="field"></param> /// <param name="o"></param> /// <param name="flag"></param> /// <param name="x"></param> /// <param name="y"></param> /// <returns></returns> public MoveTo CallMoveTo(Field2D field, Loon.Action.Event o, bool flag, int x, int y) { if (isClose) { return(null); } MoveTo move = new MoveTo(field, x, y, flag); AddActionEvent(move, o); return(move); }
/// <summary> /// 让角色缩放指定大小 /// </summary> /// /// <param name="o"></param> /// <param name="sx"></param> /// <param name="sy"></param> /// <returns></returns> public ScaleTo CallScaleTo(Loon.Action.Event o, float sx, float sy) { if (isClose) { return(null); } ScaleTo scale = new ScaleTo(sx, sy); AddActionEvent(scale, o); return(scale); }
/// <summary> /// 让指定对象执行MoveTo事件 /// </summary> /// /// <param name="o"></param> /// <param name="flag"></param> /// <param name="x"></param> /// <param name="y"></param> /// <param name="w"></param> /// <param name="h"></param> /// <returns></returns> public MoveTo CallMoveTo(Loon.Action.Event o, bool flag, int x, int y, int w, int h) { if (isClose) { return(null); } if (tmpField == null) { tmpField = CreateArrayMap(w, h); } MoveTo move = new MoveTo(tmpField, x, y, flag); AddActionEvent(move, o); return(move); }
/// <summary> /// 让指定对象执行MoveTo事件 /// </summary> /// /// <param name="o"></param> /// <param name="x"></param> /// <param name="y"></param> /// <returns></returns> public MoveTo CallMoveTo(Loon.Action.Event o, int x, int y) { return(CallMoveTo(o, x, y, 32, 32)); }
/// <summary> /// 获得制定的独立事件 /// </summary> /// /// <param name="tag"></param> /// <param name="actObject"></param> /// <returns></returns> public ActionEvent GetActionEvent(object tag, Loon.Action.Event actObject) { return(ActionControl.GetInstance().GetAction(tag, actObject)); }
/// <summary> /// 添加一个独立事件 /// </summary> /// /// <param name="action"></param> /// <param name="obj"></param> public void AddActionEvent(ActionEvent action, Loon.Action.Event obj) { ActionControl.GetInstance().AddAction(action, obj); }
/// <summary> /// 让指定对象执行MoveTo事件 /// </summary> /// /// <param name="o"></param> /// <param name="x"></param> /// <param name="y"></param> /// <param name="w"></param> /// <param name="h"></param> /// <returns></returns> public MoveTo CallMoveTo(Loon.Action.Event o, int x, int y, int w, int h) { return(CallMoveTo(o, true, x, y, w, h)); }
/// <summary> /// 让指定对象执行MoveTo事件 /// </summary> /// /// <param name="field"></param> /// <param name="o"></param> /// <param name="x"></param> /// <param name="y"></param> /// <returns></returns> public MoveTo CallMoveTo(Field2D field, Loon.Action.Event o, int x, int y) { return(CallMoveTo(field, o, true, x, y)); }
/// <summary> /// 启动指定对象对应的对立事件 /// </summary> /// /// <param name="actObject"></param> public void StartActionEvent(Loon.Action.Event actObject) { ActionControl.GetInstance().Start(actObject); }
/// <summary> /// 设定指定角色暂停状态 /// </summary> /// /// <param name="pause"></param> /// <param name="actObject"></param> public void PauseActionEvent(bool pause, Loon.Action.Event actObject) { ActionControl.GetInstance().Paused(pause, actObject); }
/// <summary> /// 让角色缩放指定大小 /// </summary> /// /// <param name="o"></param> /// <param name="s"></param> /// <returns></returns> public ScaleTo CallScaleTo(Loon.Action.Event o, float s) { return(CallScaleTo(o, s, s)); }
/// <summary> /// 让指定对象执行MoveTo事件 /// </summary> /// /// <param name="o"></param> /// <param name="x"></param> /// <param name="y"></param> /// <param name="flag"></param> /// <returns></returns> public MoveTo CallMoveTo(Loon.Action.Event o, int x, int y, bool flag) { return(CallMoveTo(o, flag, x, y, 32, 32)); }
/// <summary> /// 添加一个独立事件,并选择是否暂不启动 /// </summary> /// /// <param name="action"></param> /// <param name="obj"></param> /// <param name="paused"></param> public void AddActionEvent(ActionEvent action, Loon.Action.Event obj, bool paused) { ActionControl.GetInstance().AddAction(action, obj, paused); }
/// <summary> /// 让指定对象执行FadeTo淡出事件 /// </summary> /// /// <param name="o"></param> /// <param name="speed"></param> /// <returns></returns> public FadeTo CallFadeOutTo(Loon.Action.Event o, int speed) { return(CallFadeTo(o, FadeEffect.TYPE_FADE_OUT, speed)); }
/// <summary> /// 删除所有和指定对象有关的独立事件 /// </summary> /// /// <param name="actObject"></param> public void RemoveActionEvents(Loon.Action.Event actObject) { ActionControl.GetInstance().RemoveAllActions(actObject); }
/// <summary> /// 删除指定的独立事件 /// </summary> /// /// <param name="tag"></param> /// <param name="actObject"></param> public void RemoveActionEvent(object tag, Loon.Action.Event actObject) { ActionControl.GetInstance().RemoveAction(tag, actObject); }